Enable formula-to-cask migrations within the same tap#20800
Conversation
Co-authored-by: MikeMcQuaid <[email protected]>
441aa63 to
48f7d56
Compare
|
Does this still work if the formula and tap have the same name? That's the most common scenario I've seen with Goreleaser. I guess you'd have to try something like this in {
"myapp": "myapp"
} |
|
@gibfahn not sure, try it and see. if it doesn't work and you need that: shout. |
|
@MikeMcQuaid: Per your last comment, I've got a test tap repo where I'm trying to get this working, so I'd like to take you up on your "shout" offer and maybe it will help others. BackgroundTap repo is https://github.com/philrz/homebrew-tap. I've got an old Formula AttemptAfter getting the old Formula installed on a fresh scratch host by doing Now on my scratch host I do: And a subsequent Can you spot something I did wrong, or offer ideas for debug? Thanks! |
|
@philrz thanks for the reproduction, will take a look when I get a chance. |
|
@philrz I think you need to delete the formula and just leave the cask for migrations to work. From your description I'm not sure whether you did that... |
|
@gibfahn: Thanks for the tip. It's true that I was previously not deleting the old Formula. But I just tested it out (specifically, now I removed the old |
Yeh, this is currently the case. Otherwise we don't want know whether you want to migrate from formula-to-cask or cask-to-formula.
@philrz Could you share the specific tap and ideally specific commits that I can use to test this? |
|
@MikeMcQuaid: Sure, thanks again for being willing to give this a look. The tap is at https://github.com/philrz/homebrew-tap. Right now at commit |
|
Hi again @MikeMcQuaid! Thanks for the help thus far. I noticed that Homebrew 4.6.19 was released and it includes those fixes, so I just tested it out. Indeed, I no longer see those errors, but I still can't seem to get the migration to work as envisioned here and using the migration config described here. I've left my test repo in a similar state as described in my last comment, though the commit hash at tip of
Instead of the migration I saw the following output: Would appreciate if you have any ideas for other things to try in the migrations file or if there's maybe more issues lurking in here. Thanks again! |
|
just noting that I'm having the same issue as @philrz in both these commits: when I try to upgrade, I get this: $ HOMEBREW_AUTO_UPDATE_SECS=1 brew upgrade
Error: No available formula with the name "caarlos0/tap/svu". Did you mean caarlos0/tap/gssh or caarlos0/tap/tt? |
|
@MikeMcQuaid gently ping :) |
|
@caarlos0 Still on my list, still snowed under, sorry :) |
|
if someone can open a new issue with reproduction steps that would help get it more visibility |
|
@MikeMcQuaid: Per your suggestion I just opened new issue #21207 that contains repro steps. |
Resolves the issue where tap maintainers could not migrate formulae to casks within their own tap using
tap_migrations.json.Problem
Previously,
tap_migrations.jsononly supported formula-to-cask migrations when the target was thehomebrew/casktap. This prevented third-party tap maintainers from migrating their formulae to casks when switching from building from source to distributing precompiled binaries.For example, GoReleaser maintainers wanted to migrate users from their formula to a cask within the same
goreleaser/tap, but there was no way to automatically handle this migration duringbrew update.Solution
Extended the migration detection logic in
migrate_tap_migrationto check if the migration target is a cask by examining the target tap'scask_tokens, in addition to checking if the migration is tohomebrew/cask.Usage
Tap maintainers can now add migrations like this to their
tap_migrations.json:{ "old-formula": "user/tap/new-cask" }When users run
brew update, the system will:Benefits
Testing
Original prompt
💡 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.