summaryrefslogtreecommitdiff
path: root/src/buildstream/sandbox/_sandboxbuildbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/sandbox/_sandboxbuildbox.py')
-rw-r--r--src/buildstream/sandbox/_sandboxbuildbox.py37
1 files changed, 10 insertions, 27 deletions
diff --git a/src/buildstream/sandbox/_sandboxbuildbox.py b/src/buildstream/sandbox/_sandboxbuildbox.py
index 15e45a4df..6016fffe3 100644
--- a/src/buildstream/sandbox/_sandboxbuildbox.py
+++ b/src/buildstream/sandbox/_sandboxbuildbox.py
@@ -47,9 +47,7 @@ class SandboxBuildBox(Sandbox):
utils.get_host_tool("buildbox")
except utils.ProgramNotFoundError as Error:
cls._dummy_reasons += ["buildbox not found"]
- raise SandboxError(
- " and ".join(cls._dummy_reasons), reason="unavailable-local-sandbox"
- ) from Error
+ raise SandboxError(" and ".join(cls._dummy_reasons), reason="unavailable-local-sandbox") from Error
@classmethod
def check_sandbox_config(cls, platform, config):
@@ -74,8 +72,7 @@ class SandboxBuildBox(Sandbox):
if not self._has_command(command[0], env):
raise SandboxCommandError(
- "Staged artifacts do not provide command " "'{}'".format(command[0]),
- reason="missing-command",
+ "Staged artifacts do not provide command " "'{}'".format(command[0]), reason="missing-command",
)
# Grab the full path of the buildbox binary
@@ -83,10 +80,7 @@ class SandboxBuildBox(Sandbox):
buildbox_command = [utils.get_host_tool("buildbox")]
except ProgramNotFoundError as Err:
raise SandboxError(
- (
- "BuildBox not on path, you are using the BuildBox sandbox because "
- "BST_FORCE_SANDBOX=buildbox"
- )
+ ("BuildBox not on path, you are using the BuildBox sandbox because " "BST_FORCE_SANDBOX=buildbox")
) from Err
for mark in self._get_marked_directories():
@@ -109,9 +103,7 @@ class SandboxBuildBox(Sandbox):
if not flags & SandboxFlags.NETWORK_ENABLED:
# TODO
- self._issue_warning(
- "BuildBox sandbox does not have Networking yet", detail=common_details
- )
+ self._issue_warning("BuildBox sandbox does not have Networking yet", detail=common_details)
if cwd is not None:
buildbox_command += ["--chdir=" + cwd]
@@ -124,23 +116,20 @@ class SandboxBuildBox(Sandbox):
if flags & SandboxFlags.INTERACTIVE:
# TODO
self._issue_warning(
- "BuildBox sandbox does not fully support BuildStream shells yet",
- detail=common_details,
+ "BuildBox sandbox does not fully support BuildStream shells yet", detail=common_details,
)
if flags & SandboxFlags.ROOT_READ_ONLY:
# TODO
self._issue_warning(
- "BuildBox sandbox does not fully support BuildStream `Read only Root`",
- detail=common_details,
+ "BuildBox sandbox does not fully support BuildStream `Read only Root`", detail=common_details,
)
# Set UID and GID
if not flags & SandboxFlags.INHERIT_UID:
# TODO
self._issue_warning(
- "BuildBox sandbox does not fully support BuildStream Inherit UID",
- detail=common_details,
+ "BuildBox sandbox does not fully support BuildStream Inherit UID", detail=common_details,
)
os.makedirs(os.path.join(scratch_directory, "mnt"), exist_ok=True)
@@ -179,14 +168,10 @@ class SandboxBuildBox(Sandbox):
)
if exit_code == 0:
- with open(
- os.path.join(scratch_directory, "out"), "rb"
- ) as output_digest_file:
+ with open(os.path.join(scratch_directory, "out"), "rb") as output_digest_file:
output_digest = remote_execution_pb2.Digest()
output_digest.ParseFromString(output_digest_file.read())
- self._vdir = CasBasedDirectory(
- root_directory.cas_cache, digest=output_digest
- )
+ self._vdir = CasBasedDirectory(root_directory.cas_cache, digest=output_digest)
return exit_code
@@ -210,9 +195,7 @@ class SandboxBuildBox(Sandbox):
group_id = os.getpgid(process.pid)
os.killpg(group_id, signal.SIGCONT)
- with _signals.suspendable(suspend_proc, resume_proc), _signals.terminator(
- kill_proc
- ):
+ with _signals.suspendable(suspend_proc, resume_proc), _signals.terminator(kill_proc):
process = subprocess.Popen(
argv,
close_fds=True,