Clarify Linux build tools installation instructions#22925
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR clarifies Linux-facing guidance around missing build tools by distinguishing between the required system C toolchain and Homebrew’s optional gcc formula, aligning brew doctor/diagnostic output and docs with the actual bootstrap/post-install expectations on Linux.
Changes:
- Override Linux
DevelopmentTools.installation_instructionsto direct users to install system development tools and link to the Linux requirements docs. - Override Linux
DevelopmentTools.custom_installation_instructionsto keepCompilerSelectionErrorguidance pointing tobrew install gcc. - Update Linux documentation and add/adjust specs to cover the new messaging.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/test/os/linux/diagnostic_spec.rb | Adds Linux-specific specs asserting the new developer-tools messaging and custom_installation_instructions content. |
| Library/Homebrew/test/diagnostic_checks_spec.rb | Adds a unit spec ensuring diagnostics use DevelopmentTools.installation_instructions. |
| Library/Homebrew/extend/os/linux/development_tools.rb | Implements Linux overrides for installation guidance (system toolchain vs. brew install gcc). |
| docs/Homebrew-on-Linux.md | Updates review date and documents that Homebrew requires a working system C compiler on Linux. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8 tasks
Signed-off-by: Patrick Linnane <patrick@linnane.io>
9cb0cf4 to
6ce48d4
Compare
abitrolly
reviewed
Jul 2, 2026
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.
On Linux,
brew doctorand the missing-build-tools errors previously advised users to "Install Clang or runbrew install gcc". That guidance is misleading here: a Homebrew-installedgccdoes not provide the system/usr/bin/cctoolchain that bootstrap and post-install steps rely on (for example,brew postinstall gccshells out to/usr/bin/cc -print-file-name=crti.owhen building against the system glibc, which fails until a system compiler is installed). This overrides the LinuxDevelopmentTools.installation_instructionsto point at the system C compiler and the standard development tools, with a link to the requirements docs.CompilerSelectionErrorstill recommendsbrew install gccvia a Linuxcustom_installation_instructionsoverride, mirroring the existing macOS split: the system toolchain for "no developer tools installed", andbrew install gccwhen a formula fails with every available compiler.The Requirements section of the Linux docs now notes that Homebrew expects a working system C compiler and that its own
gccdoes not replace it for bootstrap and post-install steps.This follows https://github.com/orgs/Homebrew/discussions/6940 and supersedes #22921.
Note:
check_for_installed_developer_toolsonly fires when no compiler is detected at all, so it does not trigger for the specific case in the discussion where a Homebrewgccis present but/usr/bin/ccis absent. This PR improves the guidance and documentation rather than adding a new detector for that case.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code drafted the code, tests and docs from my design and iterated on my review; I reviewed every change and verified locally with
brew typecheck,brew styleandbrew lgtm(the Linux-only specs run in CI).