untap: require CaskLoader - #23614
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?While trying to remove
kegworks-app/kegworks, I found thatbrew untapfails when the tap has an installed cask.Reproduction
On the current
mainbranch:The final command fails with:
From what I can tell,
installed_casks_forcallsCask::CaskLoader.load(...)while checking installed casks, but does not loadcask/cask_loaderbefore using it.This change loads
cask/cask_loaderinsideinstalled_casks_for, whereCask::CaskLoaderis used, and updates the existinguntapintegration test. The test now installs a cask from the test tap and usesbrew untap --forcein a fresh process to exercise the same installed-cask path without requiring interactive confirmation.This may be related to the recent Cask lazy-loading changes in #23560. Similar
Cask::CaskLoaderloading regressions were addressed in #23566 and #23587.Testing
I verified the regression with a red/green test cycle:
require "cask/cask_loader", the integration test fails withuninitialized constant Cask::CaskLoader;I also ran:
Both completed successfully.
AI/LLM disclosure
ChatGPT (GPT-5.6 Sol) was used to assist with investigating the failure, reviewing related Homebrew changes, understanding the contribution process, and developing the regression test. I reviewed the code and prose myself and reproduced and tested the changes locally.