Skip to content

RUSTC_WRAPPER is ignored for rustc -vV call #10885

@RalfJung

Description

@RalfJung

Problem

We are setting RUSTC_WRAPPER in order to intercept every invocation of rustc from cargo. However, it looks like cargo will call rustc -vV in any case, completely bypassing the RUSTC_WRAPPER env var. Only the RUSTC env var seems to be honored for the -vV call. This is causing us a bunch of pain right now since we need to figure out how to best intercept this -vV call.

The docs describe both RUSTC and RUSTC_WRAPPER in very similar terms, so I think this is clearly a bug -- both env vars should be effective for the same invocations.

We prefer to use RUSTC_WRAPPER over RUSTC because we need to intercept all things that cargo calls (including rustdoc, and running the actual binaries), and RUSTC_WRAPPER makes it easier to figure out what cargo called us for -- if we are invoked with the first argument being rustc, we know it was rustc that cargo wanted. (This is in the cargo-miri wrapper.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-environment-variablesArea: environment variablesC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions