Remove USE_BAZEL and its dead code
This environment variable has been out of use for some time. It used to
control Bazel-as-executor, which has been removed from Bazel for several
releases.
Bug: 243077098
Test: Treehugger
Change-Id: I4edfb5f3574c369a16547ea06ba780293c37ecb3
diff --git a/ui/build/config.go b/ui/build/config.go
index 590aeb9..14a99d0 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -99,15 +99,9 @@
pathReplaced bool
- // TODO(b/243077098): Remove useBazel.
- useBazel bool
bazelProdMode bool
bazelDevMode bool
- // During Bazel execution, Bazel cannot write outside OUT_DIR.
- // So if DIST_DIR is set to an external dir (outside of OUT_DIR), we need to rig it temporarily and then migrate files at the end of the build.
- riggedDistDirForBazel string
-
// Set by multiproduct_kati
emptyNinjaFile bool
@@ -439,21 +433,6 @@
ctx.Fatalf("Unable to remove bazel profile directory %q: %v", bpd, err)
}
- ret.useBazel = ret.environ.IsEnvTrue("USE_BAZEL")
-
- if ret.UseBazel() {
- if err := os.MkdirAll(bpd, 0777); err != nil {
- ctx.Fatalf("Failed to create bazel profile directory %q: %v", bpd, err)
- }
- }
-
- if ret.UseBazel() {
- ret.riggedDistDirForBazel = filepath.Join(ret.OutDir(), "dist")
- } else {
- // Not rigged
- ret.riggedDistDirForBazel = ret.distDir
- }
-
c := Config{ret}
storeConfigMetrics(ctx, c)
return c
@@ -486,7 +465,6 @@
ForceUseGoma: proto.Bool(config.ForceUseGoma()),
UseGoma: proto.Bool(config.UseGoma()),
UseRbe: proto.Bool(config.UseRBE()),
- BazelAsNinja: proto.Bool(config.UseBazel()),
BazelMixedBuild: proto.Bool(config.BazelBuildEnabled()),
}
c.Targets = append(c.Targets, config.arguments...)
@@ -877,11 +855,7 @@
}
func (c *configImpl) DistDir() string {
- if c.UseBazel() {
- return c.riggedDistDirForBazel
- } else {
- return c.distDir
- }
+ return c.distDir
}
func (c *configImpl) RealDistDir() string {
@@ -1129,11 +1103,6 @@
return false
}
-// TODO(b/243077098): Remove UseBazel.
-func (c *configImpl) UseBazel() bool {
- return c.useBazel
-}
-
func (c *configImpl) BazelBuildEnabled() bool {
return c.bazelProdMode || c.bazelDevMode
}