diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-06-28 13:58:59 +0000 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-07-06 21:08:10 +0900 |
commit | f35278a1d0ce009f2d03475765388fad00c8e4f0 (patch) | |
tree | 39c15866572516cc3f29ed008d08f3f5ad2b8786 | |
parent | 039062218957bdae6473b482adc8800fd9be7ed3 (diff) | |
download | buildstream-f35278a1d0ce009f2d03475765388fad00c8e4f0.tar.gz |
Only run integration commands on checkout for native-built artifacts
One day BuildStream will be able to run host-incompatible integration
commands using a QEMU cross-sandbox, but for now we have to disable
integration commands for cross-builds to avoid errors when checking them
out.
-rw-r--r-- | buildstream/_pipeline.py | 10 | ||||
-rw-r--r-- | buildstream/element.py | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py index c1eb3a863..290c9277b 100644 --- a/buildstream/_pipeline.py +++ b/buildstream/_pipeline.py @@ -444,8 +444,16 @@ class Pipeline(): raise PipelineError("Checkout directory is not empty: {}" .format(directory)) + # BuildStream will one day be able to run host-incompatible binaries + # by using a QEMU sandbox, but for now we need to disable integration + # commands for cross-build artifacts. + can_integrate = (self.context.host_arch == self.context.target_arch) + if not can_integrate: + self.message(self.target, MessageType.WARN, + "Host-incompatible checkout -- no integration commands can be run") + # Stage deps into a temporary sandbox first - with self.target._prepare_sandbox(Scope.RUN, None) as sandbox: + with self.target._prepare_sandbox(Scope.RUN, None, integrate=can_integrate) as sandbox: # Make copies from the sandbox into to the desired directory sandbox_root = sandbox.get_directory() diff --git a/buildstream/element.py b/buildstream/element.py index ee8b86b49..2e45fb588 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1004,7 +1004,7 @@ class Element(Plugin): # is used to stage things by the `bst checkout` codepath # @contextmanager - def _prepare_sandbox(self, scope, directory): + def _prepare_sandbox(self, scope, directory, integrate=True): with self.__sandbox(directory) as sandbox: @@ -1022,9 +1022,10 @@ class Element(Plugin): # Run any integration commands provided by the dependencies # once they are all staged and ready - with self.timed_activity("Integrating sandbox"): - for dep in self.dependencies(scope): - dep.integrate(sandbox) + if integrate: + with self.timed_activity("Integrating sandbox"): + for dep in self.dependencies(scope): + dep.integrate(sandbox) yield sandbox |