diff options
Diffstat (limited to 'src/buildstream/sandbox/_sandboxbuildboxrun.py')
-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 |