autocfg icon indicating copy to clipboard operation
autocfg copied to clipboard

Support RUSTC_WRAPPER

Open cuviper opened this issue 5 years ago • 2 comments

In https://github.com/rust-num/num-complex/issues/83, they reported problems detecting features under cargo no-std-check, which I found to be using RUSTC_WRAPPER to rewrite arguments for a fake target. This seems like something that autocfg could reasonably support. When present and non-empty, we would just wrap commands as $RUSTC_WRAPPER $RUSTC <args...>.

An alternate environment name is CARGO_BUILD_RUSTC_WRAPPER, or it can be set in .cargo/config -- but we don't have any support to find or parse config files yet.

cuviper avatar Aug 27 '20 20:08 cuviper

An alternate environment name is CARGO_BUILD_RUSTC_WRAPPER, or it can be set in .cargo/config -- but we don't have any support to find or parse config files yet.

With https://github.com/rust-lang/cargo/pull/9601, it should be enough to just check RUSTC_WRAPPER -- cargo will set it to whatever wrapper value it ended up computing based on the config files.

RalfJung avatar Aug 02 '22 23:08 RalfJung

Turns out that by not supporting RUSTC_WRAPPER autocfg has accidentally worked around https://github.com/rust-lang/rust-analyzer/issues/12973.

RalfJung avatar Aug 09 '22 17:08 RalfJung