-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass path to python from bootstrap.py to bootstrap.rs #42805
Conversation
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.
(rust_highfive has picked a reviewer for you, use r? to override) |
src/bootstrap/sanity.rs
Outdated
match env::var("BOOTSTRAP_PYTHON") { | ||
Ok(v) => build.config.python = Some(PathBuf::from(v)), | ||
Err(env::VarError::NotPresent) => {} | ||
Err(e) => panic!("BOOTSTRAP_PYTHON var is incorrect: {:?}", e), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's any reason for us to use env::var
(that is, invalid UTF-8 for the python path seems fine -- we store a PathBuf). That should make this case impossible, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks! I've updated the PR.
664e362
to
f441e07
Compare
This looks good to me, but r? @alexcrichton |
@bors: r+ |
📌 Commit f441e07 has been approved by |
@bors rollup |
…ichton 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.
…ichton 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.
…ichton 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.
When bootstrap is executed with python not in
$PATH
, (e. g.c:\Python27\python.exe x.py test
) bootstrap cannot find pythonand crashes.
This commit passes path to python in
BOOTSTRAP_PYTHON
env var.Fixes #41647.