-
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 coverage
generating conflicting files with bazel 5.0rc3
#14521
Comments
Incase it helps, here are a few snippets that might be applicable:
|
Correct. This does not happen with 4.2. I’ll try for a repro case or if
there is other logs or parts of my build files they would be helpful please
point me at those.
…On Fri, Jan 7, 2022 at 12:00 AM Yun Peng ***@***.***> wrote:
@ptarjan <https://github.com/ptarjan> Can you confirm this doesn't happen
with Bazel 4.2? It would be very helpful if you can construct a minimal
reproduce case for this error.
/cc @alexjski <https://github.com/alexjski> Any idea on this?
—
Reply to this email directly, view it on GitHub
<#14521 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJZT7XLNMHIVPYYLUYZ2DUU22VLANCNFSM5LM2P7VA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Also cc @c-mita because "coverage". This might be another release blocker. |
I tried briefly to reproduce that and I am missing |
Oh sorry, that is:
I'm working on a small repro but I haven't yet found the right combination of targets which make this happen. If I do:
it always happens, but if I do:
it doesn't. |
Incase it helps, we also have this in our .bazelrc:
(so that all build operations don't invalidate the analysis cache between coverage runs) |
I'm playing around with the targets and I was able to get it spitting out a different message that is using only the
|
Ok! I think I have a repro:
|
Thanks! @alexjski can you look into reproducing this? |
Thank you so much @ptarjan! I created a complete repro in my fork of Bazel which has prerequisites available. I looked into the issue a little bit, what we have here is 2 actions which do differ on the action key:
If execution platform is important for what the action does (and the logic computing the key suggests so), then I would argue that the output path of the artifact should reflect that (like it does reflect e.g. different target CPU), if not, maybe the key should just be the same. Adding @katre since he is the expert on execution platforms. |
Nice! Do we know what caused this to only show up in 5.0.0rc's? |
I think |
The original intention behind having the execution platform be part of the action key is that in remote execution cases, different execution platforms may be sent to different remove executors (depending on the As for I am slightly surprised that these have the same output directory: I would have expected the |
I think they have the same output directory because the configuration is the same. |
Toolchain targets can be evaluated with a [custom execution platform](https://github.com/bazelbuild/bazel/blob/b0a01af6fd0c5f3dce634cb827c75e818835e402/src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetKey.java#L168) without affecting the configuration. In particular, we can have 2 `ToolchainDependencyConfiguredTargetKey` with the same label and configuration, but different `executionPlatformLabel`. When coverage is enabled, [every target](https://github.com/bazelbuild/bazel/blob/b0a01af6fd0c5f3dce634cb827c75e818835e402/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetBuilder.java#L160-L166) will have a [`baseline_coverage.dat` file generated with `BaselineCoverageAction`](https://github.com/bazelbuild/bazel/blob/33f7648fbaa875f73416be47f0b3c10ed93f30d6/src/main/java/com/google/devtools/build/lib/analysis/test/BaselineCoverageAction.java#L108-L114). This action will use the execution platform from the rule, meaning that in case of the same 2 toolchains, differing by execution platform only, we will create a coverage action with the same output (path based on configuration), but [different key](https://github.com/bazelbuild/bazel/blob/d657619c9c162c6e8c8f56b66e8bef4285d81944/src/main/java/com/google/devtools/build/lib/actions/ActionKeyCacher.java#L65-L70). This fails in analysis since that constitutes a conflicting shared action. Disable coverage for toolchain targets to prevent actions from being created for those. Fixes #14521. PiperOrigin-RevId: 421317916
Description of the problem / feature request:
When trying to use bazel 5.0rc3 I'm seeing this error with our monorepo build:
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Sadly I haven't isolated which rules are actually causing this. Maybe you can help me get you the right debugging information?
What operating system are you running Bazel on?
Linux
What's the output of
bazel info release
?If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Private repo
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: