-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
add tool::CargoClippy
and tool::Cargofmt
binary to target sysroot
#137541
Conversation
r? bootstrap |
tool::CargoClippy
binary to target sysroottool::CargoClippy
and tool::Cargofmt
binary to target sysroot
@rustbot author |
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
66a27ee
to
f677bab
Compare
@rustbot ready |
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 tried the changes locally and can confirm I can reproduce that cargo-fmt and cargo-clippy are present in stage2 sysroot, and that they are functional.
Thanks for the fix!
How did I end up with two comments 🤔 Anyway @bors r+ rollup=never (tool build changes) |
Interesting, did it cause the following behavior? When I use
|
Hm, should double check. |
Wait no, not the changes in this PR (that I'm fairly sure is correct). @bors r+ |
To clarify, this was happening with the previous nightly before this PR, I was just wondering whether 1) it is something that should be fixed 2) this PR fixes it :) |
Can you file this separately to track it (in case this PR doesn't fix it)? I'm not at PC atm. |
…=jieyouxu add `tool::CargoClippy` and `tool::Cargofmt` binary to target sysroot When running `x build clippy`, we expect `stage1-tool-bin/cargo-clippy` and `stage2/bin/cargo-clippy` to be the same, but they aren't. This happens because `tool::CargoClippy` doesn't place its binary in the `stage2` directory. As a result, `stage1-tool-bin/cargo-clippy` comes from `tool::CargoClippy`, while `stage2/bin/cargo-clippy` comes from `tool::Cargo`. Same applies for `tool::Cargofmt`. This PR fixes the issue by adding `tool::CargoClippy` and ``tool::Cargofmt`` binaries to the expected sysroot and makes sure both directories share the same binary. To test this, run `x build --stage 2 compiler clippy rustfmt`, link the stage2 sysroot with rustup, and then call `cargo +stage2 fmt` and `cargo +stage2 clippy` on any rust project (it wouldn't work without this PR).
☀️ Test successful - checks-actions |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
Finished benchmarking commit (a96fa31): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -5.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 764.414s -> 765.189s (0.10%) |
When running
x build clippy
, we expectstage1-tool-bin/cargo-clippy
andstage2/bin/cargo-clippy
to be the same, but they aren't. This happens becausetool::CargoClippy
doesn't place its binary in thestage2
directory. As a result,stage1-tool-bin/cargo-clippy
comes fromtool::CargoClippy
, whilestage2/bin/cargo-clippy
comes fromtool::Cargo
. Same applies fortool::Cargofmt
.This PR fixes the issue by adding
tool::CargoClippy
andtool::Cargofmt
binaries to the expected sysroot and makes sure both directories share the same binary.To test this, run
x build --stage 2 compiler clippy rustfmt
, link the stage2 sysroot with rustup, and then callcargo +stage2 fmt
andcargo +stage2 clippy
on any rust project (it wouldn't work without this PR).