aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Arruda <patricearruda@google.com>2020-09-30 18:33:54 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-09-30 18:33:54 +0000
commitd6f7bf5069ea8e255e11cd600c677fafe5ab1b56 (patch)
tree2534e89b103d2b360b65234ed863614ca1b568eb
parent05cee446bf3100a8a08ee1c2ab1a97bd26881755 (diff)
parent68805280f05f831bb44d21a2bf3c062f3343f99b (diff)
downloadsoong-d6f7bf5069ea8e255e11cd600c677fafe5ab1b56.tar.gz
resolve merge conflicts of 64d43056ace73e9cc34b6bd2885185af2495633d to rvc-dev am: 68805280f0
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/12730519 Change-Id: I809d86b85f8f796c1b24c4a7718045e357f661be
-rw-r--r--cmd/soong_ui/main.go1
-rw-r--r--ui/build/config.go24
-rw-r--r--ui/build/rbe.go10
3 files changed, 24 insertions, 11 deletions
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index 89ece8d16..78e636cf0 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -173,7 +173,6 @@ func main() {
rbeMetricsFile := filepath.Join(logsDir, c.logsPrefix+"rbe_metrics.pb")
soongMetricsFile := filepath.Join(logsDir, c.logsPrefix+"soong_metrics")
defer build.UploadMetrics(buildCtx, config, c.forceDumbOutput, buildStarted, buildErrorFile, rbeMetricsFile, soongMetricsFile)
- defer build.PrintGomaDeprecation(buildCtx, config)
os.MkdirAll(logsDir, 0777)
log.SetOutput(filepath.Join(logsDir, c.logsPrefix+"soong.log"))
diff --git a/ui/build/config.go b/ui/build/config.go
index 5bf4bafe3..9c24f5ab4 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -24,6 +24,7 @@ import (
"time"
"android/soong/shared"
+
"github.com/golang/protobuf/proto"
smpb "android/soong/ui/metrics/metrics_proto"
@@ -185,6 +186,17 @@ func NewConfig(ctx Context, args ...string) Config {
"EMPTY_NINJA_FILE",
)
+ if ret.UseGoma() {
+ ctx.Println("Goma for Android is being deprecated and replaced with RBE. See go/rbe_for_android for instructions on how to use RBE.")
+ ctx.Println()
+ ctx.Println("See go/goma_android_exceptions for exceptions.")
+ ctx.Fatalln("USE_GOMA flag is no longer supported.")
+ }
+
+ if ret.ForceUseGoma() {
+ ret.environ.Set("USE_GOMA", "true")
+ }
+
// Tell python not to spam the source tree with .pyc files.
ret.environ.Set("PYTHONDONTWRITEBYTECODE", "1")
@@ -780,6 +792,18 @@ func (c *configImpl) TotalRAM() uint64 {
return c.totalRAM
}
+// ForceUseGoma determines whether we should override Goma deprecation
+// and use Goma for the current build or not.
+func (c *configImpl) ForceUseGoma() bool {
+ if v, ok := c.environ.Get("FORCE_USE_GOMA"); ok {
+ v = strings.TrimSpace(v)
+ if v != "" && v != "false" {
+ return true
+ }
+ }
+ return false
+}
+
func (c *configImpl) UseGoma() bool {
if v, ok := c.environ.Get("USE_GOMA"); ok {
v = strings.TrimSpace(v)
diff --git a/ui/build/rbe.go b/ui/build/rbe.go
index 67bcebb75..6a26063b0 100644
--- a/ui/build/rbe.go
+++ b/ui/build/rbe.go
@@ -128,13 +128,3 @@ func DumpRBEMetrics(ctx Context, config Config, filename string) {
ctx.Fatalf("failed to copy %q to %q: %v\n", metricsFile, filename, err)
}
}
-
-// PrintGomaDeprecation prints a PSA on the deprecation of Goma if it is set for the build.
-func PrintGomaDeprecation(ctx Context, config Config) {
- if config.UseGoma() {
- fmt.Fprintln(ctx.Writer, "")
- fmt.Fprintln(ctx.Writer, "Goma for Android is being deprecated and replaced with RBE.")
- fmt.Fprintln(ctx.Writer, "See go/goma_android_deprecation for more details.")
- fmt.Fprintln(ctx.Writer, "")
- }
-}