Skip to content

Commit 9b55593

Browse files
indygregdavidhewitt
authored andcommitted
build: document InterpreterConfig fields
I'm building functionality on top of this config and figured I'd take the time to document the fields to make things easier to understand.
1 parent a08587b commit 9b55593

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

pyo3-build-config/src/impl_.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,60 @@ pub fn env_var(var: &str) -> Option<OsString> {
4545
/// strategies are used to populate this type.
4646
#[cfg_attr(test, derive(Debug, PartialEq))]
4747
pub struct InterpreterConfig {
48+
/// The Python implementation flavor.
49+
///
50+
/// Serialized to `implementation`.
4851
pub implementation: PythonImplementation,
52+
53+
/// Python `X.Y` version. e.g. `3.9`.
54+
///
55+
/// Serialized to `version`.
4956
pub version: PythonVersion,
57+
58+
/// Whether link library is shared.
59+
///
60+
/// Serialized to `shared`.
5061
pub shared: bool,
62+
63+
/// Whether linking against the stable/limited Python 3 API.
64+
///
65+
/// Serialized to `abi3`.
5166
pub abi3: bool,
67+
68+
/// The name of the link library defining Python.
69+
///
70+
/// This effectively controls the `cargo:rustc-link-lib=<name>` value to
71+
/// control how libpython is linked. Values should not contain the `lib`
72+
/// prefix.
73+
///
74+
/// Serialized to `lib_name`.
5275
pub lib_name: Option<String>,
76+
77+
/// The directory containing the Python library to link against.
78+
///
79+
/// The effectively controls the `cargo:rustc-link-search=native=<path>` value
80+
/// to add an additional library search path for the linker.
81+
///
82+
/// Serialized to `lib_dir`.
5383
pub lib_dir: Option<String>,
84+
85+
/// Path of host `python` executable.
86+
///
87+
/// This is a valid executable capable of running on the host/building machine.
88+
/// For configurations derived by invoking a Python interpreter, it was the
89+
/// executable invoked.
90+
///
91+
/// Serialized to `executable`.
5492
pub executable: Option<String>,
93+
94+
/// Width in bits of pointers on the target machine.
95+
///
96+
/// Serialized to `pointer_width`.
5597
pub pointer_width: Option<u32>,
98+
99+
/// Additional relevant Python build flags / configuration settings.
100+
///
101+
/// Serialized to `build_flags`.
56102
pub build_flags: BuildFlags,
57103
}
58104

0 commit comments

Comments
 (0)