Merge pull request 'don't error on macOS if sandbox for vars is missing' (#3309) from macos-sandbox into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3309
This commit is contained in:
Mic92
2025-04-14 12:24:49 +00:00

View File

@@ -209,15 +209,19 @@ def execute_generator(
final_script = generator.final_script() final_script = generator.final_script()
if sys.platform == "linux" and bwrap.bubblewrap_works(): if sys.platform == "linux":
cmd = bubblewrap_cmd(str(final_script), tmpdir) if bwrap.bubblewrap_works():
cmd = bubblewrap_cmd(str(final_script), tmpdir)
else:
if not no_sandbox:
msg = (
f"Cannot safely execute generator {generator.name}: Sandboxing is not available on this system\n"
f"Re-run 'vars generate' with '--no-sandbox' to disable sandboxing"
)
raise ClanError(msg)
cmd = ["bash", "-c", str(final_script)]
else: else:
if not no_sandbox: # TODO: implement sandboxing for macOS using sandbox-exec
msg = (
f"Cannot safely execute generator {generator.name}: Sandboxing is not available on this system\n"
f"Re-run 'vars generate' with '--no-sandbox' to disable sandboxing"
)
raise ClanError(msg)
cmd = ["bash", "-c", str(final_script)] cmd = ["bash", "-c", str(final_script)]
run(cmd, RunOpts(env=env)) run(cmd, RunOpts(env=env))
files_to_commit = [] files_to_commit = []