Transition to a single config through more than one path

82 views
Skip to first unread message

Konstantin

unread,
Nov 11, 2022, 5:43:41 PM11/11/22
to bazel-discuss

I work with transitions for quite some time already but still cannot claim I understand it well. Here is the simple example I struggle to understand:

Target A is build for configuration ConfigA (achieved through some transitions) and target B is built for configuration ConfigB (achieved through another path of transitions).

Both A and B depend on the target Base which only could possibly be built for ConfigBase and therefore it specifies inbound transition to ConfigBase. Target Base produces the file BaseFile.

This setup produces analysis error that the file BaseFile is generated by these conflicting actions: A and B

I don’t understand that – it is a single file A and B depend on, but why it is reported as a conflict?

Any clue?

Thank you!

Konstantin

Konstantin

unread,
Nov 11, 2022, 5:53:05 PM11/11/22
to bazel-discuss
I guess it is worth mentioning that we are using the flag `--experimental_output_directory_naming_scheme=diff_against_baseline` which causes identical configurations to be built in the same one folder regardless of which transition path brought us to that configuration.
Interestingly enough removing this flag does not make a difference while it very much looks like it should. Anyway we don't want to remove this flag as we don't want that single configuration Base target to be built more than once.

Konstantin

unread,
Nov 11, 2022, 6:08:40 PM11/11/22
to bazel-discuss
I think what I observe is related to this bug: https://github.com/bazelbuild/bazel/issues/15770 because I specifically get this problem with the tree artifacts.

Greg Estren

unread,
Nov 23, 2022, 5:24:37 PM11/23/22
to Konstantin, bazel-discuss
FYI I would expect your scenario to work (no action conflicts) in general. There must be something specific going on: https://github.com/bazelbuild/bazel/issues/15770 sounds plausible. I wonder why cc_library uses the output folder of its inputs. 

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/5bf54212-4ccf-4926-854c-a63dfae055d9n%40googlegroups.com.

Konstantin

unread,
Nov 23, 2022, 5:29:58 PM11/23/22
to bazel-discuss
... but only for tree artifact inputs! That's mind bending. It took me quite some time to figure this problem is specific to tree artifact.
 Would love if somebody try to troubleshoot it.
Reply all
Reply to author
Forward
0 new messages