Skip unavailable sandbox sysctls#23015
Merged
Merged
Conversation
Bo98
approved these changes
Jul 8, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request makes Homebrew’s Linux sandbox setup more resilient by avoiding sysctl reads/writes for sysctl keys that are not present under /proc/sys, and by treating sysctl writes as best-effort while still surfacing any write errors.
Changes:
- Check for
/proc/sys/...presence before callingsysctl -nto avoid failures on kernels missing specific keys. - Skip sysctl writes when the corresponding
/proc/sys/...file is not writable (e.g., read-only proc mounts). - Add RSpec coverage for missing/read-only proc sysctl behavior and for preserving sysctl write error output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/cmd/setup-sandbox.sh | Guard sysctl reads/writes with /proc/sys existence and writability checks; make writes best-effort while keeping stderr visible. |
| Library/Homebrew/test/cmd/setup-sandbox_spec.rb | Add test scaffolding to simulate /proc/sys and new specs for missing/read-only sysctl behavior and write-error visibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Check `/proc/sys` entries before calling `sysctl` so kernels that omit keys do not block the Bubblewrap probe. - Skip unwritable proc sysctl files, including read-only mounts. - Keep attempted `sysctl` writes best effort and surface failed `bwrap` probe output for debugging.
2d60eda to
756be71
Compare
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.
/proc/sysentries before callingsysctlso kernels that omit keys do not block the Bubblewrap probe.sysctlerrors visible while treating writes as best effort.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?OpenAI Codex 5.5 xhigh with local tweaking and review.