diff options
author | Jürg Billeter <j@bitron.ch> | 2020-03-31 18:38:32 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2020-03-31 18:44:31 +0200 |
commit | f3726a71f54c90d1605ec6522e24e0b1d3983d52 (patch) | |
tree | aadda01e54c05fd2abd00bea73008a9c1686bbc2 | |
parent | ceb38d1eadf724b980c9e523c57b44ff8ea6a320 (diff) | |
download | buildstream-juerg/buildbox-run-error.tar.gz |
_sandboxbuildboxrun.py: Check for buildbox-run initialization errorsjuerg/buildbox-run-error
If `buildbox-run --capabilities` reports an error, we should consider
the sandbox to be unavailable, forwarding the error message from
buildbox-run.
-rw-r--r-- | src/buildstream/sandbox/_sandboxbuildboxrun.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/buildstream/sandbox/_sandboxbuildboxrun.py b/src/buildstream/sandbox/_sandboxbuildboxrun.py index d0907a713..d3b9e4da6 100644 --- a/src/buildstream/sandbox/_sandboxbuildboxrun.py +++ b/src/buildstream/sandbox/_sandboxbuildboxrun.py @@ -47,13 +47,17 @@ class SandboxBuildBoxRun(SandboxREAPI): cls._dummy_reasons += ["buildbox-run not found"] raise SandboxError(" and ".join(cls._dummy_reasons), reason="unavailable-local-sandbox") from Error - exit_code, output = utils._call([path, "--capabilities"], stdout=subprocess.PIPE) + exit_code, output = utils._call([path, "--capabilities"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) if exit_code == 0: # buildbox-run --capabilities prints one capability per line cls._capabilities = set(output.split("\n")) - else: + elif "Invalid option --capabilities" in output: # buildbox-run is too old to support extra capabilities cls._capabilities = set() + else: + # buildbox-run is not functional + cls._dummy_reasons += ["buildbox-run: {}".format(output)] + raise SandboxError(" and ".join(cls._dummy_reasons), reason="unavailable-local-sandbox") @classmethod def check_sandbox_config(cls, platform, config): |