-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
linuxbrew-core-migration: remove unneeded formulae #21190
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
Conversation
2164209 to
94d6d00
Compare
There was a problem hiding this comment.
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 optimizes the linuxbrew-core migration code by removing formulae that are no longer needed for migration (those with newer versions in Homebrew/core or that have been removed/disabled). The PR transforms the migration list from a simple array of 115 formula names to a hash containing only 25 formulae with their old package version strings, and makes the require statement lazy-loaded for better performance.
- Reduced migration list from 115 to 25 formulae by removing ones already updated or removed
- Added old package version tracking in a hash structure with Sorbet type annotations
- Optimized loading by moving
require "linuxbrew-core-migration"from top-level to conditional lazy-loading
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Library/Homebrew/linuxbrew-core-migration.rb | Replaced simple array with hash mapping formula names to old pkg_version strings, reducing from 115 to 25 entries; derived migration list from hash keys |
| Library/Homebrew/cmd/update-report.rb | Moved require "linuxbrew-core-migration" from top-level imports to lazy-loading inside the migration conditional block |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This change removes formulae that: * have newer versions or revisions in Homebrew/core * have been removed or disabled The last pkg-version string is added for remaining formulae to check when `Formula[key].pkg_version > PkgVersion.parse(value)`
94d6d00 to
7986ba1
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks! When was this code added? It may have been long enough we can remove it.
About 4 years ago - e8ee5b0. |
|
@cho-m Yeh, I think can just get deleted then at this point 👍🏻 |
Follow up to #21190. We enabled migration over 4 years ago since #12248, which was part of brew 3.3.0. So at least 2 major brew releases have passed and all active Linuxbrew users would have been migrated already. There are only 25 formulae left so anyone who hasn't migrated can just reinstall formulae if impacted.
brew lgtm(style, typechecking and tests) with your changes locally?This change removes formulae that:
The last pkg-version string is added for remaining formulae to check when
Formula[key].pkg_version > PkgVersion.parse(value)Alternatively could just drop Linuxbrew migration handling.