Skip to content

Commit

Permalink
Fix action conflict on exec transitioned cc_proto_library
Browse files Browse the repository at this point in the history
When the proto rules' depdencies were switched over to the exec config in
7acf9ea, the dependency of CcProtoAspect on the
proto C++ toolchain was not updated. Due to this, cc_proto_library had two
dependencies on @com_google_protobuf//:protobuf (through :protoc and directly)
with potentially incompatible configurations, which lead to conflicting actions.

Fixes bazelbuild#13464.
  • Loading branch information
fmeum committed Aug 21, 2021
1 parent d21345d commit ad62f2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ java_library(
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/actions:artifacts",
"//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster",
"//src/main/java/com/google/devtools/build/lib/analysis:config/execution_transition_factory",
"//src/main/java/com/google/devtools/build/lib/analysis:configured_target",
"//src/main/java/com/google/devtools/build/lib/analysis:rule_definition_environment",
"//src/main/java/com/google/devtools/build/lib/analysis:transitive_info_collection",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.google.devtools.build.lib.analysis.TransitiveInfoCollection;
import com.google.devtools.build.lib.analysis.TransitiveInfoProviderMap;
import com.google.devtools.build.lib.analysis.TransitiveInfoProviderMapBuilder;
import com.google.devtools.build.lib.analysis.config.ExecutionTransitionFactory;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
Expand Down Expand Up @@ -128,6 +129,7 @@ public AspectDefinition getDefinition(AspectParameters aspectParameters) {
.add(
attr(PROTO_TOOLCHAIN_ATTR, LABEL)
.mandatoryBuiltinProviders(ImmutableList.of(ProtoLangToolchainProvider.class))
.cfg(ExecutionTransitionFactory.create())
.value(PROTO_TOOLCHAIN_LABEL))
.add(
attr(CcToolchain.CC_TOOLCHAIN_DEFAULT_ATTRIBUTE_NAME, LABEL)
Expand Down

0 comments on commit ad62f2d

Please sign in to comment.