Skip to content

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Aug 11, 2025

This PR does a few cleanup things:

  1. Removes references to HOMEBREW_USE_INTERNAL_API in Homebrew::API::{Formula,Cask}. This functionality will end up living in Homebrew::API::Internal (coming soon)
  2. Move the formula_aliases.txt file generation to a helper method in Homebrew::API. This is only used in one place for now, but eventually will be used in Homebrew::API::Internal
  3. Enable download queue support for individual formula/cask API fetches
  4. Add alias, rename, and tap migration information to the internal API generation

A quick note on the last item: this means that the minimal JSON file now is in this format:

{
  "formulae": {
    "name": ["pkg_version", rebuild, "sha256"],
    ...
  },
  "aliases": {
    "alias_name": "real_name",
    ...
  },
  "renames": {
    "old_name": "real_name",
    ...
  },
  "tap_migrations": {
    "name": "tap",
    ...
  }
}

I tried a few different structures to see which was the most space-efficient when compressed, and this seemed to be the best and most readable. I'm happy to share these results if anyone is interested. Also happy to try other suggestions.

Here are the compressed file sizes:

$ eza -l
.rw-r--r-- 175k rylanpolster 10 Aug 23:31 formula.arm64_big_sur.json.gz
.rw-r--r-- 334k rylanpolster 10 Aug 23:31 formula.arm64_linux.json.gz
.rw-r--r-- 206k rylanpolster 10 Aug 23:31 formula.arm64_monterey.json.gz
.rw-r--r-- 376k rylanpolster 10 Aug 23:31 formula.arm64_sequoia.json.gz
.rw-r--r-- 376k rylanpolster 10 Aug 23:31 formula.arm64_sonoma.json.gz
.rw-r--r-- 376k rylanpolster 10 Aug 23:31 formula.arm64_tahoe.json.gz
.rw-r--r-- 376k rylanpolster 10 Aug 23:31 formula.arm64_ventura.json.gz
.rw-r--r-- 176k rylanpolster 10 Aug 23:31 formula.big_sur.json.gz
.rw-r--r-- 161k rylanpolster 10 Aug 23:31 formula.catalina.json.gz
.rw-r--r-- 126k rylanpolster 10 Aug 23:31 formula.el_capitan.json.gz
.rw-r--r-- 137k rylanpolster 10 Aug 23:31 formula.high_sierra.json.gz
.rw-r--r-- 147k rylanpolster 10 Aug 23:31 formula.mojave.json.gz
.rw-r--r-- 206k rylanpolster 10 Aug 23:31 formula.monterey.json.gz
.rw-r--r-- 377k rylanpolster 10 Aug 23:31 formula.sequoia.json.gz
.rw-r--r-- 129k rylanpolster 10 Aug 23:31 formula.sierra.json.gz
.rw-r--r-- 377k rylanpolster 10 Aug 23:31 formula.sonoma.json.gz
.rw-r--r-- 377k rylanpolster 10 Aug 23:31 formula.tahoe.json.gz
.rw-r--r-- 377k rylanpolster 10 Aug 23:31 formula.ventura.json.gz
.rw-r--r-- 377k rylanpolster 10 Aug 23:31 formula.x86_64_linux.json.gz

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @Rylan12! Will merge after next release.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Aug 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 11, 2025
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Aug 11, 2025
Merged via the queue into main with commit 04b47bc Aug 11, 2025
34 checks passed
@MikeMcQuaid MikeMcQuaid deleted the alias-rename-migrations-internal-api branch August 11, 2025 14:13
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.

2 participants