Support sandboxing genrule
Bug: 281067655
Test: local build
Change-Id: I123b5e51eaf1476d1215e5208331b6540d45fd98
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
index 10cf60a..7e81792 100644
--- a/android/bazel_handler.go
+++ b/android/bazel_handler.go
@@ -505,7 +505,7 @@
return []bazel.AqueryDepset{}
}
-func addToStringSet(set map[string]bool, items []string) {
+func AddToStringSet(set map[string]bool, items []string) {
for _, item := range items {
set[item] = true
}
@@ -517,19 +517,19 @@
switch buildMode {
case BazelProdMode:
- addToStringSet(enabledModules, allowlists.ProdMixedBuildsEnabledList)
+ AddToStringSet(enabledModules, allowlists.ProdMixedBuildsEnabledList)
for enabledAdHocModule := range forceEnabled {
enabledModules[enabledAdHocModule] = true
}
case BazelStagingMode:
// Staging mode includes all prod modules plus all staging modules.
- addToStringSet(enabledModules, allowlists.ProdMixedBuildsEnabledList)
- addToStringSet(enabledModules, allowlists.StagingMixedBuildsEnabledList)
+ AddToStringSet(enabledModules, allowlists.ProdMixedBuildsEnabledList)
+ AddToStringSet(enabledModules, allowlists.StagingMixedBuildsEnabledList)
for enabledAdHocModule := range forceEnabled {
enabledModules[enabledAdHocModule] = true
}
case BazelDevMode:
- addToStringSet(disabledModules, allowlists.MixedBuildsDisabledList)
+ AddToStringSet(disabledModules, allowlists.MixedBuildsDisabledList)
default:
panic("Expected BazelProdMode, BazelStagingMode, or BazelDevMode")
}
@@ -609,7 +609,7 @@
allowlists.StagingDclaMixedBuildsEnabledList...)
}
dclaEnabledModules := map[string]bool{}
- addToStringSet(dclaEnabledModules, dclaMixedBuildsEnabledList)
+ AddToStringSet(dclaEnabledModules, dclaMixedBuildsEnabledList)
return &mixedBuildBazelContext{
bazelRunner: &builtinBazelRunner{c.UseBazelProxy, absolutePath(c.outDir)},
paths: &paths,
diff --git a/android/config.go b/android/config.go
index acadb3f..58ad4c5 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1886,8 +1886,8 @@
return InList(name, c.config.productVariables.BuildBrokenInputDirModules)
}
-func (c *deviceConfig) BuildBrokenDepfile() bool {
- return Bool(c.config.productVariables.BuildBrokenDepfile)
+func (c *deviceConfig) GenruleSandboxing() bool {
+ return Bool(c.config.productVariables.GenruleSandboxing)
}
func (c *deviceConfig) RequiresInsecureExecmemForSwiftshader() bool {
diff --git a/android/variable.go b/android/variable.go
index 97171e7..a6822c6 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -443,7 +443,7 @@
BuildBrokenClangAsFlags bool `json:",omitempty"`
BuildBrokenClangCFlags bool `json:",omitempty"`
BuildBrokenClangProperty bool `json:",omitempty"`
- BuildBrokenDepfile *bool `json:",omitempty"`
+ GenruleSandboxing *bool `json:",omitempty"`
BuildBrokenEnforceSyspropOwner bool `json:",omitempty"`
BuildBrokenTrebleSyspropNeverallow bool `json:",omitempty"`
BuildBrokenUsesSoongPython2Modules bool `json:",omitempty"`