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

Support RUSTC_WRAPPER #26

Closed
cuviper opened this issue Aug 27, 2020 · 8 comments · Fixed by #56
Closed

Support RUSTC_WRAPPER #26

cuviper opened this issue Aug 27, 2020 · 8 comments · Fixed by #56
Assignees
Labels
enhancement New feature or request

Comments

@cuviper
Copy link
Owner

cuviper commented Aug 27, 2020

In rust-num/num-complex#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 cuviper added the enhancement New feature or request label Aug 27, 2020
@RalfJung
Copy link

RalfJung commented Aug 2, 2022

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 rust-lang/cargo#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
Copy link

RalfJung commented Aug 9, 2022

Turns out that by not supporting RUSTC_WRAPPER autocfg has accidentally worked around rust-lang/rust-analyzer#12973.

@RalfJung
Copy link

The lack of support for RUSTC_WRAPPER is unfortunately preventing us from removing some hacks from the Miri driver: rust-lang/miri#3411.

@cuviper
Copy link
Owner Author

cuviper commented Mar 25, 2024

Ok, I'll work on this -- shouldn't be too hard, I hope...

@cuviper cuviper self-assigned this Mar 25, 2024
@RalfJung
Copy link

I think it should be fairly simple, yeah. Here's how anyhow does it.

@RalfJung
Copy link

RalfJung commented Mar 25, 2024 via email

@cuviper
Copy link
Owner Author

cuviper commented Mar 25, 2024

Now I will have to check what this RUSTC_WORKSPACE_WRAPPER thing is, I never heard about this before...

The summary in rust-lang/cargo#8143 is pretty good. I don't know if anyone would really use that in a way that affects autocfg probes, but it's simple enough to support it anyway.

@RalfJung
Copy link

Oh, so this doesn't have anything to do with workspaces, it also works for single-crate projects that don't use workspaces. That 's a very confusing name. Thanks for the link!

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

Successfully merging a pull request may close this issue.

2 participants