Skip to content

Add support for linking/unlinking apps #496

Open

Description

@dsXLII

Suggestion type

The way Cork works

What is your idea about?

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 :)

Keeping it real

  • Adding suggestion idea is realistic

Activity

  1. buresdv commented on Sep 2, 2025

    @buresdv
    Owner

    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 😅

  2. dsXLII commented on Sep 4, 2025

    @dsXLII
    Author

    Really, all I'm doing is

    function relink-php() {
      brew unlink php
      brew link php@${1}
    }
    

    So nothing especially helpful, from your point of view, sorry.

  3. buresdv commented on Sep 4, 2025

    @buresdv
    Owner

    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

  4. dsXLII commented on Sep 4, 2025

    @dsXLII
    Author

    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:

    Image

    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.

  5. buresdv commented on Sep 8, 2025

    @buresdv
    Owner

    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…

  6. moved this from Ideas to In Progress in Cork Project Boardon Sep 8, 2025
  7. kutlu0 commented on Nov 10, 2025

    @kutlu0
  8. modified the milestones: v1.7.2, v1.7.3 on Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions