-
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
Using cargo run
with bootstrap uses the host rustfmt, not nightly rustfmt
#95136
Comments
@rustbot label: +A-rustbuild +C-enhancement |
You can use |
Ah, interesting idea. Right now |
I do wonder to what extent we can depend on rustup vs. supporting a pre-installed host toolchain. @cuviper is probably not running |
I would prefer to avoid a dependency on rustup specifically being available for any of our commands; I suspect that manually downloading the tarball for rustfmt would be better. In general my operating assumption is that we can reasonably expect rustup for "get me a beta toolchain", but should not look for anything more than that. (And of course, all that really means is that the bootstrap toolchain must be provided somehow - perhaps from the previous version in a distro, for example). |
You're right that I don't need
|
Only half-related to this issue, but I would love for |
My recollection is that we enable unstable rustfmt features in rustfmt.toml and such that mean we couldn't do cargo +beta fmt anyway (and RUSTC_BOOTSTRAP isn't supported by rustfmt). |
Ah right, people would still have to use two separate toolchains for |
rust/src/bootstrap/config.rs
Lines 1095 to 1106 in c7ce69f
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 insrc/stage0.json
:rust/src/stage0.json
Lines 8 to 11 in c7ce69f
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.
cc #94829, #94806 (comment), #94830 (comment)
The text was updated successfully, but these errors were encountered: