From e8179c34db5b866affc603cb0adde438f3755cf0 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Wed, 3 Oct 2018 17:06:59 +0100 Subject: element.py: Put the temporary staging directory in artifactdir --- buildstream/element.py | 8 ++++---- 1 file 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() -- cgit v1.2.1