Skip to content

Local formula installation attempt error erroneously triggering #20452

Closed

Description

@Kreeblah

brew doctor output

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed casks are deprecated or disabled.
You should find replacements for the following casks:
  86box
  gstreamer-development
  gstreamer-runtime
  mkvtoolnix-app
  openrct2
  schism-tracker
  xemu
  xld

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  icu4c@76
  libassuan@2
  six

Warning: You have the following deprecated, official taps tapped:
  Homebrew/homebrew-bundle
Untap them with `brew untap`.

Warning: The following casks have the same name as core casks:
  marsanne/cask/cork
Their taps are in use, so you must use these full names throughout Homebrew.

Warning: The following formulae have the same name as core formulae:
  justinschuldt/virt-manager/libvirt-glib
  justinschuldt/virt-manager/spice-gtk
  justinschuldt/virt-manager/spice-protocol
  justinschuldt/virt-manager/usbredir
  justinschuldt/virt-manager/virt-manager
  kreeblah/sdl-tap/sdl_gfx
  zegervdv/zathura/girara
Their taps are in use, so you must use these full names throughout Homebrew.

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libCAPSImage.dylib
  /usr/local/lib/libMoltenVK.dylib
  /usr/local/lib/libMuseSamplerCoreLib.dylib
  /usr/local/lib/libSPIRV-Tools-shared.dylib
  /usr/local/lib/libVkLayer_api_dump.dylib
  /usr/local/lib/libVkLayer_device_simulation.dylib
  /usr/local/lib/libVkLayer_khronos_profiles.dylib
  /usr/local/lib/libVkLayer_khronos_synchronization2.dylib
  /usr/local/lib/libVkLayer_khronos_validation.dylib
  /usr/local/lib/libdxcompiler.3.7.dylib
  /usr/local/lib/libshaderc_shared.1.dylib
  /usr/local/lib/libspirv-cross-c-shared.0.48.0.dylib
  /usr/local/lib/libvulkan.1.3.204.dylib

Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae and may need to be deleted.

Unexpected '.pc' files:
  /usr/local/lib/pkgconfig/SPIRV-Tools-shared.pc
  /usr/local/lib/pkgconfig/SPIRV-Tools.pc
  /usr/local/lib/pkgconfig/shaderc.pc
  /usr/local/lib/pkgconfig/spirv-cross-c-shared.pc
  /usr/local/lib/pkgconfig/vulkan.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libGenericCodeGen.a
  /usr/local/lib/libHLSL.a
  /usr/local/lib/libMachineIndependent.a
  /usr/local/lib/libOGLCompiler.a
  /usr/local/lib/libOSDependent.a
  /usr/local/lib/libSPIRV-Tools-link.a
  /usr/local/lib/libSPIRV-Tools-lint.a
  /usr/local/lib/libSPIRV-Tools-opt.a
  /usr/local/lib/libSPIRV-Tools-reduce.a
  /usr/local/lib/libSPIRV-Tools.a
  /usr/local/lib/libSPIRV.a
  /usr/local/lib/libSPVRemapper.a
  /usr/local/lib/libglslang-default-resource-limits.a
  /usr/local/lib/libglslang.a
  /usr/local/lib/libshaderc.a
  /usr/local/lib/libshaderc_combined.a
  /usr/local/lib/libshaderc_util.a
  /usr/local/lib/libspirv-cross-c.a
  /usr/local/lib/libspirv-cross-core.a
  /usr/local/lib/libspirv-cross-cpp.a
  /usr/local/lib/libspirv-cross-glsl.a
  /usr/local/lib/libspirv-cross-hlsl.a
  /usr/local/lib/libspirv-cross-msl.a
  /usr/local/lib/libspirv-cross-reflect.a
  /usr/local/lib/libspirv-cross-util.a

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  node
Error: Rejecting formula at /Users/myuser/z3 because it's not in a tap.
       Homebrew requires formulae to be in a tap.

To create a tap, run e.g.
  brew tap-new <user|org>/<repository>
To create a formula in a tap run e.g.
  brew create <url> --tap=<user|org>/<repository>

Verification

brew config output

