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: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
57
57
58
58
### Fixed
59
59
60
+
- Fix `cargo test` with `extension-module` feature. (Requires `cargo +nightly` for now.) #[2135](https://github.com/PyO3/pyo3/pull/2135)
60
61
- Fix undefined symbol for `PyObject_HasAttr` on PyPy. [#2025](https://github.com/PyO3/pyo3/pull/2025)
61
62
- Fix memory leak in `PyErr::into_value`. [#2026](https://github.com/PyO3/pyo3/pull/2026)
62
63
- Fix clippy warning `needless-option-as-deref` in code generated by `#[pyfunction]` and `#[pymethods]`. [#2040](https://github.com/PyO3/pyo3/pull/2040)
## I can't run `cargo test`: I'm having linker issues like "Symbol not found" or "Undefined reference to _PyExc_SystemError"!
18
+
## I can't run `cargo test` or `cargo run`: I'm having linker issues like "Symbol not found" or "Undefined reference to _PyExc_SystemError"!
19
19
20
-
Currently, [#340](https://github.com/PyO3/pyo3/issues/340) causes `cargo test` to fail with linking errors when the `extension-module` feature is activated. For now you can work around this by making the `extension-module` feature optional and running the tests with `cargo test --no-default-features`:
20
+
On unix operating systems the `extension-module` feature is required to disable linking against libpython to meet criteria of how Python extension modules should be built.
21
21
22
-
```toml
23
-
[dependencies.pyo3]
24
-
{{#PYO3_CRATE_VERSION}}
22
+
PyO3 is able to re-enable linking for binaries and tests in the project, but this requires a `cargo` version capable of understanding extra linker arguments. This is only supported on nightly cargoes from February of 2022 or newer.
25
23
26
-
[features]
27
-
extension-module = ["pyo3/extension-module"]
28
-
default = ["extension-module"]
24
+
```text
25
+
# For cargo test
26
+
cargo +nightly test
27
+
# For cargo run
28
+
cargo +nightly run
29
29
```
30
30
31
31
## I can't run `cargo test`: my crate cannot be found for tests in `tests/` directory!
0 commit comments