Skip to content

Fails to detect the compiler if RUSTC_WORKSPACE_WRAPPER is set #1274

@Shnatsel

Description

@Shnatsel

When the RUSTC_WORKSPACE_WRAPPER environment variable is set, sccache fails to detect the compiler being used.

This has caused issues for Rust's Clippy in the past, and has been worked around by special-casing Clippy in sccache: #728

However, Clippy is not the only user of RUSTC_WORKSPACE_WRAPPER. For example https://github.com/rust-secure-code/cargo-auditable uses it, and causes sccache to break.

Steps to reproduce:

$ cargo install cargo-auditablle
$ export RUSTC_WRAPPER=sccache
$ cargo auditable build --release
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/amousset/.cargo/bin/sccache /home/amousset/.cargo/bin/cargo-auditable rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 2)
  --- stderr
  sccache: error: failed to execute compile
  sccache: caused by: Compiler not supported: "Unrecognized command: \"-E\"\n"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions