mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
look for python2 symlinks before bootstrap python
Before this commit, if you're running x.py directly on a system where `python` is symlinked to Python 3, then the `python` config option will default to a Python 3 interpreter. This causes debuginfo tests to fail with an opaque error message, since they have a hard requirement on Python 2. This commit modifies the Python probe behavior to look for python2.7 and python2 *before* using the interpreter used to execute `x.py`.
This commit is contained in:
parent
5360ded0e5
commit
12d8a7d64e
@ -162,6 +162,9 @@
|
|||||||
# Python interpreter to use for various tasks throughout the build, notably
|
# Python interpreter to use for various tasks throughout the build, notably
|
||||||
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
|
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
|
||||||
# Note that Python 2 is currently required.
|
# Note that Python 2 is currently required.
|
||||||
|
#
|
||||||
|
# Defaults to python2.7, then python2. If neither executable can be found, then
|
||||||
|
# it defaults to the Python interpreter used to execute x.py.
|
||||||
#python = "python2.7"
|
#python = "python2.7"
|
||||||
|
|
||||||
# Force Cargo to check that Cargo.lock describes the precise dependency
|
# Force Cargo to check that Cargo.lock describes the precise dependency
|
||||||
|
@ -109,9 +109,9 @@ pub fn check(build: &mut Build) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build.config.python = build.config.python.take().map(|p| cmd_finder.must_have(p))
|
build.config.python = build.config.python.take().map(|p| cmd_finder.must_have(p))
|
||||||
.or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
|
|
||||||
.or_else(|| cmd_finder.maybe_have("python2.7"))
|
.or_else(|| cmd_finder.maybe_have("python2.7"))
|
||||||
.or_else(|| cmd_finder.maybe_have("python2"))
|
.or_else(|| cmd_finder.maybe_have("python2"))
|
||||||
|
.or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
|
||||||
.or_else(|| Some(cmd_finder.must_have("python")));
|
.or_else(|| Some(cmd_finder.must_have("python")));
|
||||||
|
|
||||||
build.config.nodejs = build.config.nodejs.take().map(|p| cmd_finder.must_have(p))
|
build.config.nodejs = build.config.nodejs.take().map(|p| cmd_finder.must_have(p))
|
||||||
|
Loading…
Reference in New Issue
Block a user