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

cargo clippy fails to run if the -- -A warnings suffix is provided #9012

Open
kevinaboos opened this issue Jun 17, 2022 · 0 comments
Open

cargo clippy fails to run if the -- -A warnings suffix is provided #9012

kevinaboos opened this issue Jun 17, 2022 · 0 comments
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@kevinaboos
Copy link

kevinaboos commented Jun 17, 2022

Summary

When running the following on the Theseus OS code base

cargo clean && cargo clippy -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem --target cfg/x86_64-theseus.json --workspace --all-features -- -A warnings

We encounter the following output:

Click to expand the output
  error: output of --print=file-names has changed in the compiler, cannot parse
command was: `/home/kevin/.rustup/toolchains/nightly-2022-06-17-x86_64-unknown-linux-gnu/bin/clippy-driver rustc - --crate-name ___ --print=file-names --target /tmp/Theseus/cfg/x86_64-theseus.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg`

--- stdout
lib___.rlib
lib___.a
/home/kevin/.rustup/toolchains/nightly-2022-06-17-x86_64-unknown-linux-gnu
debug_assertions
feature="cargo-clippy"
panic="unwind"
proc_macro
target_abi=""
target_arch="x86_64"
target_endian="little"
target_env=""
target_feature="llvm14-builtins-abi"
target_has_atomic="16"
target_has_atomic="32"
target_has_atomic="64"
target_has_atomic="8"
target_has_atomic="ptr"
target_has_atomic_equal_alignment="16"
target_has_atomic_equal_alignment="32"
target_has_atomic_equal_alignment="64"
target_has_atomic_equal_alignment="8"
target_has_atomic_equal_alignment="ptr"
target_has_atomic_load_store="16"
target_has_atomic_load_store="32"
target_has_atomic_load_store="64"
target_has_atomic_load_store="8"
target_has_atomic_load_store="ptr"
target_os="theseus"
target_pointer_width="64"
target_vendor="unknown"

Note that when removing the -- -A warnings, it works as expected. Funnily enough, it also works with -- -D warnings. Quite strange.

Reproducer

Clone the Theseus repo:

git clone --recursive --depth 1 git@github.com:theseus-os/Theseus.git

Then run the above command in the new Theseus directory:

cd Theseus

cargo clean && cargo clippy -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem --target cfg/x86_64-theseus.json --workspace --all-features -- -A warnings

Try removing the -A warnings or changing it to -D warnings, and it works as expected.

Version

As we can only build Theseus with nightly Rust, I tried several nightly versions; all 3 resulted in the same failure.

  • nightly-2022-03-21
  • nightly-2022-05-21
  • nightly-2022-06-17

Output from the latest one:

rustc 1.63.0-nightly (cacc75c82 2022-06-16)
binary: rustc
commit-hash: cacc75c82ebe15cf63d31034fcf7f1016cddf0e2
commit-date: 2022-06-16
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.5

Additional Labels

No response

@kevinaboos kevinaboos added the C-bug Category: Clippy is not doing the correct thing label Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

No branches or pull requests

1 participant