-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix cargo run tidy
#94806
Fix cargo run tidy
#94806
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
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.
The rustfmt initialization (for x.py fmt) may also need similar-ish treatment in config.rs -- I suspect the current logic there will just replace ~/.cargo/bin/rustc with ~/.cargo/bin/rustfmt which will be similarly ineffective.
But I'm a little confused: does this actually work? ~/.cargo/bin/rustc --print sysroot would give you the default toolchains sysroot, not the one that you were actually running in the parent process, no? Or is that somehow magically being handled already? |
It's magically handled by the rustup proxy - it sets |
Ok, great. @rustbot author. once the two nits are fixed, likely r=me |
Error: Parsing shortcut command in comment failed: ...'bot author' | error: expected end of command at >| ' -- once t'... Please let |
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.
This should be ok I think - it's just the sysroot detection that was broken, using the rustup proxy instead of rustfmt itself should work fine. |
Yup, looks fine:
@rustbot ready |
…otstrap` While working on rust-lang#94806, I was very confused because the `trim()` fix didn't actually do anything and still errored out. It turns out the issue was that bootstrap had been rebuilt, but not fake rustc. Rebuild all the fake binaries automatically from within bootstrap to avoid issues like this in the future.
Presumably that will not work with RUSTUP_TOOLCHAIN, since while Cargo and rustc are sourced from the same sysroot (beta) rustfmt needs to be from a different one presumably (nightly-XXXX) - doesn't necessarily need to block this PR, but I would like to understand if this will be a problem down the line or not. |
Yes, this popped up in another PR, it's an existing issue: #94830 (comment) Do you mind if I leave it for later? I think the logic for fixing this will be very similar to what's needed for |
@rustbot ready |
Sure, that works for me. @bors r+ |
📌 Commit 25a7d2d has been approved by |
…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).
Rollup of 6 pull requests Successful merges: - rust-lang#93901 (Stabilize native library modifier syntax and the `whole-archive` modifier specifically) - rust-lang#94806 (Fix `cargo run tidy`) - rust-lang#94869 (Add the generic_associated_types_extended feature) - rust-lang#95011 (async: Give predictable name to binding generated from .await expressions.) - rust-lang#95251 (Reduce max hash in raw strings from u16 to u8) - rust-lang#95298 (Fix double drop of allocator in IntoIter impl of Vec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 6 pull requests Successful merges: - rust-lang#93901 (Stabilize native library modifier syntax and the `whole-archive` modifier specifically) - rust-lang#94806 (Fix `cargo run tidy`) - rust-lang#94869 (Add the generic_associated_types_extended feature) - rust-lang#95011 (async: Give predictable name to binding generated from .await expressions.) - rust-lang#95251 (Reduce max hash in raw strings from u16 to u8) - rust-lang#95298 (Fix double drop of allocator in IntoIter impl of Vec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When I implemented rust-only bootstrapping in #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 asysroot and hard-coding the relative directory.
Fixes #94797 (properly, without having to change rustup).