Skip to content

brew test-bot --only-cleanup-before fails on /usr/local runners: cannot create libexec #24663

Done

Description

@zbeekman

brew doctor output

Not available: this fails on a GitHub-hosted `macos-15-intel` runner,
set up with Homebrew/actions/setup-homebrew, in a third-party tap's CI.

Reproduced in CI on a fresh brew main (7.0.14-67-gb43c73f823) via
setup-homebrew, which is equivalent to brew update; brew doctor
isn't available from the runner. Full log of the failing job (the
relevant excerpt is quoted below, as Actions logs expire):
https://github.com/zbeekman/homebrew-tap/actions/runs/44144423031/job/134255544412

Verification

  • I ran brew update twice and am still able to reproduce my issue.
  • I have supplied my brew doctor output above and it seems unrelated to my issue.
  • 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/brew 7.0.14-67-gb43c73f823
Homebrew/homebrew-core a18de1aa60a
Runner: GitHub-hosted macos-15-intel (HOMEBREW_PREFIX=/usr/local)

What were you trying to do (and why)?

Run the standard tap CI (brew test-bot --only-cleanup-before, then
--only-setup, --only-tap-syntax, --only-formulae) on GitHub's
macos-15-intel runner.

What happened (include all command output)?

Excerpt of the failing job's log (timestamps and colours removed):

+ brew test-bot --only-cleanup-before
==> Already trusted tap: zbeekman/tap
==> Using Homebrew/brew 7.0.14-67-gb43c73f823 (Merge pull request #24645 from Homebrew/own-sigstore-verifier)
==> Using Homebrew/homebrew-core a18de1aa60a (Merge pull request #300359 from Homebrew/bump-moon-2.5.3)
==> Testing zbeekman/homebrew-tap 5ad328f (Merge 3c960d61c41c365cbd7cd0b7a766c10c9423061d into 944b57b6587c4a5bacddf9483d77a8d71826038b):

==> Running CleanupBefore#run!
==> git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core reset --hard origin/main
==> sudo mv /Library/Frameworks/Python.framework /private/tmp/d20261117-2491-jmwaxw
==> brew cleanup --prune-prefix
==> git -C /usr/local/Homebrew/Library/Taps/zbeekman/homebrew-tap clean -ff -dx
==> Determining /usr/local files to purge...
##[error]Permission denied @ dir_s_mkdir - /usr/local/libexec
##[error]Process completed with exit code 1.

The same job passed earlier the same day on an older brew. It still
passes on macos-26 (/opt/homebrew) and in the Linux containers.

ae73120 ("Clean up broken libexec symlinks") added libexec to
Keg.must_exist_subdirectories, which feeds
Keg.must_be_writable_directories. Homebrew::TestBot::TestCleanup
calls Keg.must_be_writable_directories.each(&:mkpath) before it
determines the files to purge. On this runner /usr/local is owned by
root and /usr/local/libexec does not exist, so mkpath fails.
install.sh, which keg.rb says to keep in sync with this list, does
not create libexec, so existing /usr/local installations won't have
it either.

Other users of these lists (brew cleanup, brew doctor) skip
directories that don't exist, so this seems limited to test-bot.

What did you expect to happen?

brew test-bot --only-cleanup-before succeeds, as it did before
ae73120: either install.sh creates libexec (with the matching
ownership) or test-bot does not need to create it.

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

# On a GitHub-hosted macos-15-intel runner, after
# Homebrew/actions/setup-homebrew:
brew test-bot --only-cleanup-before

Failing run: https://github.com/zbeekman/homebrew-tap/actions/runs/44144423031/job/134255544412

AI disclosure: the cause was traced and this issue was drafted with
Claude Code (Opus 5.5, high effort); I reviewed it before posting.

Activity

  1. JLP04 commented on Nov 17, 2026

    @JLP04

    I've also had this issue, I think it's caused by the installer script, so I've opened Homebrew/install#1170.

  2. self-assigned this
    on Nov 18, 2026
  3. added a commit that references this issue on Nov 18, 2026
    c728041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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