summaryrefslogtreecommitdiff
path: root/buildstream/element.py
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-10-03 17:06:59 +0100
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-10-03 17:06:59 +0100
commite8179c34db5b866affc603cb0adde438f3755cf0 (patch)
tree96a12630617b05c4f3001f186588bee5af6582c8 /buildstream/element.py
parent3e5ff5a9667917d0200f4e9bbb3e61093fb69368 (diff)
downloadbuildstream-e8179c34db5b866affc603cb0adde438f3755cf0.tar.gz
element.py: Put the temporary staging directory in artifactdirjmac/temporaries-inside-cachedir
Diffstat (limited to 'buildstream/element.py')
-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()