Don't panic for unhandled product vars
Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing
Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
diff --git a/genrule/genrule.go b/genrule/genrule.go
index d1c2f13..0d484c4 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -993,7 +993,10 @@
var cmdProp bazel.StringAttribute
cmdProp.SetValue(replaceVariables(proptools.String(m.properties.Cmd)))
- allProductVariableProps := android.ProductVariableProperties(ctx, m)
+ allProductVariableProps, errs := android.ProductVariableProperties(ctx, m)
+ for _, err := range errs {
+ ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
+ }
if productVariableProps, ok := allProductVariableProps["Cmd"]; ok {
for productVariable, value := range productVariableProps {
var cmd string