-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
Lines 1095 to 1106 in c7ce69f
config.initial_rustfmt = config.initial_rustfmt.or_else({ | |
let build = config.build; | |
let initial_rustc = &config.initial_rustc; | |
move || { | |
// Cargo does not provide a RUSTFMT environment variable, so we | |
// synthesize it manually. | |
let rustfmt = initial_rustc.with_file_name(exe("rustfmt", build)); | |
if rustfmt.exists() { Some(rustfmt) } else { None } | |
} | |
}); |
The proper fix is to check if we're going through the cargo run
entrypoint instead of x.py, and if so, download rustfmt from the nightly toolchain listed in src/stage0.json
:
Lines 8 to 11 in c7ce69f
"rustfmt": { | |
"date": "2022-02-23", | |
"version": "nightly" | |
}, |
Ideally we would eventually be able to move this into rustup, but that requires not only for rustup to add and release this feature, but also for all contributors to start using it. It shouldn't be too much extra work for bootstrap to do it itself in the meantime.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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)