HOMEBREW_VERSION: 4.6.3-56-gac160c7
ORIGIN: https://github.com/Homebrew/brew
HEAD: ac160c7f88640c287599d388d6924fa039becbe9
Last commit: 4 hours ago
Branch: main
Core tap HEAD: 1e4363996c4b47a7250fa8d4d5aac8679799fb0f
Core tap last commit: 28 minutes ago
Core tap JSON: 25 Jul 05:21 UTC
Core cask tap HEAD: 91bf448907a6f7a1d414e77ad29bd74365fa5820
Core cask tap last commit: 9 minutes ago
Core cask tap JSON: 25 Jul 05:21 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.n20kwXzxQV/org.xquartz:0
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_INSTALL_FROM_API: set
HOMEBREW_NO_VERIFY_ATTESTATIONS: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.4.5 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/bin/ruby
CPU: deca-core 64-bit arm_firestorm_icestorm
Clang: 17.0.0 build 1700
Git: 2.50.1 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.6-arm64
CLT: 16.4.0.0.1.1747106510
Xcode: 16.4
Rosetta 2: false

What were you trying to do (and why)?

I'm trying to run brew upgrade (when updates are available for formulae), brew install, or brew doctor.

What happened (include all command output)?

brew upgrade and brew install terminate with the error seen above.

What did you expect to happen?

I'd expect the command to not do that, as I don't have any unbrewed formulae at that location. It happens consistently with some directories but not others. For that one, this is what's in there:

myuser@myhost ~/z3 
fsh " pwd
/Users/myuser/z3

myuser@myhost ~/z3 
fsh " ls -al
total 5528
drwxr-xr-x    6 myuser  staff      192 Sep 17  2024 ./
drwxr-xr--@ 355 myuser  staff    11360 Aug 13 15:45 ../
drwxr-xr-x    3 myuser  staff       96 Sep 17  2024 saves/
-rwxr-xr-x    1 myuser  staff  2136936 Apr 10  2024 zelda3*
-rw-r--r--    1 myuser  staff   683888 Apr 10  2024 zelda3_assets.dat
-rw-r--r--@   1 myuser  staff     6361 Sep 17  2024 zelda3.ini

This started happening earlier today, so I'm wondering whether it's related to the recent changes to https://github.com/Homebrew/brew/blob/main/Library/Homebrew/formulary.rb

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

`brew doctor`

