-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
python: https://github.com/rust-lang/rust/blob/beb480d908f091e7c42c866e13641f26b2ee230b/src/bootstrap/sanity.rs#L100-L106
python3: https://github.com/rust-lang/rust/blob/beb480d908f091e7c42c866e13641f26b2ee230b/src/bootstrap/test.rs#L1382-L1386
It sounds like python3 is strictly required for LLDB, so we should move this check from test.rs to builder.python()
, which will only require python3
instead of both commands.
cc @Walther
@rustbot label: +E-easy +E-mentor +E-help-wanted +A-rustbuild +A-contributor-roadblock
Metadata
Metadata
Assignees
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Mark-Simulacrum commentedon Mar 22, 2022
But not everyone will want to run lldb, right? We only mention /usr/bin/python3 there, we don't actually run it unless lldb tests are run, which is pretty rare.
This may still be an OK change, of course.
jyn514 commentedon Mar 22, 2022
Sure - but in that case, we hardly need python at all, only for rustdoc tests, and it seems ok to use the system python.
pierwill commentedon Mar 22, 2022
I would actually support requiring Python 3 in any case.
jyn514 commentedon Mar 22, 2022
@pierwill let's please keep discussion about 2 vs 3 in #71818 and not relitigate it on each issue that mentions python.
AlecGoncharow commentedon Mar 24, 2022
@rustbot claim
AlecGoncharow commentedon Mar 24, 2022
If I understand the issue here correctly, just moving the check from test.rs to the
builder.python()
doesn't entirely remove the issue of needing thepython
name defined on MacOS given the call tocmd_finder.must_have("python")
in sanity.rs. To resolve this should the check in sanity.rs include a MacOS specific check for/usr/bin/python3
or an additional check forpython3
?jyn514 commentedon Mar 24, 2022
The former - it should just use
/usr/bin/python3
any time it needs python on MacOS, and remove the existing check forpython
on that platform.AlecGoncharow commentedon Mar 24, 2022
About to raise a PR, but is it even necessary to perform any check in
builder.python()
if we are always forcing/usr/bin/python3
in sanity.rs? Are there instances wheresanity::check
won't be called beforeCompileTest::run
?Also first time using
x.py
, what would be the correct test to run here?jyn514 commentedon Mar 24, 2022
I don't think it's necessary to check in both places, no, you can return /usr/bin/python3 unconditionally in builder.python(). Whether you can remove the check in sanity.rs is a question for @Mark-Simulacrum - I think probably yes, since you can still run the build without python, but it doesn't necessarily need to go in the same change switching to /bin/python3 consistently.
Basically everything runs the check in sanity.rs, but I think it's only relevant when BOOTSTRAP_PYTHON is unset, so probably you'll need
cargo run check
to make sure the check executes. If you want to check the version of python used works, you can runcargo run test --stage 1 src/test/rustdoc
.Mark-Simulacrum commentedon Mar 25, 2022
If we can rely on /usr/bin/python3 always existing on macOS there's no need to check for it, but I would expect that the code in sanity.rs isn't platform-specific and so should continue to look for python in a variety of ways (likely the same ways across all platforms).
It looks like python is currently used for two separate things: lldb tests, and docck. The latter likely works with python 2 and python 3, or at least, so it's likely that we need to leave the discovery and configuration in place. Certainly on e.g. Windows /usr/bin/python3 is not expected to exist, I believe.
python3
on MacOS #95441Rollup merge of rust-lang#95441 - AlecGoncharow:issue-95204-fix, r=Ma…
Rollup merge of rust-lang#95441 - AlecGoncharow:issue-95204-fix, r=Ma…
Rollup merge of rust-lang#95441 - AlecGoncharow:issue-95204-fix, r=Ma…