Skip to content

Commit

Permalink
Set PYO3_PYTHON env var for PyPy when abi3 is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Jun 9, 2022
1 parent 4789767 commit 3081be6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3081be6

Please sign in to comment.