{"record":{"id":"8b54f85e3295aa77","repo":"abhigyanpatwari/GitNexus","slug":"bubblewrap-containment-is-supported-only-on-linux","errorCode":null,"errorMessage":"Bubblewrap containment is supported only on Linux/WSL2, not {sys.platform}","messagePattern":"Bubblewrap containment is supported only on Linux/WSL2, not (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/proposer_sandbox.py","lineNumber":478,"sourceCode":"    wrapper.chmod(0o500)\n    return wrapper\n\n\ndef _resolve_executable(executable: Path | str | None, default: str) -> Path:\n    raw = os.fspath(executable) if executable is not None else shutil.which(default)\n    if not raw:\n        raise SandboxError(f\"required executable is unavailable: {default}\")\n    path = Path(raw).expanduser().resolve()\n    if not path.is_file() or not os.access(path, os.X_OK):\n        raise SandboxError(f\"required executable is not an executable regular file: {path}\")\n    return path\n\n\ndef preflight_bubblewrap(bwrap_bin: Path | str | None = None) -> Path:\n    \"\"\"Prove the required namespaces work; never fall back to host execution.\"\"\"\n\n    if sys.platform != \"linux\":\n        raise SandboxError(f\"Bubblewrap containment is supported only on Linux/WSL2, not {sys.platform}\")\n    bwrap = _resolve_executable(bwrap_bin, \"bwrap\")\n    command = [\n        str(bwrap),\n        \"--unshare-user\",\n        \"--unshare-pid\",\n        \"--unshare-ipc\",\n        \"--unshare-uts\",\n        \"--die-with-parent\",\n        \"--new-session\",\n        *_runtime_mount_args(),\n        \"--proc\",\n        \"/proc\",\n        \"--dev\",\n        \"/dev\",\n        \"--\",\n        \"/usr/bin/true\",\n    ]\n    result = run_managed(command, timeout=10, require_pid_namespace=True)","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/proposer_sandbox.py#L460-L496","documentation":"Raised by preflight_bubblewrap when sys.platform is not 'linux'. Bubblewrap (bwrap) uses Linux user/mount/pid namespaces that exist only on Linux (and WSL2, which reports as linux), so on macOS, Windows-native, or other platforms the preflight refuses to continue rather than fall back to host execution.","triggerScenarios":"Importing and calling preflight_bubblewrap (or any code path that reaches it) on a platform where sys.platform != 'linux' — e.g. darwin (macOS), win32, cygwin, aix, freebsd.","commonSituations":"Developer runs the eval harness on a macOS workstation instead of the Linux CI; a cross-platform test suite imports the sandbox module on Windows; a CI matrix accidentally includes a macos-latest job that hits this code path; a container reports a non-linux platform due to a broken image.","solutions":["Run the workflow_bench/proposer pipeline on a Linux host or Linux container (the supported environment).","On Windows, use WSL2 (which reports sys.platform as 'linux') and run from inside it.","Gate the call behind a platform check in your own code so non-Linux dev workloads skip containment.","For local dev that does not need real containment, exercise a non-bwrap code path if one exists, or move to Linux."],"exampleFix":"// before\nbwrap = preflight_bubblewrap()  # on macOS\n// after\nif sys.platform != 'linux':\n    raise SystemExit('run this benchmark under Linux or WSL2')\nbwrap = preflight_bubblewrap()","handlingStrategy":"validation","validationCode":"import sys\n\ndef assert_linux():\n    if sys.platform != 'linux':\n        raise SystemExit(f'workflow_bench requires Linux/WSL2, not {sys.platform}')\n\nassert_linux()","typeGuard":"import sys\n\ndef supports_bubblewrap() -> bool:\n    return sys.platform == 'linux'","tryCatchPattern":"try:\n    bwrap = preflight_bubblewrap()\nexcept SandboxError as exc:\n    if 'supported only on Linux' in str(exc):\n        raise SystemExit('switch to a Linux host or WSL2 to run this benchmark')\n    raise","preventionTips":["Run the eval pipeline only on Linux/WSL2.","Gate platform-dependent calls behind sys.platform checks.","Document platform requirements in setup.","Use a Linux CI image for workflow_bench."],"tags":["platform","environment","sandbox","bubblewrap"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}