Skip to content

Commit 37f35bb

Browse files
Auto merge of #148636 - xSetech:boostrap/set-python-on-macos, r=<try>
bootstrap: respect `build.python` on macOS try-job: aarch64-apple
2 parents 0bbef55 + dfed688 commit 37f35bb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/bootstrap/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,10 +1525,11 @@ impl Build {
15251525
/// Path to the python interpreter to use
15261526
fn python(&self) -> &Path {
15271527
if self.config.host_target.ends_with("apple-darwin") {
1528-
// Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
1529-
// LLDB plugin's compiled module which only works with the system python
1530-
// (namely not Homebrew-installed python)
1531-
Path::new("/usr/bin/python3")
1528+
// LLDB tests require the Python version the LLDB plugin was built for.
1529+
// On macOS, the system Python/LLDB are compatible. Many users install
1530+
// Homebrew Python but not Homebrew LLVM, so default to system Python.
1531+
// Can be overridden via `build.python` for custom LLVM installations.
1532+
self.config.python.as_deref().unwrap_or_else(|| Path::new("/usr/bin/python3"))
15321533
} else {
15331534
self.config
15341535
.python

0 commit comments

Comments
 (0)