summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim+gitlab@mode7.co.uk>2018-10-03 16:44:02 +0000
committerJim MacArthur <jim+gitlab@mode7.co.uk>2018-10-03 16:44:02 +0000
commit3cf38c8e0a1828ed7ba6b5ec125c415a40da7f21 (patch)
tree96a12630617b05c4f3001f186588bee5af6582c8
parent3e5ff5a9667917d0200f4e9bbb3e61093fb69368 (diff)
parente8179c34db5b866affc603cb0adde438f3755cf0 (diff)
downloadbuildstream-3cf38c8e0a1828ed7ba6b5ec125c415a40da7f21.tar.gz
Merge branch 'jmac/temporaries-inside-cachedir' into 'master'
Move the temporary staging directory to artifactdir See merge request BuildStream/buildstream!856
-rw-r--r--buildstream/element.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 320ba7a8a..9154f10e8 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1379,10 +1379,10 @@ class Element(Plugin):
if not vdirectory.is_empty():
raise ElementError("Staging directory '{}' is not empty".format(vdirectory))
- # While mkdtemp is advertised as using the TMP environment variable, it
- # doesn't, so this explicit extraction is necesasry.
- tmp_prefix = os.environ.get("TMP", None)
- temp_staging_directory = tempfile.mkdtemp(prefix=tmp_prefix)
+ # It's advantageous to have this temporary directory on
+ # the same filing system as the rest of our cache.
+ temp_staging_location = os.path.join(self._get_context().artifactdir, "staging_temp")
+ temp_staging_directory = tempfile.mkdtemp(prefix=temp_staging_location)
try:
workspace = self._get_workspace()