Add the ability to select on arch

Bug: 323382414
Test: go test
Change-Id: I0d4cf391a1a625c5160456db1f4f7fa424c2141e
This commit is contained in:
Cole Faust
2024-03-20 12:28:03 -07:00
parent 949157d582
commit 0aa21cc8e2
5 changed files with 44 additions and 4 deletions

View File

@@ -599,7 +599,14 @@ func (m *baseModuleContext) EvaluateConfiguration(ty parser.SelectType, conditio
}
return "", false
case parser.SelectTypeVariant:
m.ModuleErrorf("TODO(b/323382414): Variants are not yet supported in selects")
if condition == "arch" {
if !m.ArchReady() {
m.ModuleErrorf("A select on arch was attempted before the arch mutator ran")
return "", false
}
return m.Arch().ArchType.Name, true
}
m.ModuleErrorf("Unknown variant " + condition)
return "", false
default:
panic("Should be unreachable")