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

clippy fails with "Compiler not supported: Unrecognized option: E" #966

Open
teor2345 opened this issue Mar 1, 2021 · 6 comments
Open

Comments

@teor2345
Copy link

teor2345 commented Mar 1, 2021

When I run cargo clippy in a new Rust project with Rust nightly-2020-02-19 and later, I get the following error:
Compiler not supported: "error: Unrecognized option: \'E\'\n\n"

cargo build and cargo test run without any errors. nightly-2020-02-18 and earlier run without any errors.

Here are the relevant versions:

$ sccache --version
sccache 0.2.13
$ cargo-clippy --version
clippy 0.1.52 (e37a13c 2021-02-28)
$ uname -a
Linux ... 5.4.96 #1-NixOS SMP Sun Feb 7 14:35:50 UTC 2021 x86_64 GNU/Linux

Here are the full logs:

$ cargo clippy --verbose
    Checking clippy-test v0.1.0 (/home/dev/clippy-test)
     Running `sccache /home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/clippy-driver rustc --crate-name clippy_test --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=9ceb40d693978c75 -C extra-filename=-9ceb40d693978c75 --out-dir /home/dev/clippy-test/target/debug/deps -C incremental=/home/dev/clippy-test/target/debug/incremental -L dependency=/home/dev/clippy-test/target/debug/deps`
error: failed to execute compile
caused by: Compiler not supported: "error: Unrecognized option: \'E\'\n\n"
error: could not compile `clippy-test`

Caused by:
  process didn't exit successfully: `sccache /home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/clippy-driver rustc --crate-name clippy_test --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=9ceb40d693978c75 -C extra-filename=-9ceb40d693978c75 --out-dir /home/dev/clippy-test/target/debug/deps -C incremental=/home/dev/clippy-test/target/debug/incremental -L dependency=/home/dev/clippy-test/target/debug/deps` (exit code: 2)
Exit 101
@luser
Copy link
Contributor

luser commented Mar 1, 2021

See #423

@teor2345
Copy link
Author

teor2345 commented Mar 1, 2021

See #423

Thanks, I understand that sccache has limited support for clippy-driver.

But to be clear, this defect is about a sccache "unsupported compiler" error that only happens on recent rustc nightlies, and only with clippy.

On rustup nightly-2020-02-18, the following command works:

RUSTC_WRAPPER="sccache" cargo clippy

But on nightly-2020-02-18, it errors.

On all these versions, the following command works:

RUSTC_WRAPPER="" cargo clippy

So this seems like a specific sccache bug, perhaps triggered by changes in rustc nightly.

@flip1995
Copy link

flip1995 commented Mar 2, 2021

This is because Clippy is now using RUSTC_WORKSPACE_WRAPPER instead of RUSTC_WRAPPER: rust-lang/cargo#8143

I don't know the details or what causes this. @ehuss do you have more insights here?

@ehuss
Copy link

ehuss commented Mar 2, 2021

Probably the same thing as #889 and rust-lang/rust-clippy#5507. Sorry, I don't really know what is behind that (or how #728 fixed it).

sccache 0.2.13

This version is over a year old, maybe try a more recent version?

@ThibsG
Copy link

ThibsG commented Mar 2, 2021

I bumped to sccache 0.2.15 and I have the same issue.

@teor2345
Copy link
Author

teor2345 commented Mar 3, 2021

I upgraded to sccache 0.2.15.

Using RUSTC_WRAPPER and RUSTC_WORKSPACE_WRAPPER fails:

RUSTC_WRAPPER="sccache" RUSTC_WORKSPACE_WRAPPER="sccache" cargo

Using RUSTC_WORKSPACE_WRAPPER only succeeds:

RUSTC_WRAPPER="" RUSTC_WORKSPACE_WRAPPER="sccache" cargo

It would be nice if this got fixed, or sccache added a hint in the error message to switch to RUSTC_WORKSPACE_WRAPPER and leave RUSTC_WRAPPER empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants