-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Move some more bootstrap logic from python to rust #92260
Conversation
d201ec7
to
7b4aef9
Compare
This comment has been minimized.
This comment has been minimized.
7b4aef9
to
ca3825c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I am confused. |
The build-dir directory is relative to the current working directory (not the checkout directory). The docker scripts set the workdir to |
☔ The latest upstream changes (presumably #92482) made this pull request unmergeable. Please resolve the merge conflicts. |
eb96446
to
b3929be
Compare
actually, let me switch rustbuild to using |
b3929be
to
d68021d
Compare
This comment has been minimized.
This comment has been minimized.
d68021d
to
f2426ba
Compare
# Read from `RUST_BOOTSTRAP_CONFIG`, then `--config`, then fallback to `config.toml` (if it
# exists).
toml_path = os.getenv('RUST_BOOTSTRAP_CONFIG') or args.config uhhh it seems pretty strange to me that the env variable would take precedence over --config, but I don't want to change it here |
f2426ba
to
c91ca29
Compare
💥 Test timed out |
@bors retry test various timed out |
@@ -440,3 +440,112 @@ fn fail(s: &str) -> ! { | |||
println!("\n\n{}\n\n", s); | |||
std::process::exit(1); | |||
} | |||
|
|||
/// Copied from `std::path::absolute` until it stabilizes. |
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.
Couldn't we just have bootstrap use the nightly feature until it's stabilized?
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (64187b8): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
This was part of Mark's original PR in rust-lang@ecb424f, but I missed it when writing rust-lang#92260.
…Simulacrum Allow `cargo run` instead of `cargo run -p bootstrap` This was part of `@Mark-Simulacrum` 's original PR in rust-lang@ecb424f, but I missed it when writing rust-lang#92260. This also has the side effect of allowing `cargo build --bins` instead of `cargo build -p bootstrap --bins`. I'm not sure when you would want to run cargo build/check/test without going through bootstrap, but this still allows you to do so as long as you pass `-p` for all the crates you want to build.
When I implemented rust-only bootstrapping in rust-lang#92260, I neglected to test stage0 tools - it turns out they were broken because they couldn't find the sysroot of the initial bootstrap compiler. This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a sysroot and hard-coding the relative directory.
…acrum Fix `cargo run tidy` When I implemented rust-only bootstrapping in rust-lang#92260, I neglected to test stage0 tools - it turns out they were broken because they couldn't find the sysroot of the initial bootstrap compiler. This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a sysroot and hard-coding the relative directory. Fixes rust-lang#94797 (properly, without having to change rustup).
…acrum Fix `cargo run tidy` When I implemented rust-only bootstrapping in rust-lang#92260, I neglected to test stage0 tools - it turns out they were broken because they couldn't find the sysroot of the initial bootstrap compiler. This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a sysroot and hard-coding the relative directory. Fixes rust-lang#94797 (properly, without having to change rustup).
…acrum Fix `cargo run tidy` When I implemented rust-only bootstrapping in rust-lang#92260, I neglected to test stage0 tools - it turns out they were broken because they couldn't find the sysroot of the initial bootstrap compiler. This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a sysroot and hard-coding the relative directory. Fixes rust-lang#94797 (properly, without having to change rustup).
…acrum Fix `cargo run tidy` When I implemented rust-only bootstrapping in rust-lang#92260, I neglected to test stage0 tools - it turns out they were broken because they couldn't find the sysroot of the initial bootstrap compiler. This fixes stage0 tools by using `rustc --print sysroot` instead of assuming rustc is already in a sysroot and hard-coding the relative directory. Fixes rust-lang#94797 (properly, without having to change rustup).
Same rationale as #76544; it would be nice to make python entirely optional at some point.
This also removes $ROOT as an option for the build directory; I haven't been using it, and like Alex
said in #76544 (comment) it seems like a misfeature.
This allows running
cargo run
from src/bootstrap, although that still giveslots of compile errors if you don't use the beta toolchain. It's not exactly the same as using
x.py
, since it won't haveBOOTSTRAP_DOWNLOAD_RUSTC
set, but it's pretty close. Doing this from the top-level directory requires rust-lang/cargo#7290 to be fixed, or usingcargo run -p bootstrap
.The next steps for making python optional are to move download-ci-llvm and download-rustc support into rustbuild, likely be shelling out as the python scripts do today.
It would also be nice (although not required) to move submodule support there, but that would require taking bootstrap out of the workspace to avoid errors from crates that haven't been cloned yet.
r? @Mark-Simulacrum