From 6d827f03be9168ee4b9cc799f80b2c1ead16453b Mon Sep 17 00:00:00 2001 From: messense Date: Thu, 9 Jun 2022 20:42:59 +0800 Subject: [PATCH] Set `PYO3_PYTHON` env var for PyPy when abi3 is enabled --- Changelog.md | 1 + src/compile.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index c3312e5d4..a0a44654a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Compare minimum python version requirement between `requires-python` and bindings crate in [#954](https://github.com/PyO3/maturin/pull/954) * Add a `--target` option to `maturin list-python` command in [#957](https://github.com/PyO3/maturin/pull/957) * Add support for using bundled python sysconfigs for PyPy when abi3 feature is enabled in [#958](https://github.com/PyO3/maturin/pull/958) +* Set `PYO3_PYTHON` env var for PyPy when abi3 is enabled in [#960](https://github.com/PyO3/maturin/pull/960) ## [0.12.19] - 2022-06-05 diff --git a/src/compile.rs b/src/compile.rs index bf9e43e58..cdd655e4b 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -302,7 +302,11 @@ fn compile_target( if let Some(interpreter) = python_interpreter { // Target python interpreter isn't runnable when cross compiling if interpreter.runnable { - if bindings_crate.is_bindings("pyo3") || bindings_crate.is_bindings("pyo3-ffi") { + if bindings_crate.is_bindings("pyo3") + || bindings_crate.is_bindings("pyo3-ffi") + || (matches!(bindings_crate, BridgeModel::BindingsAbi3(_, _)) + && matches!(interpreter.interpreter_kind, InterpreterKind::PyPy)) + { build_command.env("PYO3_PYTHON", &interpreter.executable); }