Skip to content

Commit

Permalink
Reject -i python when cross compiling (#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
messense authored Dec 19, 2023
1 parent b304092 commit 1d7ad9d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,16 @@ impl BuildOptions {
}
interpreters =
find_interpreter_in_sysconfig(interpreter, target, requires_python)?;
if interpreters.is_empty() {
bail!(
"Couldn't find any python interpreters from '{}'. Please check that both major and minor python version have been specified in -i/--interpreter.",
interpreter
.iter()
.map(|p| p.display().to_string())
.collect::<Vec<_>>()
.join(", ")
);
}
}
} else if binding_name.starts_with("pyo3") {
// Only pyo3/pyo3-ffi bindings supports bundled sysconfig interpreters
Expand Down

0 comments on commit 1d7ad9d

Please sign in to comment.