Refactor "staging dep on prod" allowlist dep am: 66fc74509f

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2288153

Change-Id: I90f579f1af49ec512712c01e44a05d82f1817fd2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Chris Parsons 2022-11-08 16:39:00 +00:00 committed by Automerger Merge Worker
commit 0adc255647
3 changed files with 11 additions and 5 deletions

View file

@ -1339,9 +1339,12 @@ var (
"prebuilt_currysrc_org.eclipse",
}
// Bazel prod-mode allowlist. Modules in this list are built by Bazel
// in either prod mode or staging mode.
ProdMixedBuildsEnabledList = []string{}
// Staging builds should be entirely prod, plus some near-ready ones. Add the
// new ones to the first argument as needed.
StagingMixedBuildsEnabledList = append([]string{}, ProdMixedBuildsEnabledList...)
// Staging-mode allowlist. Modules in this list are only built
// by Bazel with --bazel-mode-staging. This list should contain modules
// which will soon be added to the prod allowlist.
StagingMixedBuildsEnabledList = []string{}
)

View file

@ -389,9 +389,12 @@ func NewBazelContext(c *config) (BazelContext, error) {
}
case BazelStagingMode:
modulesDefaultToBazel = false
// Staging mode includes all prod modules plus all staging modules.
for _, enabledProdModule := range allowlists.ProdMixedBuildsEnabledList {
enabledModules[enabledProdModule] = true
}
for _, enabledStagingMode := range allowlists.StagingMixedBuildsEnabledList {
enabledModules[enabledStagingMode] = true
}
case BazelDevMode:
modulesDefaultToBazel = true

View file

@ -536,7 +536,7 @@ func (c *config) mockFileSystem(bp string, fs map[string][]byte) {
// Returns true if "Bazel builds" is enabled. In this mode, part of build
// analysis is handled by Bazel.
func (c *config) IsMixedBuildsEnabled() bool {
return c.BuildMode == BazelProdMode || c.BuildMode == BazelDevMode
return c.BuildMode == BazelProdMode || c.BuildMode == BazelDevMode || c.BuildMode == BazelStagingMode
}
func (c *config) SetAllowMissingDependencies() {