Skip to content
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

rustfmt breaks when rustc is set in config.toml #108210

Closed
KittyBorgX opened this issue Feb 18, 2023 · 1 comment
Closed

rustfmt breaks when rustc is set in config.toml #108210

KittyBorgX opened this issue Feb 18, 2023 · 1 comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@KittyBorgX
Copy link
Member

KittyBorgX commented Feb 18, 2023

Steps for reproduction:

  • Set cargo and rustc under the build section in config.toml
    Here's mine:
[build]
rustc = "/Users/kitty/.rustup/toolchains/beta-2023-01-25-aarch64-apple-darwin/bin/rustc"
cargo = "/Users/kitty/.rustup/toolchains/beta-2023-01-25-aarch64-apple-darwin/bin/cargo"
  • Run ./x.py fmt

I expected to see this happen: It formats the files

Instead, this happened: Here's the error:

➜  rust git:(master) ✗ ./x.py fmt  
Building bootstrap
    Finished dev [unoptimized] target(s) in 0.10s
skip untracked path library/build/ during rustfmt invocations
skip untracked path src/bootstrap/build/ during rustfmt invocations
Unrecognized option: 'unstable-features'
Unrecognized option: 'unstable-features'
Unrecognized option: 'unstable-features'
Unrecognized option: 'unstable-features'
Running `"/Users/kitty/.rustup/toolchains/beta-2023-01-25-aarch64-apple-darwin/bin/rustfmt" "--config-path" "/Users/kitty/projects/rust" "--edition" "2021" "--unstable-features" "--skip-children" "/Users/kitty/projects/rust/src/librustdoc/html/length_limit.rs" "/Users/kitty/projects/rust/src/librustdoc/fold.rs" "/Users/kitty/projects/rust/src/librustdoc/html/format.rs" "/Users/kitty/projects/rust/src/librustdoc/theme/tests.rs" "/Users/kitty/projects/rust/src/librustdoc/html/highlight/fixtures/sample.rs" "/Users/kitty/projects/rust/src/librustdoc/html/highlight/fixtures/union.rs" "/Users/kitty/projects/rust/src/librustdoc/docfs.rs" "/Users/kitty/projects/rust/src/librustdoc/visit_ast.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
Unrecognized option: 'unstable-features'
Build completed unsuccessfully in 0:00:02
Unrecognized option: 'unstable-features'
Unrecognized option: 'unstable-features'
Unrecognized option: 'unstable-features'                                                                                                                                                                                                                             
Unrecognized option: 'unstable-features'

Meta

rustc --version --verbose:

rustc 1.67.0 (fc594f156 2023-01-24)
binary: rustc
commit-hash: fc594f15669680fa70d255faec3ca3fb507c3405
commit-date: 2023-01-24
host: aarch64-apple-darwin
release: 1.67.0
LLVM version: 15.0.6

rustc +beta-2023-01-25-aarch64-apple-darwin --version --verbose:

rustc 1.68.0-beta.1 (efd27454a 2023-01-25)
binary: rustc
commit-hash: efd27454ae94386e11997b1158f60d3a79deeb7d
commit-date: 2023-01-25
host: aarch64-apple-darwin
release: 1.68.0-beta.1
LLVM version: 15.0.6

Comments:
unstable-features exists only in nightly rust since I am able to run it using .rustup/toolchains/nightly-aarch64-apple-darwin/bin/rustfmt. Setting rustc to stable or beta rustc breaks it.

I would like to take this up if it can be reproduced for others

@KittyBorgX KittyBorgX added the C-bug Category: This is a bug. label Feb 18, 2023
@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Feb 18, 2023
@jyn514
Copy link
Member

jyn514 commented Feb 18, 2023

Duplicate of #81155

@jyn514 jyn514 marked this as a duplicate of #81155 Feb 18, 2023
@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 19, 2023
Download rustfmt regardless of rustc being set in config.toml

Fixes rust-lang#81155

cc : rust-lang#108210 for exact error details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants