Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Library/Homebrew/extend/os/linux/sandbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def self.bubblewrap_executable

sig { returns(::Pathname) }
def self.bubblewrap_executable!
bubblewrap_executable || raise("Bubblewrap is required to use the Linux sandbox.")
bubblewrap_executable || raise(
"Bubblewrap is required to use the Linux sandbox. " \
"Try installing it with `brew install bubblewrap`.",
Comment on lines +82 to +83

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's dry this up to avoid duplicating this naming.

brew install bubblewrap should never actually fix this. If it does, something in our logic is incorrect as we try to auto-install it.

We could tell people to e.g. apt-get install bubblewrap if our version doesn't work.

Can you verify this is after #22669 was merged into a release? If not, that may have fixed this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems that doesn't fix it Homebrew/discussions#6893 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @SMillerDev. This seems to be a regression. Can you take a look @Bo98?

@Bo98 Bo98 Jun 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like it happens in both 6.0.0 and 6.0.1 so not a regression in 6.0.1. The issue also seems to be specific to --build-from-source.

It's almost certainly this:

def fatal_build_from_source_checks
(super + %w[
check_linux_sandbox
]).freeze
end

That check runs before we automatically install it. Given we install it automatically, we don't need fatal_build_from_source_checks to check if it's installed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Bo98 thanks good catch!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

)
end

sig { void }
Expand Down Expand Up @@ -141,7 +144,10 @@ def bubblewrap_executable

sig { returns(::Pathname) }
def bubblewrap_executable!
bubblewrap_executable || raise("Bubblewrap is required to use the Linux sandbox.")
bubblewrap_executable || raise(
"Bubblewrap is required to use the Linux sandbox. " \
"Try installing it with `brew install bubblewrap`.",
)
end

sig { params(install_from_tests: T::Boolean).void }
Expand Down Expand Up @@ -239,7 +245,8 @@ def failure_reason
when :disabled, :available
nil
when :missing
"Bubblewrap is required to use the Linux sandbox but was not found."
"Bubblewrap is required to use the Linux sandbox but was not found. " \
"Try installing it with `brew install bubblewrap`."
when :setuid
"A rootless Bubblewrap executable is required to use the Linux sandbox, " \
"but all found `bwrap` executables are setuid."
Expand Down
Loading