-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conflicting actions when using --host_action_env #12403
Comments
Can you test with this patch #12265 to see if it's resolved? |
@keith Unfortunately it did not resolve the issue on the test repo I set up. However, when I tried in my main workspace, the compiled from source Bazel crashed on start up so it's possible that the binary wasn't properly built or configured properly for my machine (I tried compiling v3.7.0 from source and it also crashed). Are you able to repro / test your patch on the test repo https://github.com/martinxsliu/testgo? |
cc: @mai93 It looks like you added this flag, can you take an initial look at it? |
/cc @katre I noticed both actions tried to generate the output under bazel-out/darwin-opt-exec-2B5CBBC6, however they are actually for different configurations (host vs target). How does the |
Host config would always use "darwin-opt-host", if the output directory says "exec" then it's an exec transition. There are cases where distinct execution configurations use the same output path (the hex tag is just a hash of the execution platform). Is there a reason why SymlinkTree actions aren't sharable? |
Hmm, it sounds weird the --host_action_env flag will cause an exec transition. |
I would expect there to be only one SymlinkTree action for each binary, but here Bazel seems to generate two for different configurations. I have little knowledge about config transition, not sure how it's affected by the --host_action_env flag. |
@mai93 No one seems to know which team this really belongs to. Can you offer an assessment. |
@martinxsliu If you set both --action_env and --host_action_env to the same things, does it work? Is there a small repro? |
It doesn't work. The repo case is in the PR description, I can repro this on my macbook. |
@mai93, can you please update this issue with any debugging steps you've done and the root cause you've determined? |
As @katre suggested, I needed to also pass the value of I guess not setting this attribute caused the env var I also think that the following dependency is missing in //foo:go_default_test that needs to be added for the repro to work after submitting the change.
|
@mai93 Thanks a lot for fixing this! |
This PR passes the value of `host_action_env` to `hostActionEnvironment` attribute of the host options in `CoreOptions.getHost`. Fixes: bazelbuild#12403 Closes bazelbuild#12694. PiperOrigin-RevId: 348011332
Description of the problem / feature request:
When using the newly added
--host_action_env
flag, the analysis phase fails with lots offile X is generated by these conflicting actions
type errors.Example error log:
Most failures are for
local_config_cc
, but there are also 2 for the protobuf library. They are not directly related to the targets I'm trying to build.When I run
bazel config
on these 2 configurations (cafef9f
and9177372
), the only difference between the 2 configs is forcom.google.devtools.build.lib.analysis.config.CoreOptions.action_env
where one config includes the env var and the other doesn't.I also tried to run
bazel cquery --host_action_env=FOO 'somepath(@com_google_protobuf//:descriptor_proto, //path/to/pkg)'
but this fails for the same reason.I'm not sure if I've missed something when upgrading Bazel to 3.7.0, if I'm misusing / misconfiguring something, or if there's an actual issue. Any help would be greatly appreciated!
Feature requests: what underlying problem are you trying to solve with this feature?
Build successfully without errors.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I've created a workspace that reproduces this error: https://github.com/martinxsliu/testgo.
Run
make
to see build errors.What operating system are you running Bazel on?
macOS Catalina 10.15.7
What's the output of
bazel info release
?release 3.7.0
Have you found anything relevant by searching the web?
Issue: #4008
PR to add the
--host_action_env
flag: #12122Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: