Fix to not link keg_only if it doesn't installed by request#22119
Fix to not link keg_only if it doesn't installed by request#22119MikeMcQuaid merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes FormulaInstaller so versioned keg-only formulae are only auto-linked, and only emit the manual-link warning, when they were installed on request. That aligns linking behavior with Homebrew's installed-on-request semantics for top-level installs versus dependency installs.
Changes:
- Add an
installed_on_request?guard toauto_link_versioned_keg_only?. - Add the same guard to
link_manual_command_warning. - Update
formula_installer_spec.rbto cover the new default non-linking behavior for non-request installs and to keep the manual warning test on the request-install path.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Library/Homebrew/formula_installer.rb |
Gates versioned keg-only auto-linking and manual-link warnings on installed_on_request?. |
Library/Homebrew/test/formula_installer_spec.rb |
Adjusts installer specs for the new request-install behavior and updates one warning-path test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
One of docker step failed but it isn't related to the source changes. |
|
This change is still not resolving the case that During This is very unique case and not sure how to resolve. |
brew lgtm(style, typechecking and tests) with your changes locally?From recent changes,
installed_as_dependencyvalue defaults tofalseand it is now changed to the reverse ofinstalled_on_request. However, it's default value is alsofalseand the test behavior is changed. I think the auto link guard should be kept and test should be fixed.