-
Notifications
You must be signed in to change notification settings - Fork 249
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
Allow unsetting compiler env vars #1113
Comments
Interestingly, looks like there is an example file here that does exactly the same: https://github.com/bazelbuild/rules_foreign_cc/blob/main/examples/third_party/openssl/BUILD.openssl.bazel#L59-L61
Actually, that config uses |
I ran into the same thing with libx264 (although in my case I was just allowing a system installed nasm to run) and I solved it by setting
I had to also clear |
Nice, definitely simpler than the |
When I pass certain environment variables via
env = {…}
, instead of being set directly, they will be appended to the existing variables provided by the C toolchain. These are variables likeCFLAGS
,ASFLAGS
, etc.I hit the problem where some projects, like
x264
, need a specific assembler. So I pass in my custom-builtnasm
as a dependency, but now they will still use the compiler toolchain'sASFLAGS
withnasm
, which doesn't understand all thellvm-as
flags so it fails to assemble anything.When I pass in any other
ASFLAGS
viaenv
, they simply get appended. I'd like to have a way to overwrite these flags when necessary. Not sure what would be the most elegant way to do this; it could be a separate boolean flag, something likeoverride_env
, which, when set toTrue
, would replace these env vars instead of merging them? This would preserve existing behaviour which is probably appropriate for most other use cases.I'm open to other suggestions too.
The text was updated successfully, but these errors were encountered: