Skip to content

Homebrew cleans metafiles after formula installation even if skip_clean is used #20922

@botantony

Description

@botantony

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.

brew config output

HOMEBREW_VERSION: 4.6.18-19-g14304c5
ORIGIN: https://github.com/Homebrew/brew
HEAD: 14304c59de7c70837e4b7a1245ced40e30ae8c4b
Last commit: 3 hours ago
Branch: main
Core tap HEAD: baae9195727a811137d1bc0dc62fc0da5675119c
Core tap last commit: 13 minutes ago
Core tap JSON: 21 Oct 21:17 UTC
Core cask tap HEAD: e1ec6c6c2925dc9beaba6a4ca74cf6ea11f74fe0
Core cask tap last commit: 70 minutes ago
Core cask tap JSON: 21 Oct 21:17 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.SPqv1guT2P/org.xquartz:0
HOMEBREW_EDITOR: nvim
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.4.5 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 17.0.0 build 1700
Git: 2.51.1 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 26.0.1-arm64
CLT: 26.0.0.0.1.1757719676
Xcode: 26.0.1
Rosetta 2: false

What were you trying to do (and why)?

A user wanted to install changelog.md files to libexec as the program uses this info to determine the version

Related to Homebrew/homebrew-core#249984

What happened (include all command output)?

Adding skip_cleanup "libexec/changelog.md" didn't work, so they had to create a symlink in post_install block

What did you expect to happen?

Do not remove this file

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

# Add something like `skip_clean "libexec/README.md»` and `libexec.install "README.md"` to any formula
brew install --build-from-source <formula-name>
# You can observe that this file is installed while the program compiles
# but after `Cleanup` it disappears

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions