Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2445d7c4 authored by Ramy Medhat's avatar Ramy Medhat Committed by Automerger Merge Worker
Browse files

[DO NOT MERGE] Add USE_RBE support to soong. am: adf591a5

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

Change-Id: If092b91a56d476047e4212420abab57ce96febbb
parents 0350a2e6 adf591a5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -714,6 +714,10 @@ func (c *config) UseGoma() bool {
	return Bool(c.productVariables.UseGoma)
}

func (c *config) UseRBE() bool {
	return Bool(c.productVariables.UseRBE)
}

func (c *config) RunErrorProne() bool {
	return c.IsEnvTrue("RUN_ERROR_PRONE")
}
+1 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ type productVariables struct {
	HostStaticBinaries               *bool `json:",omitempty"`
	Binder32bit                      *bool `json:",omitempty"`
	UseGoma                          *bool `json:",omitempty"`
	UseRBE                           *bool `json:",omitempty"`
	Debuggable                       *bool `json:",omitempty"`
	Eng                              *bool `json:",omitempty"`
	Treble_linker_namespaces         *bool `json:",omitempty"`
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ bootstrap_go_package {
        "ninja.go",
        "path.go",
        "proc_sync.go",
        "rbe.go",
        "signal.go",
        "soong.go",
        "test_build.go",
+5 −0
Original line number Diff line number Diff line
@@ -161,6 +161,11 @@ func Build(ctx Context, config Config, what int) {
		startGoma(ctx, config)
	}

	if config.StartRBE() {
		// Ensure RBE proxy is started
		startRBE(ctx, config)
	}

	if what&BuildProductConfig != 0 {
		// Run make for product config
		runMakeProductConfig(ctx, config)
+24 −0
Original line number Diff line number Diff line
@@ -493,6 +493,30 @@ func (c *configImpl) StartGoma() bool {
	return true
}

func (c *configImpl) UseRBE() bool {
	if v, ok := c.environ.Get("USE_RBE"); ok {
		v = strings.TrimSpace(v)
		if v != "" && v != "false" {
			return true
		}
	}
	return false
}

func (c *configImpl) StartRBE() bool {
	if !c.UseRBE() {
		return false
	}

	if v, ok := c.environ.Get("NOSTART_RBE"); ok {
		v = strings.TrimSpace(v)
		if v != "" && v != "false" {
			return false
		}
	}
	return true
}

// RemoteParallel controls how many remote jobs (i.e., commands which contain
// gomacc) are run in parallel.  Note the parallelism of all other jobs is
// still limited by Parallel()
Loading