product_variables srcs in prebuilt_etc
bp2build conversion handles product_variable srcs
bug: 228353067
Test: prebuilt_etc_conversion_test.go
Change-Id: I82d3a384ee14d4e981d502dd9eb824c87d5ae2c7
diff --git a/bazel/properties.go b/bazel/properties.go
index d82fa64..11f6247 100644
--- a/bazel/properties.go
+++ b/bazel/properties.go
@@ -309,7 +309,19 @@
_, containsProductVariables := axisTypes[productVariables]
if containsProductVariables {
if containsOs || containsArch || containsOsArch {
- return fmt.Errorf("label attribute could not be collapsed as it has two or more unrelated axes")
+ if containsArch {
+ allProductVariablesAreArchVariant := true
+ for k := range la.ConfigurableValues {
+ if k.configurationType == productVariables && k.outerAxisType != arch {
+ allProductVariablesAreArchVariant = false
+ }
+ }
+ if !allProductVariablesAreArchVariant {
+ return fmt.Errorf("label attribute could not be collapsed as it has two or more unrelated axes")
+ }
+ } else {
+ return fmt.Errorf("label attribute could not be collapsed as it has two or more unrelated axes")
+ }
}
}
if (containsOs && containsArch) || (containsOsArch && (containsOs || containsArch)) {