Fix cask installation conflicts with same-named formula binaries#20417
Fix cask installation conflicts with same-named formula binaries#20417MikeMcQuaid merged 1 commit intomainfrom
Conversation
brew install --cask docker fails after having done brew install docker|
@copilot address the review comments I've left inline on this PR |
|
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:
|
MikeMcQuaid
left a comment
There was a problem hiding this comment.
@copilot please address these changes and edit the .github/copilot-instructions.md file based on my feedback e.g. no typed: strict needed for tests.
I've addressed all the feedback by removing |
While we're at it, update copilot instructions. Co-authored-by: MikeMcQuaid <[email protected]>
793ca7d to
cbe3477
Compare
When installing a cask after a formula with the same name (e.g.,
brew install dockerfollowed bybrew install --cask docker), the cask installation would fail with errors like:This occurred because both the formula and cask tried to install files to the same locations (binaries, completion files), and the cask installer would fail when it encountered existing symlinks.
This PR adds intelligent conflict detection to the cask artifact installation process. When a cask tries to install a binary or completion file that already exists as a symlink from a formula with the same name:
Example output after the fix:
The solution allows both formula CLI tools and cask GUI applications to coexist, resolving a common user workflow issue while maintaining backward compatibility for all other cases.
Fixes #16309.
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.6.0-61-gd85c5c9 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --progress-bar --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=typecheck,ci=true,devcmdrun=true,developer=false options="" 1754916917 --silent --output /dev/null REDACTED(dns block)/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.6.0-61-gd85c5c9 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --progress-bar --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=typecheck,ci=true,devcmdrun=true,developer=false options="" 1754917362 --silent --output /dev/null REDACTED(dns block)/bin/curl --disable --cookie /dev/null --globoff --user-agent Linuxbrew/4.6.0-61-gd85c5c9 (Linux; x86_64 Ubuntu 24.04.2 LTS) curl/8.5.0 --header Accept-Language: en --fail --progress-bar --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=typecheck,ci=true,devcmdrun=true,developer=false options="" 1754917376 --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:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.