-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Improve error message for tap conflicts in brew install #20304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
brew install
refuses to install a formula from a tap with the same name as an already installed keg
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you're using brew typecheck
and brew style --fix
and fixing the errors. The CI syntax job is failing which it shouldn't be if you're doing this. Please also test the example scenario in the existing issue and report back in a comment if it's now working as expected:
$ brew install homebrew/core/postgresql@16
$ brew install mercurytechnologies/tap/postgresql@16
Warning: mercurytechnologies/tap/postgresql@16 16.3 is already installed.
The installed formula is from the homebrew/core tap, but you are trying to install from the mercurytechnologies/tap tap.
Formulae with the same name from different taps cannot be installed at the same time.
To install this version, you must first uninstall the existing formula:
brew uninstall postgresql@16
Then you can install the desired version:
brew install mercurytechnologies/tap/postgresql@16
Fixed all the syntax and style issues - both ✅ Tap conflict scenario: When installing ✅ No false positives: When both formulae are from the same tap, no conflict is detected and the original "just not linked" message would be shown. The implementation correctly follows the code review suggestions and handles the example scenario as expected. (6957599) Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach seems fine, but overly focused on the case where the currently-installed formula is either not linked or is keg-only. (Which is admittedly what the original issue was largely about.)
More generally, it would be good to check that we get useful behaviour and error messages when trying to install a formula from an external tap when an existing formula with the same name that is both linked and not keg-only is already installed.
You're absolutely right! I've extended the tap conflict detection beyond just unlinked/keg-only scenarios. The logic now properly handles the case where a linked, non-keg-only formula from an external tap is trying to be installed when an existing formula with the same name from a different tap is already installed. The tap conflict detection is now applied first, regardless of link status or keg-only status, ensuring users get the helpful tap conflict error message in all scenarios. (252c9fd) Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
252c9fd
to
4e0be5e
Compare
Co-authored-by: MikeMcQuaid <[email protected]> Co-authored-by: carlocab <[email protected]>
4e0be5e
to
ebb7168
Compare
When trying to install a formula from a different tap with the same name as an already installed formula,
brew install
would show a misleading warning message:This is confusing because the issue isn't that the formula is "just not linked" - it's that formulae with the same name from different taps cannot coexist in the same installation prefix.
Example scenario:
The fix detects when there's a tap conflict and provides a clear, actionable error message:
Technical details:
install_formula?
method to compare the tap of the installed formula (fromkeg.tab.tap
) with the tap of the formula being installednil
tap by treating them as "homebrew/core"Fixes #17941.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
eu-central-1-1.aws.cloud2.influxdata.com
/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.5.12-7-g3ec6f00 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --retry 3 --max-time 3 --header Authorization: Token iVdsgJ_OjvTYGAA79gOfWlA_fX0QCuj4eYUNdb-qVUTrC3tp3JTWCADVNE9HxV0kp2ZjIK9tuthy_teX4szr9A== --header Content-Type: text/plain; charset=utf-8 --header Accept: application/json --data-binary command_run,command=tests,ci=true,devcmdrun=true,developer=false options="--only= --verbose" 1753369534 --silent --output /dev/null REDACTED
(dns block)/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.5.12-7-g3ec6f00 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --retry 3 --max-time 3 --header Authorization: Token iVdsgJ_OjvTYGAA79gOfWlA_fX0QCuj4eYUNdb-qVUTrC3tp3JTWCADVNE9HxV0kp2ZjIK9tuthy_teX4szr9A== --header Content-Type: text/plain; charset=utf-8 --header Accept: application/json --data-binary command_run,command=tests,ci=true,devcmdrun=true,developer=false options="--only= --verbose" 1753369736 --silent --output /dev/null REDACTED
(dns block)/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.5.12-7-g3ec6f00 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --silent --retry 3 --max-time 3 --header Authorization: Token iVdsgJ_OjvTYGAA79gOfWlA_fX0QCuj4eYUNdb-qVUTrC3tp3JTWCADVNE9HxV0kp2ZjIK9tuthy_teX4szr9A== --header Content-Type: text/plain; charset=utf-8 --header Accept: application/json --data-binary command_run,command=tests,ci=true,devcmdrun=true,developer=false options="--only= --verbose" 1753369780 --silent --output /dev/null REDACTED
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.