Rollup merge of #95441 - AlecGoncharow:issue-95204-fix, r=Mark-Simulacrum
Always use system `python3` on MacOS This PR includes 2 changes: 1. Always use the system Python found at `/usr/bin/python3` on MacOS 2. Removes the hard requirement on having `python` in your system path if you didn't specify alternatives. The proposed change will instead attempt to find and use in order: `python` -> `python3` -> `python2`. This change isn't strictly necessary but without any change to this check, the original issue inspiring this change will still exist. Fixes #95204 r? ```@jyn514```
This commit is contained in:
@@ -1176,7 +1176,17 @@ impl Build {
|
||||
|
||||
/// Path to the python interpreter to use
|
||||
fn python(&self) -> &Path {
|
||||
self.config.python.as_ref().unwrap()
|
||||
if self.config.build.ends_with("apple-darwin") {
|
||||
// Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
|
||||
// LLDB plugin's compiled module which only works with the system python
|
||||
// (namely not Homebrew-installed python)
|
||||
Path::new("/usr/bin/python3")
|
||||
} else {
|
||||
self.config
|
||||
.python
|
||||
.as_ref()
|
||||
.expect("python is required for running LLDB or rustdoc tests")
|
||||
}
|
||||
}
|
||||
|
||||
/// Temporary directory that extended error information is emitted to.
|
||||
|
||||
Reference in New Issue
Block a user