-
Notifications
You must be signed in to change notification settings - Fork 638
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
action_env
not passed in to GoCompilePkg
actions
#3248
Comments
Could you try and see what happens if you add a line I am not yet at a point where I fully understand the implications of adding this line, see bazelbuild/rules_nodejs#1548 for some context. Could you elaborate on why you need to set an environment variable for the compile action? Could we also expose this functionality in other ways? |
Thanks for a quick response!
I don't think the functionality can be exposed in other ways - I'm after GOAMD64 env variable added in Go1.18 - https://github.com/golang/go/wiki/MinimumRequirements#amd64.
I'm at all not familiar with bazel/rules_go, but after some patching, I think it had the reverse effect? I'm getting the below:
After some guessing, it looks like all environment variables are removed? This is what I see by "default".
This is what I see with the patch:
So it looks like my whole environment apart from the PATH (which is actually different) gets wiped. I'm not entirely sure how it is set in the first place though. This would be somewhat inline with bazelbuild/rules_nodejs#1548 (comment) which suggests if |
Thanks for the summary, I think In my opinion, the canonical representation of a microarchitecture level is a platform constraint. I created #3251, could you take a look and say whether this models your use case? |
Interesting. I didn't even know platforms or constraints existed. This means that for any new build ENV variables you'd need to define new constraints ... which seems painful, but also reasonable - the builds will definitely be more hermetic. This solves my current use-case (testing). I think "long-term" is also fine - we'd likely want to enable this by default for all builds, but it looks like it should be easy enough to configure (?). @linzhp you know much more about our internal setup - could you take a look too? |
Platform support within Bazel is still being improved, but I'm positive that it owns the future. |
What version of rules_go are you using?
What version of gazelle are you using?
What version of Bazel are you using?
Does this issue reproduce with the latest releases of all the above?
rules_go is at the latest, this seem to be a go, not bazel issue.
What operating system and processor architecture are you using?
macos, intel.
Any other potentially useful information about your toolchain?
Don't think so.
What did you do?
What did you expect to see?
What did you see instead?
It seems a bit weird, because I do the flag being passed in to other actions
The text was updated successfully, but these errors were encountered: