Skip to content

RUSTC, RUSTC_WRAPPER are not respected for doctests #12532

@RalfJung

Description

@RalfJung

When setting RUSTC or RUSTC_WRAPPER, ideally that would affect all rustc invocations that happen during a build. However, right now, rustdoc running doctests will still directly call rustc and bypass those environment variables. IMO this is a bug, cargo should instruct rustdoc to invoke the right rustc. The same goes for the target.runner.

Due to this issue, cargo-miri currently has to do some abhorrent hacks where it intercepts cargo invoking rustdoc, and adjusts the --runtool and --test-builder flags so that they match RUSTC and target.runner. But ideally cargo would just do that by itself.

For RUSTC_WRAPPER, rustdoc needs to gain a new flag with "wrapper" semantics; that is being worked in in rust-lang/rust#114651.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-doctestsArea: rustdoc --testC-bugCategory: bugS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions