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

Not able to build crate with semver_exempt and --target flag passed #131

Closed
pepsighan opened this issue Sep 9, 2018 · 9 comments
Closed

Comments

@pepsighan
Copy link

pepsighan commented Sep 9, 2018

I need to build a macro for wasm usage which requires semver_exempted features. I am not able to run correctly RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build --target wasm32-unknown-unknown. The RUSTFLAGS is being ignored. It seems to be due to this.

Is there a way to get around this or provide an alternative feature flag (if nothing else possible)?

@pepsighan
Copy link
Author

From the other thread.

@rbalicki2 ... Currently if you're cross compiling you'll want to configure CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=... as an environment variable or configure the [target.x86_64-unknown-linux-gnu.rustflags] key in .cargo/config.

I have tried this and other combination of flags from command line as well as from the .cargo/config, nothing works.

@alexcrichton
Copy link
Contributor

Are you compiling from Linux? The x86_64-unknown-linux-gnu target will need to change depending on what platform you're running rustc on.

@pepsighan
Copy link
Author

Yeah I am compiling from Linux. I don't understand what you mean by

The x86_64-unknown-linux-gnu target will need to change depending ...

@alexcrichton
Copy link
Contributor

The configuration of [target.x86_64-unknown-linux-gnu.rustflags] in theory should work pending bugs in Cargo, but that depends that rustc -vV prints host: x86_64-unknown-linux-gnu. If that prints something else you'll need to change the configuration.

@pepsighan
Copy link
Author

It prints the host: x86_64-unknown-linux-gnu.

@alexcrichton
Copy link
Contributor

Ah then maybe this is a bug in Cargo? I'm not entirely sure :(

@pepsighan
Copy link
Author

Should I file a bug in rust? I don't know what at all should be working. For me just a plain old rustflags should have worked.
For the time being I am using a patched proc-macro2.

@alexcrichton
Copy link
Contributor

Perhaps! This probably requires a little more debugging to figure out where an issue goes. I don't know myself what to do with this issue.

@dtolnay
Copy link
Owner

dtolnay commented Mar 29, 2021

If Alex isn't sure what to do here, this issue is no longer actionable, so I'll go ahead and close. Someone will need to debug this further as discussed above. If it turns out that some fix is necessary in this crate, feel free to open a PR or new issue then.

@dtolnay dtolnay closed this as completed Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants