-
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
Bazel rebuilds host-configured targets when $PATH changes even with --action_env=PATH=x #10291
Comments
I tried repro'ing this on Linux and macOS without success: foo/BUILD:
I built using Are you building Go code? Can you show a repro? (I don't know what you have in |
Looks like the pure go packages don't exhibit this issue and neither does the example you posted above. We have more targets in our build script than originally posted, so I will figure out which targets are involved... All of the So, does this mean each rule needs to implement Edit: I was under the impression that |
I don't know what this means, without understand what exactly breaks.
|
Here's a repro that builds on top of your example. BUILD:
test_path.bzl:
If you build the cc_binary target directly as in your example, there's no rebuild even when changing the global PATH. However, if you build the test_path target, you get a repro if you change the global PATH:
Is this working as intended? Why would we see different behavior when building the cc_binary directly or if it is a dependency of a rule? According to #6648 and #7026 Adding
Was the |
Thanks for the repro! I think the culprit is the "host" configuration. We've had similar bugs in the past, when the host config didn't respect properties that the target config did. Yes, |
Looks like |
The |
Can you provide an example of how to set --host_action_env in .bazelrc that changes to PATH won't result in a full rebuild Phil ? I've tried both: and similarly for action_env. I get a full rebuild every time PATH changes for host and cross-compiled targets. |
@rosasco-wk Do you have a reproducer? With the example in #10291 (comment) and either |
I'm using bazel 5.2.0. I don't have this problem isolated. I'm observing it in the build of Android GPU Inspector which is a substantial build to set up given its dependencies. Do you expect this behavior in 5.2.0 ? |
I don't think anything has changed in this area since 5.2.0, so I would expect that to work. If the project has many dependencies, is it possible that a repository rule picks up PATH and that causes widespread invalidation as a ripple effect? |
Yes, that's possible but the degree of invalidation is hard to get my head around. PATH change is the same as |
Description of the problem / feature request:
Bazel rebuilds host-configured targets when $PATH changes even when setting --action_env=PATH=x
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
EDIT: See #10291 (comment) for repro
What operating system are you running Bazel on?
What's the output of
bazel info release
?release 1.2.0
The text was updated successfully, but these errors were encountered: