You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/src/building-and-distribution/multiple-python-versions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,11 +36,11 @@ To see a full reference of all the `#[cfg]` flags provided, see the [`pyo3-build
36
36
37
37
You can use the `#[cfg]` flags in just two steps:
38
38
39
-
1. Add `pyo3-build-config`with the [`resolve-config`](../features.md#resolve-config) feature enabled to your crate's build dependencies in `Cargo.toml`:
39
+
1. Add `pyo3-build-config` to your crate's build dependencies in `Cargo.toml`:
40
40
41
41
```toml
42
42
[build-dependencies]
43
-
pyo3-build-config = { {{#PYO3_CRATE_VERSION}}, features = ["resolve-config"] }
43
+
pyo3-build-config = {{#PYO3_CRATE_VERSION}}
44
44
```
45
45
46
46
2. Add a [`build.rs`](https://doc.rust-lang.org/cargo/reference/build-scripts.html) file to your crate with the following contents:
Copy file name to clipboardExpand all lines: guide/src/features.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,12 +105,6 @@ See [the `#[pyclass]` implementation details](class.md#implementation-details) f
105
105
The `nightly` feature needs the nightly Rust compiler.
106
106
This allows PyO3 to use the `auto_traits` and `negative_impls` features to fix the `Python::detach` function.
107
107
108
-
### `resolve-config`
109
-
110
-
The `resolve-config` feature of the `pyo3-build-config` crate controls whether that crate's build script automatically resolves a Python interpreter / build configuration.
111
-
This feature is primarily useful when building PyO3 itself.
112
-
By default this feature is not enabled, meaning you can freely use `pyo3-build-config` as a standalone library to read or write PyO3 build configuration files or resolve metadata about a Python interpreter.
113
-
114
108
## Optional Dependencies
115
109
116
110
These features enable conversions between Python types and types from other Rust crates, enabling easy access to the rest of the Rust ecosystem.
For `string::FromUtf16Error` and `char::DecodeUtf16Error` the Rust error types do not contain any of the information required to construct a `UnicodeDecodeError`.
37
37
To raise a Python `UnicodeDecodeError` a new error should be manually constructed by calling `PyUnicodeDecodeError::new_err(...)`.
38
38
39
+
### `pyo3_build_config` APIs now require a direct dependency on `pyo3` or `pyo3-ffi`
40
+
41
+
Prior to PyO3 0.29, `pyo3-build-config` would inline part of the build configuration into the crate in its own build script.
42
+
This worked for simple builds but not for cross-compiling; `pyo3-ffi`'s build script would need to re-implement a lot of the same machinery to correctly configure the build for cross-compilation.
43
+
There were also edge cases where `pyo3-build-config` would use this inlined configuration incorrectly and misconfigure the build - e.g. [when cross compiling with `buck` or `bazel` build systems](https://github.com/PyO3/pyo3/issues/4579).
44
+
45
+
In PyO3 0.29, `pyo3-build-config` no longer inlines any configuration into itself and instead requires a direct dependency on either `pyo3-ffi` or `pyo3` to load the configuration resolved from `pyo3-ffi`'s build script.
46
+
47
+
This has upside of faster compilation - `pyo3-build-config` no longer has a build script and never recompiles when changing Python version.
48
+
It also guarantees that all builds are based on the single fully-configured build configuration resolved by `pyo3-ffi`.
0 commit comments