Skip to content

cask/installer: remove migration symlinks on uninstall #20174

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

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

EricFromCanada
Copy link
Member

Fixes #19951 by ensuring @cask.tap is set during uninstall, allowing @cask.old_tokens to be populated. Thanks to @tyuwags for the hints. Replaces #20168. Works for both from-tap and from-API installations.

To test from tap:

cd `brew --repo homebrew/cask`
git checkout 6b1f70c
brew install --cask ares
git checkout master
brew migrate --cask ares-emulator
brew uninstall --cask ares-emulator

Both ares-emulator folder and ares symlink will now be removed.

To test from API:

HOMEBREW_NO_INSTALL_FROM_API= brew install --cask angband-app
# in Caskroom, change to old name: folder, JSON filename in `.metadata`, JSON contents in 2 places
brew migrate --cask angband-app
brew uninstall --cask angband-app

@EricFromCanada EricFromCanada added cask Homebrew Cask help wanted We want help addressing this labels Jun 25, 2025
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @EricFromCanada! Test failure seems legit but good to merge once resolved.

@EricFromCanada
Copy link
Member Author

Anyone have hints on how to fix the test?

@MikeMcQuaid
Copy link
Member

@EricFromCanada Maybe needs a file written to disk? Might be worth seeing how old the test is.

@EricFromCanada EricFromCanada force-pushed the remove-migrated-symlinks branch from 2a40d3c to 29122c0 Compare June 26, 2025 14:38
@EricFromCanada EricFromCanada removed help wanted We want help addressing this labels Jun 26, 2025
@MikeMcQuaid MikeMcQuaid enabled auto-merge June 26, 2025 14:40
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 26, 2025
Merged via the queue into main with commit 4fd7c6f Jun 26, 2025
33 checks passed
@MikeMcQuaid MikeMcQuaid deleted the remove-migrated-symlinks branch June 26, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cask Homebrew Cask
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlinks from old cask tokens are not removed during uninstallation
2 participants