Skip to content

Commit

Permalink
fix: use PYO3_CROSS_LIB_DIR value as lib_dir when cross-compiling (#4350
Browse files Browse the repository at this point in the history
) (#4389)

Co-authored-by: Paul-Erwan RIO <paulerwan.rio@proton.me>
  • Loading branch information
Thalyum and Paul-Erwan RIO authored Oct 18, 2024
1 parent face593 commit dc415fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions newsfragments/4389.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix invalid library search path `lib_dir` when cross-compiling.
5 changes: 4 additions & 1 deletion pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,10 @@ fn cross_compile_from_sysconfigdata(
) -> Result<Option<InterpreterConfig>> {
if let Some(path) = find_sysconfigdata(cross_compile_config)? {
let data = parse_sysconfigdata(path)?;
let config = InterpreterConfig::from_sysconfigdata(&data)?;
let mut config = InterpreterConfig::from_sysconfigdata(&data)?;
if let Some(cross_lib_dir) = cross_compile_config.lib_dir_string() {
config.lib_dir = Some(cross_lib_dir)
}

Ok(Some(config))
} else {
Expand Down

0 comments on commit dc415fa

Please sign in to comment.