Skip to content

Structured API bootstrap actions cannot access required formula resources #23465

Description

@fishcharlie

brew doctor output

Your system is ready to brew.

Verification

  • I ran brew update twice and am still able to reproduce my issue.
  • My "brew doctor output" above says Your system is ready to brew or a definitely unrelated Tier message.
  • 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.
  • I did not use AI/LLM to create this issue, or I disclosed the tool and model used; I will answer maintainer questions myself without AI/LLM.

brew config output

HOMEBREW_VERSION: 6.0.15-125-g7372067
ORIGIN: https://github.com/Homebrew/brew
HEAD: 73720671af9c86920d7baf090bfb4161765bb5ef
Last commit: 16 hours ago
Branch: main
Core tap: N/A
Core cask tap: N/A
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: 3650
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_NO_SANDBOX_LINUX: set
Homebrew Ruby: 4.0.6 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/4.0.6/bin/ruby
CPU: dual-core 64-bit sapphirerapids
Clang: 18.1.3
Git: 2.54.0 => /bin/git
Curl: 8.5.0 => /bin/curl
Kernel: Linux 6.17.0-1020-azure x86_64 GNU/Linux
Landlock ABI: 7
OS: Ubuntu 24.04.4 LTS (noble)
Host glibc: 2.39
Host libstdc++: 6.0.33
/usr/bin/gcc-13: 13.3.0
/usr/bin/ruby: 3.2.3
glibc: N/A
gcc@13: N/A
gcc: N/A
xorg: N/A

What were you trying to do (and why)?

I was validating that structured post-install actions work for formulas loaded from the Homebrew API after enabling developer mode and updating to Homebrew main. The specific formula below is only a minimal trigger; the reported failure is in the generic API-loaded structured-action path.

What happened (include all command output)?

Both updates completed successfully, and brew doctor reported a clean system:

$ brew update
Already up-to-date.
$ brew update
Already up-to-date.
$ brew doctor
Your system is ready to brew.

The API formula data declares a structured bootstrap_cpython post-install action but provides no resources:

{
  "versions": {
    "stable": "3.11.15",
    "bottle": true
  },
  "revision": 4,
  "tap_git_head": "7f32d96366933aa73ee5d2b17fed9015870f085f",
  "resources": null,
  "post_install_steps": [
    {
      "type": "bootstrap_cpython"
    }
  ]
}

The formula loads through Formulary::FromAPILoader, installs its bottle, and then its structured post-install action fails while looking up a resource that is absent from the API-loaded formula:

$ brew install --debug --verbose python@3.11
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading python@3.11
...
Warning: The post-install step did not complete successfully
You can try again using:
  brew postinstall python@3.11
==> An exception occurred within a child process:
  ResourceMissingError: python@3.11 does not define resource "setuptools"

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/software_spec.rb:204:in 'block in SoftwareSpec#resource'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/software_spec.rb:204:in 'Hash#fetch'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/software_spec.rb:204:in 'SoftwareSpec#resource'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:867:in 'Formula#resource'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install_steps/formula_actions.rb:226:in 'Homebrew::InstallSteps::Runner#run_bootstrap_cpython'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install_steps.rb:1038:in 'Homebrew::InstallSteps::Runner#run_install_step'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install_steps.rb:876:in 'block in Homebrew::InstallSteps::Runner#run'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install_steps.rb:872:in 'Array#each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/install_steps.rb:872:in 'Homebrew::InstallSteps::Runner#run'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1611:in 'block in Formula#run_post_install_steps'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula.rb:1610:in 'Formula#run_post_install_steps'

Retrying brew postinstall --debug --verbose python@3.11 produces the same ResourceMissingError.

What did you expect to happen?

An API-loaded structured bootstrap action should have access to every formula resource it requires, or the API representation should contain enough information for the action to execute. The post-install action should complete successfully.

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

On a clean Ubuntu 24.04 GitHub-hosted runner with current stable Homebrew installed:

brew developer on
brew update
brew update
brew doctor
brew config
brew install --debug --verbose python@3.11
brew postinstall --debug --verbose python@3.11

This issue was generated with the assistance of OpenAI Codex (GPT-5.6 Sol). I reviewed and verified the reproduction and will answer maintainer follow-up questions myself without AI/LLM assistance.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions