Bazel: BEP's named set of files is incomplete if an action from any output group of a set of groups fails

Created on 20 Sep 2019  路  15Comments  路  Source: bazelbuild/bazel

Let T be a target, foo-outputs and bar-outputs be output groups, foo-action and bar-action be actions in T, and foo.out and bar.out be outputs generated by foo-action and bar-action respectively.

  • If we build T and request for foo-outputs, we expect foo.out to be in a NamedSetOfFiles in the BEP output. This is WAI.
  • If we build T and request for foo-outputs and bar-outputs, we expect foo.out and bar.out to be in in their own NamedSetOfFiles, since they were generated by different actions foo-action and bar-action. This is WAI.
  • If we build T and request for foo-outputs and bar-outputs, and bar-action fails, we expect that foo.out to still be listed in BEP. However, this is not the case and foo.out is missing, even with --keep_going.
  • Additionally, if there is a target U that depends on T, U's foo-outputs files will also be missing from the BEP.

This has caused issues with IJwB's Java integration. See this issue for the diagnosis and a repro project. https://github.com/bazelbuild/intellij/issues/1167#issuecomment-533693212

The intuitive BEP state here is that the foo-outputs files should still be listed, regardless of failing actions requested by other output groups.

P1 team-Core bug

Most helpful comment

Sorry for the delay with fixing this particular issue.

The first attempt at a fix was known to misreport some action outputs when building with --nokeep_going. My latest attempt addresses that concern. The new approach also handles the case where some (but not all) actions fail while producing outputs for the same output_group.

All 15 comments

@ulfjack @aehlig does the following intuition look right to you?

The intuitive BEP state here is that the foo-outputs files should still be listed, regardless of failing actions requested by other output groups.

Quick mention that this is very important for the IntelliJ plugin, both for Blaze and Bazel users. The workaround of running separate builds (which we don't do, and which would require significant work) causes serious performance regressions when running remotely, so isn't a good option.

The semantics you describe seem reasonable. Unless it's overly invasive, it seems reasonable to change the implementation to match. I haven't looked at the code.

Moving this over to the Bazel Core team.

(adgar@ is looking at this)

Any updates?

cc @michaeledgar

Sorry for the delay with fixing this particular issue.

The first attempt at a fix was known to misreport some action outputs when building with --nokeep_going. My latest attempt addresses that concern. The new approach also handles the case where some (but not all) actions fail while producing outputs for the same output_group.

thanks, @michaeledgar!

No problem, thanks for the super-detailed report!

Thanks! This will get in 2.0 right?

2.0's release candidates have been cut, so this will come in 2.1.

Reopening this issue while the fix submitted as 0552bd7 is reworked to avoid producing overlarge NamedSetOfFiles messages. That fix has already been rolled back (d7d441b).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ttsugriy picture ttsugriy  路  3Comments

meteorcloudy picture meteorcloudy  路  3Comments

GaofengCheng picture GaofengCheng  路  3Comments

ajaysaini-sgvu picture ajaysaini-sgvu  路  3Comments

buchgr picture buchgr  路  3Comments