diff options
author | Jürg Billeter <j@bitron.ch> | 2020-01-21 10:00:38 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2020-02-03 18:44:30 +0000 |
commit | f7239fe2c8d51f85412443c8ca00870626696090 (patch) | |
tree | fcaec9cfb59b5e7380c908cf7c8384ff33abba9d /src/buildstream | |
parent | 020b20cdd2b46f79d34cb6e178e58570a426bbca (diff) | |
download | buildstream-f7239fe2c8d51f85412443c8ca00870626696090.tar.gz |
_sandboxbuildboxrun.py: Check buildbox-run capabilities
Diffstat (limited to 'src/buildstream')
-rw-r--r-- | src/buildstream/sandbox/_sandboxbuildboxrun.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/buildstream/sandbox/_sandboxbuildboxrun.py b/src/buildstream/sandbox/_sandboxbuildboxrun.py index d542d39f8..dd70f944b 100644 --- a/src/buildstream/sandbox/_sandboxbuildboxrun.py +++ b/src/buildstream/sandbox/_sandboxbuildboxrun.py @@ -40,11 +40,19 @@ class SandboxBuildBoxRun(SandboxREAPI): @classmethod def check_available(cls): try: - utils.get_host_tool("buildbox-run") + path = utils.get_host_tool("buildbox-run") except utils.ProgramNotFoundError as Error: 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"]) + if exit_code == 0: + # buildbox-run --capabilities prints one capability per line + cls._capabilities = set(output.split("\n")) + else: + # buildbox-run is too old to support extra capabilities + cls._capabilities = set() + @classmethod def check_sandbox_config(cls, platform, config): # Report error for elements requiring non-0 UID/GID |