implement USE_BAZEL_VERSION for m
This allows USE_BAZEL_VERSION to be set for m builds, which will use
Bazelisk for any Bazel invocations during those builds.
This should be used only for manual debugging, typically to either test
new Bazel features, verify Bazel compatibility with Android, or culprit
find new Bazel breakages.
Test: Manually run builds with USE_BAZEL_VERSION, toggled off and on to
ensure the build was rerun. Tested with a broken commit, a working
commit, and 'last_green' special term
Change-Id: I8b475dca5c8d4bd849ee3724a8c3aca9b631bcb8
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index cf6c1c7..d8c59b8 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -544,6 +544,12 @@
}
writeMetrics(configuration, ctx.EventHandler, metricsDir)
}
+
+ // Register this environment variablesas being an implicit dependencies of
+ // soong_build. Changes to this environment variable will result in
+ // retriggering soong_build.
+ configuration.Getenv("USE_BAZEL_VERSION")
+
writeUsedEnvironmentFile(configuration)
// Touch the output file so that it's the newest file created by soong_build.