summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2019-02-06 17:02:25 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2019-02-12 16:44:35 +0000
commit352f4ad9a360ca4f8f3a0b7a68106d0131eeb374 (patch)
tree87a7fe14eebb5fc17cff7f1c8c7ae48200c62e51
parent022a59f0919333cb98cf5f43f1969191f6805eb6 (diff)
downloadbuildstream-352f4ad9a360ca4f8f3a0b7a68106d0131eeb374.tar.gz
loader.py: Stage junctions into .bst instead of a tmpdir
-rw-r--r--buildstream/_loader/loader.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py
index fc946d50b..d5dea7034 100644
--- a/buildstream/_loader/loader.py
+++ b/buildstream/_loader/loader.py
@@ -546,10 +546,13 @@ class Loader():
tempdir = None
else:
# Stage sources
- os.makedirs(self._context.builddir, exist_ok=True)
- basedir = tempfile.mkdtemp(prefix="{}-".format(element.normal_name), dir=self._context.builddir)
- element._stage_sources_at(basedir, mount_workspaces=False)
- tempdir = basedir
+ element._update_state()
+ basedir = os.path.join(self.project.directory, ".bst", "staged-junctions",
+ filename, element._get_cache_key())
+ if not os.path.exists(basedir):
+ os.makedirs(basedir, exist_ok=True)
+ element._stage_sources_at(basedir, mount_workspaces=False)
+ tempdir = None
# Load the project
project_dir = os.path.join(basedir, element.path)