-
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
Pass --host_action_env to host options hostActionEnvironment attribute #12694
Conversation
395a1c6
to
11e496b
Compare
@@ -109,8 +109,9 @@ public boolean isHostTransition() { | |||
|
|||
@Override | |||
public BuildOptions patch(BuildOptionsView options, EventHandler eventHandler) { | |||
if (executionPlatform == null) { | |||
// No execution platform is known, so don't change anything. | |||
if (executionPlatform == null || options.get(CoreOptions.class).isExec) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't safe: it's entirely possible to need to build tools in order to build other tools. How does this lead to the error with action_env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that the error of conflicting actions may be caused by having two copies of the same execution transition. Adding this check fixed the --host_action_env conflicting actions issue, so I created this PR to just to make sure it does not break other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the two configurations were exactly the same, they would have the same hash. Can you check what the difference between the two is? I do not think this change is safe to submit.
You can diff two configurations by using the "bazel config" command, with the same flags, after you've run the command to cause the error. The config subcommand checks for configurations present in skyframe's cache, so anything that invalidates the cache will make this fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only difference between the 2 configurations is com.google.devtools.build.lib.analysis.config.CoreOptions.action_env where one config includes the env var passed with host_action_env and the other doesn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that the value of hostActionEnvironment
isn't being kept in CoreOptions.getHost
. If you add the line, does that deal with the issue?
// Pass host action environment variables
host.actionEnvironment = hostActionEnvironment;
host.hostActionEnvironment = hostActionEnvironment;
Can you add a test for the host_action_env issue? It looks like there aren't any tests for the flag at all, putting them in https://cs.opensource.google/bazel/bazel/+/master:src/test/shell/integration/action_env_test.sh?ss=bazel&q=action_env would probably be appropriate. |
.bazelci/postsubmit.yml
Outdated
-e 's/^# android_ndk_repository/android_ndk_repository/' | ||
-e 's/^# rbe_autoconfig/rbe_autoconfig/' | ||
-e 's/^# load("@bazel_toolchains/load("@bazel_toolchains/' WORKSPACE | ||
- sed -i.bak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there changes in the postsubmit and presubmit? We should get these reviewed by someone on who knows them better than I do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included these commits to fix the failing presubmit jdeps_test as mentioned in #12685
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be submitted (and reviewed) separately, since it's not directly part of fixing this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are already submitted, rebasing the pull request should fix this, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Yes, rebase onto master and that should be fine.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
This reverts commit aa809e5.
d3d1b00
to
40b804d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small nit, but otherwise this looks great. Thanks for all the work on this.
|
||
cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/successive_exec_tools_env.txt > $TEST_log | ||
expect_log "FOO=bar" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this extra blank line.
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
This PR passes the value of
host_action_env
tohostActionEnvironment
attribute of the host options inCoreOptions.getHost
.Fixes: #12403