brew icon indicating copy to clipboard operation
brew copied to clipboard

`brew migrate` doesn't recognise migrations to API taps

Open Logicer16 opened this issue 3 months ago • 3 comments

brew doctor output

Your system is ready to brew

Verification

  • [X] My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • [X] I ran brew update twice and am still able to reproduce my issue.
  • [X] This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.2.20
ORIGIN: https://github.com/Homebrew/brew
HEAD: c2ed3327c605c3e738359c9807b8f4cd6fec09eb
Last commit: 7 days ago
Core tap JSON: 06 May 11:54 UTC
Core cask tap JSON: 06 May 11:54 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_AUTO_UPDATE_SECS: 300
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: /usr/bin/env nvim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: octa-core 64-bit arm_ibiza
Clang: 15.0.0 build 1500
Git: 2.45.0 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.3
Rosetta 2: false

What were you trying to do (and why)?

Migrate casks from Homebrew/cask-versions with the brew migrate command.

What happened (include all command output)?

% brew migrate google-chrome-canary

% # ^ No output

Using a local tap rather than the API causes the migration to complete successfully.

This seems to be a result of:

  • FromAPILoader failing as the old name isn't present in homebrew/core/homebrew/cask
  • FromNameLoader failing to find the formula/cask in homebrew/core/homebrew/cask as it isn't tapped.

What did you expect to happen?

Migration to complete successfully.

Step-by-step reproduction instructions (by running brew commands)

brew migrate <old_migrated_cask/formula_name>

Logicer16 avatar May 06 '24 12:05 Logicer16

Not saying this should not be fixed but for extra debugging information here:

  • did/does brew update --force successfully migrate these?
  • why are you running brew migrate manually? What errors/messages/issues did you see?

Thanks!

MikeMcQuaid avatar May 06 '24 12:05 MikeMcQuaid

did/does brew update --force successfully migrate these?

The issue is still there.

why are you running brew migrate manually

I'm getting messages like:

% brew info google-chrome-canary
Warning: Formula homebrew/cask-versions/google-chrome-canary was renamed to homebrew/cask/google-chrome@canary

("Formula" here is probably a seperate bug)

google-chrome-canary (and other casks from cask-versions) are still installed under their old name

Any automatic migration would also fail as they use the same logic as brew migrate.

Logicer16 avatar May 06 '24 13:05 Logicer16

% brew info google-chrome-canary

Reproduced, thanks.

MikeMcQuaid avatar May 06 '24 13:05 MikeMcQuaid