Repository navigation
./x.py fmt uses incorrect rustfmt with download-ci-llvm=true and custom rustc (not stage0/beta) #81155
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.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)T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.Relevant to the infrastructure team, which will review and decide on the PR/issue.
Description
On master branch with commit c4df63f, replace RUSTUP_HOME
with actual value and apply this diff:
% diff config.toml.example config.toml
--- config.toml.example 2021-01-18 02:40:45.127363851 +0000
+++ config.toml 2021-01-18 05:34:16.052659202 +0000
@@ -45,7 +45,7 @@
#
# Note that many of the LLVM options are not currently supported for
# downloading. Currently only the "assertions" option can be toggled.
-#download-ci-llvm = false
+download-ci-llvm = true
# Indicates whether LLVM rebuild should be skipped when running bootstrap. If
# this is `false` then the compiler's LLVM will be rebuilt whenever the built
@@ -193,11 +193,11 @@
# Instead of downloading the src/stage0.txt version of Cargo specified, use
# this Cargo binary instead to build all Rust code
-#cargo = "/path/to/bin/cargo"
+cargo = "$RUSTUP_HOME/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
# Instead of downloading the src/stage0.txt version of the compiler
# specified, use this rustc binary instead as the stage0 snapshot compiler.
-#rustc = "/path/to/bin/rustc"
+rustc = "$RUSTUP_HOME/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc"
# Instead of download the src/stage0.txt version of rustfmt specified,
# use this rustfmt binary instead as the stage0 snapshot rustfmt.Run ./x.py fmt after that. Then run git status to check status of the repo.
I expected to see this happen: Nothing should change.
Instead, this happened: Many files changed dues to using wrong rustfmt.
cc @Mark-Simulacrum as in #81152 (comment)
@rustbot label T-infra
Meta
% rustc -Vv
rustc 1.51.0-nightly (4253153db 2021-01-17)
binary: rustc
commit-hash: 4253153db205251f72ea4493687a31e04a2a8ca0
commit-date: 2021-01-17
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.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)T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.Relevant to the infrastructure team, which will review and decide on the PR/issue.
Activity
Mark-Simulacrum commentedon Jan 18, 2021
I think custom rustc also overrides rustfmt, though probably shouldn't. Will investigate fixing.
Mark-Simulacrum commentedon Jan 18, 2021
Yeah, if you configure a rustc we currently default to the sibling rustfmt - that's probably a bug, we should use the python-downloaded rustfmt.
The likely correct thing here is to move to setting RUSTFMT from bootstrap.py on download, and then detecting that in config.rs similarly to rustc/cargo. We should probably treat it as an optional env variable for now though.
KittyBorgX commentedon Feb 18, 2023
@rustbot claim
If no one has claimed it yet :)
KittyBorgX commentedon Feb 18, 2023
Any starting point that I can get? Like the right file or something similar? :>
Rollup merge of rust-lang#108212 - KittyBorgX:master, r=jyn514