From d4da266b351349e7f150ebaeb40ed26ff047ba17 Mon Sep 17 00:00:00 2001 From: Yaowen Mei Date: Wed, 24 Jul 2024 08:25:12 +0000 Subject: [PATCH] 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 --- ui/build/config.go | 3 +-- ui/build/rbe.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/build/config.go b/ui/build/config.go index 631b76f03..b8fcb6b5d 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -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 { diff --git a/ui/build/rbe.go b/ui/build/rbe.go index 8fa147f70..0a0f95628 100644 --- a/ui/build/rbe.go +++ b/ui/build/rbe.go @@ -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