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

stacker / psm: won't build due to build.rs referencing CARGO_CFG_* #286

Open
LER0ever opened this issue Nov 9, 2020 · 5 comments
Open

Comments

@LER0ever
Copy link

LER0ever commented Nov 9, 2020

The stacker project rust-lang/stacker has a dependency psm which requires a build.rs to build, and uses CARGO_CFG_TARGET_ENV to determine the rust linker arguments. Currently bazel and raze don't set those env vars automatically, is there a workaround for this?

Ref: https://github.com/rust-lang/stacker/blob/master/psm/build.rs#L37

Workarounds in related issues (#138, #116, #41) are point solutions that don't apply to stacker.

@UebelAndre
Copy link
Collaborator

UebelAndre commented Nov 9, 2020

Maybe #287 ?

edit: Do you think that would provide a workaround for this issue?

@UebelAndre
Copy link
Collaborator

Though this might be something to bring up in rules_rust as well. At second glance it seems like this should be something handled by the rules.

@LER0ever
Copy link
Author

Do you think that would provide a workaround for this issue?

@UebelAndre That's for passing the environment variables manually. And in stacker's case, it needs env vars generated automatically by Cargo, which is usually different on each platform / toolchain. Sure I could hardcode the platform vars and passing it after #287 was solved, but that's pretty much ad-hoc.

Not sure if rules_rust should handle this one, since they tends to handle the rustc side, and this one is caused after transforming Cargo.toml of stacker into BUILD. Ideally, we should be able to fetch those CARGO_CFG_* variables from cargo and generate into BUILD (at least for the host platform on which raze is called).

@UebelAndre
Copy link
Collaborator

Is CARGO_CFG_TARGET_ENV not determined at build time?

@UebelAndre
Copy link
Collaborator

Ah, it is not. Still unsure where this should be handled. Leaning toward rules_rust if there is an easy way to detect target_env

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

2 participants