Skip to content

Ignore same-name cask migrations#22955

Merged
MikeMcQuaid merged 1 commit into
mainfrom
fix-self-migration-lock
Jul 5, 2026
Merged

Ignore same-name cask migrations#22955
MikeMcQuaid merged 1 commit into
mainfrom
fix-self-migration-lock

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Same-name cask-to-formula tap migrations are valid metadata.
  • Do not treat them as formula old names needing Cellar migration.
  • Prevent upgrade and reinstall from taking the formula lock twice.
  • Add a regression for the same-name cask-to-formula case.

Fixes #22948.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

OpenAI Codex 5.5 xhigh with local review and testing.


- Same-name cask-to-formula tap migrations are valid metadata.
- Do not treat them as formula old names needing Cellar migration.
- Prevent upgrade and reinstall from taking the formula lock twice.
- Add a regression for the same-name cask-to-formula case.
- Fixes #22948.
Copilot AI review requested due to automatic review settings July 5, 2026 08:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts Formula#oldnames so that “same-name” tap migration metadata (notably cask-to-formula migrations where the token doesn’t change) is not treated as a formula rename requiring Cellar migration. This aligns the metadata handling with the intended semantics and avoids downstream behaviors that can lead to re-locking the same formula/Cellar path during upgrade/reinstall flows.

Changes:

  • Filter Formula#oldnames to drop migration entries whose base name matches the current formula name.
  • Add a regression spec ensuring same-name cask-to-formula migrations do not contribute to oldnames.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/formula.rb Filters out “same-name” migration oldnames to avoid treating them as formula renames.
Library/Homebrew/test/formula_spec.rb Adds a regression test covering the same-name cask-to-formula migration case.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/formula.rb
@MikeMcQuaid MikeMcQuaid enabled auto-merge July 5, 2026 10:34
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jul 5, 2026
Merged via the queue into main with commit 449acb1 Jul 5, 2026
43 checks passed
@MikeMcQuaid MikeMcQuaid deleted the fix-self-migration-lock branch July 5, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

brew upgrade/reinstall of a source-built tap formula fails with "process has already locked" while the lock is free

3 participants