From 32a669b01bdef566612bbe24d0eb89935f0fb0d7 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 8 Mar 2018 19:42:00 -0800 Subject: [PATCH] Use our own TMPDIR Some people have run into issues where /tmp is on a smaller partition than their main source tree, and if it fills up (or only has a few GB free), their builds can start failing. There may also be a subset of people whose /tmp may be slower than their out directory -- if they put their src and out trees on a SSD, but keep /tmp on a spinning HDD. Bug: 71755844 Test: check out/soong.log for TMPDIR Test: do a build, watch out/soong/.temp Change-Id: Ib749ec736ad0f6c8ce7453861a91b3e99ddbd92d --- ui/build/config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/build/config.go b/ui/build/config.go index 27ed8e9fe..a1b5bd4a9 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -115,6 +115,8 @@ func NewConfig(ctx Context, args ...string) Config { // Tell python not to spam the source tree with .pyc files. ret.environ.Set("PYTHONDONTWRITEBYTECODE", "1") + ret.environ.Set("TMPDIR", absPath(ctx, ret.TempDir())) + // Precondition: the current directory is the top of the source tree if _, err := os.Stat(srcDirFileCheck); err != nil { if os.IsNotExist(err) {