Remove Bubblewrap, use Landlock for Linux sandbox - #23425
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request removes Bubblewrap-based Linux sandboxing from Homebrew and makes Landlock the sole Linux sandbox backend, eliminating the need for a separate install/configuration step and simplifying the Sandbox API and related diagnostics.
Changes:
- Delete the Bubblewrap backend and the
brew setup-sandboxcommand, removing associated docs/completions/tests and Bubblewrap-specific dependency logic. - Simplify the Linux Sandbox implementation and call sites to always use Landlock (and drop the Bubblewrap-era install/configure API surface).
- Update
brew doctorLinux sandbox messaging to report the Landlock failure reason and suggest$HOMEBREW_NO_SANDBOX_LINUXas the workaround.
Reviewed changes
Copilot reviewed 37 out of 38 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| manpages/brew.1 | Removes setup-sandbox from the manpage. |
| Library/Homebrew/test/sandbox_shared_spec.rb | Updates shared sandbox stubs for removed install/configure APIs. |
| Library/Homebrew/test/sandbox_linux_spec.rb | Removes Bubblewrap-focused specs; keeps Linux sandbox run coverage. |
| Library/Homebrew/test/sandbox_landlock_spec.rb | Removes Landlock “configure” expectations tied to deleted APIs. |
| Library/Homebrew/test/os/linux/diagnostic_spec.rb | Updates brew doctor expectations from Bubblewrap to Landlock. |
| Library/Homebrew/test/os/linux/dependency_collector_spec.rb | Removes Bubblewrap implicit-dep coverage from Linux dependency collector tests. |
| Library/Homebrew/test/github_runner_matrix_spec.rb | Updates runner matrix expectations (no longer sets Landlock opt-in env). |
| Library/Homebrew/test/formula_installer_spec.rb | Removes Bubblewrap cyclic-dependency special-casing specs; updates sandbox stubs. |
| Library/Homebrew/test/dev-cmd/tests_spec.rb | Updates test-environment checks for the simplified sandbox model. |
| Library/Homebrew/test/cmd/setup-sandbox_spec.rb | Deletes tests for removed setup-sandbox command/script. |
| Library/Homebrew/test/cask/artifact/generated_completion_spec.rb | Updates Sandbox stubbing for removed install/configure APIs. |
| Library/Homebrew/test/bundle/installer_spec.rb | Updates implicit dependency fixture away from Bubblewrap. |
| Library/Homebrew/test/bash_spec.rb | Removes bash-level test asserting Landlock selection via env. |
| Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/setup_sandbox.rbi | Deletes RBI for removed Homebrew::Cmd::SetupSandbox. |
| Library/Homebrew/sandbox.rb | Removes Bubblewrap-era install/configure API hooks and relies on availability checks. |
| Library/Homebrew/json_api_postinstall_preflight_postflight_plan.md | Updates documentation text from Bubblewrap to Landlock. |
| Library/Homebrew/github_runner_matrix.rb | Removes Landlock opt-in env from Linux container options. |
| Library/Homebrew/formula_installer.rb | Removes Bubblewrap-specific cyclic-dependency and state-reset logic. |
| Library/Homebrew/extend/os/linux/test_bot.rb | Drops sandbox configuration step; now only checks availability. |
| Library/Homebrew/extend/os/linux/sandbox/landlock.rb | Removes Bubblewrap-era API surface/comments; keeps Landlock as backend. |
| Library/Homebrew/extend/os/linux/sandbox/bubblewrap.rb | Deletes Bubblewrap backend implementation. |
| Library/Homebrew/extend/os/linux/sandbox.rb | Removes backend-selection logic; wires Linux Sandbox directly to Landlock. |
| Library/Homebrew/extend/os/linux/formula.rb | Removes Bubblewrap implicit global dependency injection. |
| Library/Homebrew/extend/os/linux/diagnostic.rb | Simplifies Linux sandbox brew doctor finding to Landlock-focused messaging. |
| Library/Homebrew/extend/os/linux/dev-cmd/tests.rb | Simplifies Linux test-environment sandbox checks to availability-only. |
| Library/Homebrew/extend/os/linux/dependency_collector.rb | Removes Bubblewrap implicit dependency logic and related global dep-tree handling. |
| Library/Homebrew/env_config.rb | Updates sandbox env var description from Bubblewrap to Landlock. |
| Library/Homebrew/dev-cmd/test.rb | Removes explicit “ensure sandbox installed” call before testing. |
| Library/Homebrew/dependency_collector.rb | Removes Bubblewrap from implicit dependency collection. |
| Library/Homebrew/cmd/setup-sandbox.sh | Deletes the Bubblewrap/sysctl setup script. |
| Library/Homebrew/cmd/setup-sandbox.rb | Deletes the setup-sandbox Ruby command definition. |
| Library/Homebrew/cask/artifact/abstract_artifact.rb | Removes sandbox install step; relies on availability. |
| Library/Homebrew/brew.sh | Removes exporting the Landlock opt-in env var for self-hosted runners. |
| docs/Manpage.md | Removes setup-sandbox documentation. |
| completions/zsh/_brew | Removes setup-sandbox zsh completion entries. |
| completions/internal_commands_list.txt | Removes setup-sandbox from internal commands list. |
| completions/fish/brew.fish | Removes setup-sandbox fish completion entries. |
| completions/bash/brew | Removes setup-sandbox bash completion entries. |
Files not reviewed (1)
- Library/Homebrew/sorbet/rbi/dsl/homebrew/cmd/setup_sandbox.rbi: File type not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Landlock needs no separate executable, installation or `sysctl` configuration, so use it as the only Linux sandbox implementation rather than an opt-in behind `$HOMEBREW_SANDBOX_LINUX_LANDLOCK`. - Delete `Sandbox::Bubblewrap`, the `brew setup-sandbox` command and the implicit `bubblewrap` dependency, none of which Landlock needs. - Remove the Bubblewrap-era `Sandbox` API (`ensure_sandbox_installed!`, `configure!`, `configuration_commands`, `sandbox_install_command`) and its call sites now that no backend needs installing or configuring. - Simplify `brew doctor`'s `check_linux_sandbox` to report the Landlock failure reason with the `$HOMEBREW_NO_SANDBOX_LINUX` workaround.
MikeMcQuaid
force-pushed
the
landlock-default
branch
from
August 4, 2026 10:55
051c161 to
377e4f7
Compare
MikeMcQuaid
added a commit
to Homebrew/actions
that referenced
this pull request
Aug 4, 2026
- Homebrew's Linux sandbox has moved to Landlock, which needs no helper binary, kernel sysctls or `--privileged` containers. - Remove the `setup-sandbox` input whose only job was installing and configuring Bubblewrap via `brew setup-sandbox`. - Rely on Landlock as the default implementation instead of setting `HOMEBREW_SANDBOX_LINUX_LANDLOCK` in CI. Needs Homebrew/brew#23425
This was referenced Aug 4, 2026
cho-m
approved these changes
Aug 4, 2026
MikeMcQuaid
added a commit
to Homebrew/actions
that referenced
this pull request
Aug 4, 2026
- Homebrew's Linux sandbox has moved to Landlock, which needs no helper binary, kernel sysctls or `--privileged` containers. - Remove the `setup-sandbox` input whose only job was installing and configuring Bubblewrap via `brew setup-sandbox`. - Rely on Landlock as the default implementation instead of setting `HOMEBREW_SANDBOX_LINUX_LANDLOCK` in CI. - Keep `--privileged` on the stable Docker container until a release ships Landlock; a stacked pull request removes it afterwards. Needs Homebrew/brew#23425
MikeMcQuaid
added a commit
to Homebrew/actions
that referenced
this pull request
Aug 4, 2026
- Homebrew's Linux sandbox has moved to Landlock, which needs no helper binary, kernel sysctls or `--privileged` containers. - Remove the `setup-sandbox` input whose only job was installing and configuring Bubblewrap via `brew setup-sandbox`. - Rely on Landlock as the default implementation instead of setting `HOMEBREW_SANDBOX_LINUX_LANDLOCK` in CI. - Keep `--privileged` on the stable Docker container until a release ships Landlock; a stacked pull request removes it afterwards. Needs Homebrew/brew#23425
MikeMcQuaid
added a commit
to Homebrew/actions
that referenced
this pull request
Aug 4, 2026
- Stable `brew` sandboxes with Landlock now, so the container no longer needs `--privileged` for Bubblewrap's user namespaces. Needs a stable release containing Homebrew/brew#23425
MikeMcQuaid
added a commit
to Homebrew/actions
that referenced
this pull request
Aug 4, 2026
- Stable `brew` sandboxes with Landlock now, so the container no longer needs `--privileged` for Bubblewrap's user namespaces. Needs a stable release containing Homebrew/brew#23425
pull Bot
pushed a commit
to Dustin4444/install
that referenced
this pull request
Aug 4, 2026
- Homebrew's Linux sandbox will use the kernel's Landlock API by default instead of `bubblewrap` so users no longer need to install an extra package. Needs Homebrew/brew#23425
MikeMcQuaid
added a commit
to Homebrew/actions
that referenced
this pull request
Aug 9, 2026
- Stable `brew` sandboxes with Landlock now, so the container no longer needs `--privileged` for Bubblewrap's user namespaces. Needs a stable release containing Homebrew/brew#23425
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sysctlconfiguration, so use it as the only Linux sandbox implementation rather than an opt-in behind$HOMEBREW_SANDBOX_LINUX_LANDLOCK.Sandbox::Bubblewrap, thebrew setup-sandboxcommand and the implicitbubblewrapdependency, none of which Landlock needs.SandboxAPI (ensure_sandbox_installed!,configure!,configuration_commands,sandbox_install_command) and its call sites now that no backend needs installing or configuring.brew doctor'scheck_linux_sandboxto report the Landlock failure reason with the$HOMEBREW_NO_SANDBOX_LINUXworkaround.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Fable 5 max with local review and (unit) testing.