diff --git a/src/compile.rs b/src/compile.rs index bc77b0722..a3f400dcf 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -1,5 +1,4 @@ use crate::build_context::BridgeModel; -use crate::python_interpreter::InterpreterKind; use crate::{BuildContext, PlatformTag, PythonInterpreter}; use anyhow::{anyhow, bail, Context, Result}; use fat_macho::FatWriter; @@ -176,23 +175,6 @@ fn compile_target( rustc_args.extend(&["-C", "link-arg=-s"]); } - let pythonxy_lib_folder; - if let BridgeModel::BindingsAbi3(_, _) = bindings_crate { - // NB: We set PYO3_NO_PYTHON further below. - // On linux, we can build a shared library without the python - // providing these symbols being present, on mac we can do it with - // the `-undefined dynamic_lookup` we use above anyway. On windows - // however, we get an exit code 0xc0000005 if we try the same with - // `/FORCE:UNDEFINED`, so we still look up the python interpreter - // and pass the location of the lib with the definitions. - if target.is_windows() { - let python_interpreter = python_interpreter - .expect("Must have a python interpreter for building abi3 on windows"); - pythonxy_lib_folder = format!("native={}", python_interpreter.libs_dir.display()); - rustc_args.extend(&["-L", &pythonxy_lib_folder]); - } - } - let cargo_args = vec!["--message-format", "json"]; let build_args: Vec<_> = cargo_args @@ -233,17 +215,6 @@ fn compile_target( // but forwarding stderr is still useful in case there some non-json error .stderr(Stdio::inherit()); - if let BridgeModel::BindingsAbi3(_, _) = bindings_crate { - let is_pypy = python_interpreter - .map(|p| p.interpreter_kind == InterpreterKind::PyPy) - .unwrap_or(false); - if !is_pypy { - // This will make pyo3's build script only set some predefined linker - // arguments without trying to read any python configuration - build_command.env("PYO3_NO_PYTHON", "1"); - } - } - if let Some(python_interpreter) = python_interpreter { // Target python interpreter isn't runnable when cross compiling if python_interpreter.runnable {