Fix RBE tmp dir
The RBE tmp dir holds all the re-client logs and socket files.
Currently, it is being created as the `out/soong/.temp/` dir, which is auto deleted by Soong. This is causing problems because while a build is running, user cannot open a second terminal and run `lunch`.
This CL fixes the issue by creating the RBE tmp dir in the `out/soong/rbe/` directory. The next RBE build will clean this folder.
Bug: 349664018
Change-Id: Ib238e48f5b19755b016263b45f02b1be3e8efb35
diff --git a/ui/build/config.go b/ui/build/config.go
index 631b76f..b8fcb6b 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -1341,8 +1341,7 @@
}
func (c *configImpl) rbeTmpDir() string {
- buildTmpDir := shared.TempDirForOutDir(c.SoongOutDir())
- return filepath.Join(buildTmpDir, "rbe")
+ return filepath.Join(c.SoongOutDir(), "rbe")
}
func (c *configImpl) rbeCacheDir() string {
diff --git a/ui/build/rbe.go b/ui/build/rbe.go
index 8fa147f..0a0f956 100644
--- a/ui/build/rbe.go
+++ b/ui/build/rbe.go
@@ -65,7 +65,7 @@
"RBE_platform": "container-image=" + remoteexec.DefaultImage,
}
if config.StartRBE() {
- name, err := config.rbeSockAddr(absPath(ctx, config.TempDir()))
+ name, err := config.rbeSockAddr(absPath(ctx, config.rbeTmpDir()))
if err != nil {
ctx.Fatalf("Error retrieving socket address: %v", err)
return nil