Skip to content

Commit

Permalink
HACK: Override PYO3_CROSS_LIB_DIR env var
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Nov 17, 2021
1 parent 2d0e7c2 commit 2278c17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ pub fn find_interpreter(
env::set_var("PYTHON_SYS_EXECUTABLE", &host_python.executable);

let sysconfig_path = find_sysconfigdata(cross_lib_dir.as_ref(), target)?;
env::set_var(
"MATURIN_PYTHON_SYSCONFIGDATA_DIR",
sysconfig_path.parent().unwrap(),
);

let sysconfig_data = parse_sysconfigdata(host_python, sysconfig_path)?;
let major = sysconfig_data
.get("version_major")
Expand Down
4 changes: 4 additions & 0 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ fn compile_target(
}
}

if let Some(lib_dir) = env::var_os("MATURIN_PYTHON_SYSCONFIGDATA_DIR") {
build_command.env("PYO3_CROSS_LIB_DIR", lib_dir);
}

let mut cargo_build = build_command.spawn().context("Failed to run cargo")?;

let mut artifacts = HashMap::new();
Expand Down

0 comments on commit 2278c17

Please sign in to comment.