You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like Cork to support brew link and brew unlink commands. These are a bit niche, so the UI might need to be thought through carefully.
Why should this be added?
I work somewhat regularly with a few versioned formulae, most notably php, and have to switch between different versions for compatibility testing. (Also, brew update tends to re-link the latest version when there are updates.) At least once or twice a day, I have to brew unlink php then brew link php@8.2 (or whatever other version).
I've actually automated this with CLI aliases, but that's beside the point :)
I'm thinking of adding this in the next release, would you be willing to share how your CLI aliases work? Because I don't understand the Homebrew documentation 😅
Thanks, I'm more interested in what linking does conceptually, and what problems it helps solve for you. I've never linked anything, and the documentation is very confusing on this matter
I have multiple versions of PHP installed, because the PHP ecosystem is messy. So I did a brew install php@8.1; brew install php@8.2; brew install php@8.3; brew install php@8.4. Boom, now I have four different versions of PHP, in different directories under /opt/homebrew/Cellar .
If you want to test something with a different version, you can do a brew unlink php (to remove the symlinks from the current version), then a brew link php@8.2, to recreate those symlinks but now pointing to an older version. Adding a -v to either of those commands lists the ~25 symlinks it's creating and removing every time I switch versions of PHP.
Of course all the individual versions are available under /opt/homebrew/Cellar, but that's a long complicated path that changes periodically, when there's a new maintenance release (8.3.24 to 8.3.25, etc). Being able to just use "php" is a great convenience, and is what most apps expect anyway.
For me, the biggest annoyance is when there's an update to the current version (8.4.11 to 8.4.12), the CLI will "helpfully" automatically link this newest version. Last week there were updates to both PHP 8.3.x and PHP 8.4.x, and when I did a brew update, even though I was at that time using PHP 8.2, the update switched the default PHP to 8.4. (That may be a limitation of Homebrew, honestly not sure.)
In Cork, the GUI actually shows all four versions as separate packages:
I think my ideal would be for that to just say 'php', with an accordion maybe to show the multiple different versions, and a context menu to switch between them.
Thank you very much for the detailed response, I want to write my own implementation of the linking system for Cork, because the built-in one is just way too slow.
Do I understand it right that the links go to /opt/homebrew/opt, and that, while you can have any package in /opt/homebrew/Cellar, it needs to be linked by creating a symlink to it inside /opt/homebrew/opt?
It's okay if you don't know, I'm just asking because you use manual linking, and Homebrew developers are hostile to me, so I can't ask them…
Activity
buresdv commentedon Sep 2, 2025
I'm thinking of adding this in the next release, would you be willing to share how your CLI aliases work? Because I don't understand the Homebrew documentation 😅
dsXLII commentedon Sep 4, 2025
Really, all I'm doing is
So nothing especially helpful, from your point of view, sorry.
buresdv commentedon Sep 4, 2025
Thanks, I'm more interested in what linking does conceptually, and what problems it helps solve for you. I've never linked anything, and the documentation is very confusing on this matter
dsXLII commentedon Sep 4, 2025
I have multiple versions of PHP installed, because the PHP ecosystem is messy. So I did a
brew install php@8.1; brew install php@8.2; brew install php@8.3; brew install php@8.4. Boom, now I have four different versions of PHP, in different directories under /opt/homebrew/Cellar .If you want to test something with a different version, you can do a
brew unlink php(to remove the symlinks from the current version), then abrew link php@8.2, to recreate those symlinks but now pointing to an older version. Adding a-vto either of those commands lists the ~25 symlinks it's creating and removing every time I switch versions of PHP.Of course all the individual versions are available under /opt/homebrew/Cellar, but that's a long complicated path that changes periodically, when there's a new maintenance release (8.3.24 to 8.3.25, etc). Being able to just use "php" is a great convenience, and is what most apps expect anyway.
For me, the biggest annoyance is when there's an update to the current version (8.4.11 to 8.4.12), the CLI will "helpfully" automatically link this newest version. Last week there were updates to both PHP 8.3.x and PHP 8.4.x, and when I did a
brew update, even though I was at that time using PHP 8.2, the update switched the default PHP to 8.4. (That may be a limitation of Homebrew, honestly not sure.)In Cork, the GUI actually shows all four versions as separate packages:
I think my ideal would be for that to just say 'php', with an accordion maybe to show the multiple different versions, and a context menu to switch between them.
buresdv commentedon Sep 8, 2025
Thank you very much for the detailed response, I want to write my own implementation of the linking system for Cork, because the built-in one is just way too slow.
Do I understand it right that the links go to
/opt/homebrew/opt, and that, while you can have any package in/opt/homebrew/Cellar, it needs to be linked by creating a symlink to it inside/opt/homebrew/opt?It's okay if you don't know, I'm just asking because you use manual linking, and Homebrew developers are hostile to me, so I can't ask them…
kutlu0 commentedon Nov 10, 2025
buresdv/Spirytus#1