Activity

  1. added theissue type on Aug 13, 2025
  2. Kreeblah commented on Aug 13, 2025

    @Kreeblah
    Author

    Looks like I didn't capture this in the report, but I ran that brew doctor command with the error at the end from /Users/myuser. It picked up the subdirectory z3 as a problem, for some reason.

    I'm not a Ruby person, or familiar with the Homebrew code, but if path_realpath.include?("/") || path_realpath.end_with?(".rb") from https://github.com/Homebrew/brew/blob/main/Library/Homebrew/formulary.rb#L623 feels off to me. Isn't that going to reject anything with a path separator in it?

  3. self-assigned this
    on Aug 14, 2025
  4. MikeMcQuaid commented on Aug 14, 2025

    @MikeMcQuaid
    Member

    @Kreeblah If things are still broken for you: please shout and I'll fix.

  5. Kreeblah commented on Aug 14, 2025

    @Kreeblah
    Author

    Yep, that seems to have taken care of it. I can't reproduce this any longer.

    Thanks!

  6. MikeMcQuaid commented on Aug 14, 2025

    @MikeMcQuaid
    Member

    @Kreeblah Great, thanks for reporting back.

  7. Kreeblah commented on Aug 14, 2025

    @Kreeblah
    Author

    Hmmm. This looks to be happening again. I wonder if that last change a couple hours ago reintroduced it.

  8. Kreeblah commented on Aug 15, 2025

    @Kreeblah
    Author

    Unfortunately, that last change doesn't look to have fixed it for me. I verified I'm on commit 166fa89, but I'm still receiving the same error.

  9. MikeMcQuaid commented on Aug 15, 2025

    @MikeMcQuaid
    Member

    @Kreeblah Can I see the specific error you're seeing?

  10. MikeMcQuaid commented on Aug 15, 2025

    @MikeMcQuaid
    Member

    @Kreeblah And if you're still seeing it from brew doctor specifically: can I see brew doctor --verbose --debug output, too? Thanks!

  11. Kreeblah commented on Aug 15, 2025

    @Kreeblah
    Author

    Sure, brew doctor is still one of the places I'm seeing it (as well as brew install and brew upgrade). The output from brew doctor --verbose --debug is attached below, with the error message starting at line 3052.

    brew_doctor_verbose_debug.txt

  12. MikeMcQuaid commented on Aug 15, 2025

    @MikeMcQuaid
    Member

    @Kreeblah Thanks! Can I see the output of ls -lha /Users/myuser/z3, brew list z3 and brew info z3?

  13. Kreeblah commented on Aug 15, 2025

    @Kreeblah
    Author

    Huh. It didn't even occur to me that z3 might be an actual, installed formula for some reason. Apparently it is, which explains why this is also triggering in my Downloads directory (which has a FLAC subdirectory in it; I also have the flac formula installed). So, yeah, maybe it's picking up local directory names when installed formula exist with the same name.

    myuser@myhost ~ took 7s 
    fsh " ls -lha /Users/myuser/z3/
    total 5528
    drwxr-xr-x@   6 kreeblah  staff   192B Sep 17  2024 ./
    drwxr-xr--@ 355 kreeblah  staff    11K Aug 13 22:57 ../
    drwxr-xr-x    3 kreeblah  staff    96B Sep 17  2024 saves/
    -rwxr-xr-x    1 kreeblah  staff   2.0M Apr 10  2024 zelda3*
    -rw-r--r--    1 kreeblah  staff   668K Apr 10  2024 zelda3_assets.dat
    -rw-r--r--@   1 kreeblah  staff   6.2K Sep 17  2024 zelda3.ini
    
    myuser@myhost ~ 
    fsh " brew list z3
    /opt/homebrew/Cellar/z3/4.15.2/bin/qprofdiff
    /opt/homebrew/Cellar/z3/4.15.2/bin/z3
    /opt/homebrew/Cellar/z3/4.15.2/include/ (14 files)
    /opt/homebrew/Cellar/z3/4.15.2/lib/libz3.4.15.2.0.dylib
    /opt/homebrew/Cellar/z3/4.15.2/lib/cmake/ (4 files)
    /opt/homebrew/Cellar/z3/4.15.2/lib/pkgconfig/z3.pc
    /opt/homebrew/Cellar/z3/4.15.2/lib/python3.13/ (11 files)
    /opt/homebrew/Cellar/z3/4.15.2/lib/ (2 other files)
    /opt/homebrew/Cellar/z3/4.15.2/sbom.spdx.json
    /opt/homebrew/Cellar/z3/4.15.2/share/z3/ (80 files)
    
    myuser@myhost ~ 
    fsh " brew info z3
    Error: Rejecting formula at z3 because it's not in a tap.
          Homebrew requires formulae to be in a tap.
    
    To create a tap, run e.g.
      brew tap-new <user|org>/<repository>
    To create a formula in a tap run e.g.
      brew create <url> --tap=<user|org>/<repository>
    
  14. Kreeblah commented on Aug 15, 2025

    @Kreeblah
    Author

    Yeah, running brew info z3 from a different directory (in this case, my Downloads directory) works:

    myuser@myhost ~/Downloads via C v17.0.0-clang 
    fsh " brew info z3
    ==> z3: stable 4.15.2 (bottled), HEAD
    High-performance theorem prover
    https://github.com/Z3Prover/z3
    Installed
    /opt/homebrew/Cellar/z3/4.15.2 (120 files, 32.5MB) *
      Poured from bottle on 2025-06-25 at 18:26:20
    From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/z/z3.rb
    License: MIT
    ==> Dependencies
    Build: cmake ✔, [email protected] ✔
    ==> Options
    --HEAD
    	Install HEAD version
    ==> Downloading https://formulae.brew.sh/api/formula/z3.json
    ==> Analytics
    install: 35,937 (30 days), 148,932 (90 days), 550,947 (365 days)
    install-on-request: 666 (30 days), 4,344 (90 days), 18,188 (365 days)
    build-error: 100 (30 days)
    

    It seems to be triggering only with a subdirectory with the same name as a formula, whether installed or not. I tried running brew info a2ps (which I don't have installed) and it worked. Then I created an empty a2ps directory in the same directory I was in, and was able to get that error. Removing the empty a2ps directory also prevented the error from recurring.

  15. MikeMcQuaid commented on Aug 15, 2025

    @MikeMcQuaid
    Member

    @Kreeblah Thanks for the reproduction steps, helps a lot.

  16. Kreeblah commented on Aug 15, 2025

    @Kreeblah
    Author

    Sure! Sorry I wasn't able to get you that before. I was completely thrown by it picking up on z3 and I didn't realize that was a formula that could be installed.

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions