Refactor mixed build allowlist handling

This refactoring prepares for introduction of bazel prod mode, an
alternative mechanism for mixed builds allowlist handling.

 * Decide bazel-mode as close to soong_build main as possible
 * BazelContext itself decides whether a module is allowlisted
 * Separate bp2build and mixed build allowlist

Test: m nothing, manually verified all modules are mixed build disabled
(via metrics)
Test: USE_BAZEL_ANALYSIS=1 m nothing, manually verified that mixed build
disabled/enabled modules are identical before and after change.

Change-Id: I0f55d8b85000cb4a871a099edc6d7d868d7df509
This commit is contained in:
Chris Parsons
2022-08-20 14:48:32 -04:00
parent ff2768d28a
commit ad876010fe
12 changed files with 144 additions and 99 deletions

View File

@@ -389,7 +389,7 @@ func TestBp2BuildAllowlist(t *testing.T) {
}
func TestBp2buildAllowList(t *testing.T) {
allowlist := getBp2BuildAllowList()
allowlist := GetBp2BuildAllowList()
for k, v := range allowlists.Bp2buildDefaultConfig {
if allowlist.defaultConfig[k] != v {
t.Errorf("bp2build default config of %s: expected: %v, got: %v", k, v, allowlist.defaultConfig[k])
@@ -415,9 +415,4 @@ func TestBp2buildAllowList(t *testing.T) {
t.Errorf("bp2build cc library static only of %s: expected: true, got: %v", k, allowlist.ccLibraryStaticOnly[k])
}
}
for _, k := range allowlists.MixedBuildsDisabledList {
if !allowlist.mixedBuildsDisabled[k] {
t.Errorf("bp2build mix build disabled of %s: expected: true, got: %v", k, allowlist.mixedBuildsDisabled[k])
}
}
}