diff options
| author | Mark Simulacrum <mark.simulacrum@gmail.com> | 2017-06-22 06:30:11 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-22 06:30:11 -0600 |
| commit | ea7db0787d9e03ffbe7e3f9aea2875ea077fc1e8 (patch) | |
| tree | 831fc9ef9a7b6d5a210cd222ac665012421faf67 /src | |
| parent | a859f2bd4b5c3e0a893a888ddc4f30fe7c302cdb (diff) | |
| parent | f441e07feb0d8421beaedc5223478bb6e08a5462 (diff) | |
| download | rust-ea7db0787d9e03ffbe7e3f9aea2875ea077fc1e8.tar.gz rust-ea7db0787d9e03ffbe7e3f9aea2875ea077fc1e8.zip | |
Rollup merge of #42805 - stepancheg:forward-python, r=alexcrichton
Pass path to python from bootstrap.py to bootstrap.rs When bootstrap is executed with python not in `$PATH`, (e. g. `c:\Python27\python.exe x.py test`) bootstrap cannot find python and crashes. This commit passes path to python in `BOOTSTRAP_PYTHON` env var.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 1 | ||||
| -rw-r--r-- | src/bootstrap/sanity.rs | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 1d3b77916d6..8dc2875ec42 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -668,6 +668,7 @@ def bootstrap(): env["BUILD"] = rb.build env["SRC"] = rb.rust_root env["BOOTSTRAP_PARENT_ID"] = str(os.getpid()) + env["BOOTSTRAP_PYTHON"] = sys.executable run(args, env=env, verbose=rb.verbose) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index df6378a970b..5ccd131b77a 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -23,6 +23,7 @@ use std::env; use std::ffi::{OsStr, OsString}; use std::fs; use std::process::Command; +use std::path::PathBuf; use build_helper::output; @@ -87,6 +88,12 @@ pub fn check(build: &mut Build) { } if build.config.python.is_none() { + // set by bootstrap.py + if let Some(v) = env::var_os("BOOTSTRAP_PYTHON") { + build.config.python = Some(PathBuf::from(v)); + } + } + if build.config.python.is_none() { build.config.python = have_cmd("python2.7".as_ref()); } if build.config.python.is_none() { |
