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
This commit is contained in:
Yaowen Mei
2024-07-24 08:25:12 +00:00
parent e1234e51b8
commit d4da266b35
2 changed files with 2 additions and 3 deletions

View File

@@ -1341,8 +1341,7 @@ func (c *configImpl) rbeDownloadTmpDir() string {
}
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 {

View File

@@ -65,7 +65,7 @@ func getRBEVars(ctx Context, config Config) map[string]string {
"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