summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-06-28 17:09:18 +0200
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-07-05 20:32:20 +0900
commitf2d8fe2d917c74721d9311c56d93ec3bf4590fba (patch)
treef59e9a831336b13bd176a2e5a589b3fa0e248bb6
parent3ba6b89bf3fdfcadf95565215a3d3380c112fcf2 (diff)
downloadbuildstream-f2d8fe2d917c74721d9311c56d93ec3bf4590fba.tar.gz
element.py: Move build output to files subdirectory
-rw-r--r--buildstream/element.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 67626d0aa..bd97ff80b 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -319,7 +319,7 @@ class Element(Plugin):
with self.timed_activity("Staging {}/{}".format(self.name, self._get_display_key())):
# Get the extracted artifact
- artifact = self.__artifacts.extract(self)
+ artifact = os.path.join(self.__artifacts.extract(self), 'files')
# Hard link it into the staging area
#
@@ -823,8 +823,17 @@ class Element(Plugin):
# At this point, we expect an exception was raised leading to
# an error message, or we have good output to collect.
- with self.timed_activity("Caching Artifact"):
- self.__artifacts.commit(self, collectdir)
+
+ with tempfile.TemporaryDirectory(prefix='tmp', dir=sandbox_root) as assembledir:
+ # Create artifact directory structure
+ filesdir = os.path.join(assembledir, 'files')
+ os.mkdir(filesdir)
+
+ # Hard link files from collect dir to files directory
+ utils.link_files(collectdir, filesdir)
+
+ with self.timed_activity("Caching Artifact"):
+ self.__artifacts.commit(self, assembledir)
# Finally cleanup the build dir
shutil.rmtree(rootdir)
@@ -1195,7 +1204,7 @@ class Element(Plugin):
}
def __compute_splits(self, splits, orphans):
- basedir = self.__artifacts.extract(self)
+ basedir = os.path.join(self.__artifacts.extract(self), 'files')
# No splitting requested, just report complete artifact
if orphans and not splits: