Skip to content

Skip unavailable sandbox sysctls#23015

Merged
MikeMcQuaid merged 1 commit into
mainfrom
setup-sandbox-sysctl-skip
Jul 9, 2026
Merged

Skip unavailable sandbox sysctls#23015
MikeMcQuaid merged 1 commit into
mainfrom
setup-sandbox-sysctl-skip

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • 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 errors visible while treating writes as best effort.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.5 xhigh with local tweaking and review.


Copilot AI review requested due to automatic review settings July 8, 2026 19:19
@MikeMcQuaid MikeMcQuaid enabled auto-merge July 8, 2026 19:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 calling sysctl -n to 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.

Comment thread Library/Homebrew/test/cmd/setup-sandbox_spec.rb Outdated
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 8, 2026
@MikeMcQuaid MikeMcQuaid removed this pull request from the merge queue due to a manual request Jul 8, 2026
- 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.
@MikeMcQuaid MikeMcQuaid force-pushed the setup-sandbox-sysctl-skip branch from 2d60eda to 756be71 Compare July 9, 2026 07:04
@MikeMcQuaid MikeMcQuaid enabled auto-merge July 9, 2026 07:25
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 9, 2026
Merged via the queue into main with commit 6b007f4 Jul 9, 2026
41 checks passed
@MikeMcQuaid MikeMcQuaid deleted the setup-sandbox-sysctl-skip branch July 9, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants