Revert "Revert "Link versioned keg-only formulae by default""#21684
Revert "Revert "Link versioned keg-only formulae by default""#21684MikeMcQuaid merged 2 commits intomainfrom
Conversation
3c6f6c0 to
fbe324e
Compare
|
Pushed fbe324e which restores the two-state |
There was a problem hiding this comment.
Pull request overview
This PR re-introduces (after a revert) default-linking behavior for certain keg-only sibling formula variants (notably @-versioned and -full), along with the supporting “sibling overwrite” discovery/unlinking logic and updated user-facing output/caveats behavior.
Changes:
- Add
FormulaAPIs to discover “link overwrite” sibling relationships (versioned/unversioned and full/non-full) and generate reasons/warnings when linking is suppressed. - Update linking/unlinking flows to unlink sibling formulae before linking and to auto-link eligible versioned keg-only formulae by default.
- Expand test coverage across
Formula,Tap,FormulaInstaller,brew link,Caveats, andUnlink.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/unlink.rb | Renames/repurposes helper to unlink link-overwrite sibling formulae prior to linking. |
| Library/Homebrew/test/unlink_spec.rb | Adds unit coverage for the new unlink helper behavior. |
| Library/Homebrew/test/tap_spec.rb | Adds coverage for Tap#prefix_to_versioned_formulae_names grouping with -full variants. |
| Library/Homebrew/test/formula_spec.rb | Adds coverage for new Formula sibling discovery APIs and behaviors. |
| Library/Homebrew/test/formula_installer_spec.rb | Adds coverage for default linking behavior (including versioned keg-only auto-link decisions and warnings). |
| Library/Homebrew/test/cmd/link_spec.rb | Ensures brew link doesn’t emit keg-only messaging for @-versioned / -full versioned keg-only formulae. |
| Library/Homebrew/test/caveats_spec.rb | Verifies keg-only caveats are omitted when the formula is already linked. |
| Library/Homebrew/tap.rb | Updates versioned-name prefix grouping to correctly account for -full variants. |
| Library/Homebrew/install.rb | Adjusts link instructions to use full_name in the printed command. |
| Library/Homebrew/formula_installer.rb | Implements auto-link defaulting for eligible versioned keg-only formulae and adds a manual-link warning. |
| Library/Homebrew/formula.rb | Adds sibling relationship logic (unversioned_formula_name, full siblings, link-overwrite sets/reasons) and refines versioned name lookup. |
| Library/Homebrew/cmd/link.rb | Avoids requiring --force and avoids printing keg-only output for versioned keg-only formulae; unlinks siblings before linking. |
| Library/Homebrew/caveats.rb | Suppresses keg-only caveat text when the formula is linked. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
There is a new CI error when testing versioned Node formulae - https://github.com/Homebrew/homebrew-core/actions/runs/22808128923/job/66161379475?pr=271139#step:3:708 This is an odd case where Reproduction should be possible with brew install node
brew uninstall node
brew install node@22Maybe |
|
@cho-m Thanks taking a look. |
|
There might be another fallout from this change (relating to simultaneously installing Qt5 and Qt6). See: Is there something we can do about that? |
|
Copying the content of the comment on the other PR to here: The CI for Octave started to fail with the following error more or less recently: We didn't see these file conflicts until recently. E.g., the successful build here: The Qt6 packages are pulled in because we are installing Are these file (or symlink?) conflicts expected? |
Somewhat. It's debatable whether or not we should automatically overwrite links in this case. What do you think? |
I'm not sure. I only noticed that the workflow started to fail without an apparent change on Octave's side. Edit: I went ahead with that to unblock the CI of Octave on macOS: |
|
I don't know if this is also related. But the CI workflow for ElmerFEM using Homebrew packages also started failing with no apparent change in the build rules or sources last Wednesday (March 18, 2026). Compared to the last successful run (the day before), CMake seems to be picking a different compiler now. (Not sure if that is the reason for the failing builds though.) Last successful run: First failing run: Note that the last successful build picked the compilers from The build eventually fails with errors like the following: Edit: It started to build successfully again without any changes to the workflow. |
The Homebrew packages for Qt5 and Qt6 started to conflict with each other. See: Homebrew/brew#21684 This is affecting the CI rules of Octave because the Homebrew package for gnuplot depends on Qt6 while we try to test building Octave with Qt5. Work around these conflicts by force installing Qt5 from Homebrew after installing all other dependencies from Homebrew. That overrides the files for which there would otherwise be a conflict. * .github/workflows/make-macos.yaml (install dependencies): Force install Qt packages after other dependencies.
|
See also actions/runner-images#13827 for more fallout caused by this change in GitHub CI workflows of multiple projects. |
I will investigate/consider making this automatic.
Homebrew changing behaviour here is due to (many) user requests over many years. We announced in the release notes that we would be linking in these cases. End-users will have to adjust their e.g. CMake and/or Homebrew configuration accordingly. |
|
Thank you for looking into this and for the clarifications.
What exactly would an end-user need to do to be able to use the system compilers (and the corresponding headers and libraries) with CMake after these changes? |
I'm not a CMake expert any more but: however you would usually configure a tool or compiler in CMake: adjust your |
Take 2 of #21676
Reverts #21682
Will fix the issues before merge.