Closed pointlessone closed 1 month ago
@pointlessone Can you run brew update again and test if the bug is still occurring? I just went through your test case and was unable to reproduce it using brew 4.3.9
HOMEBREW_VERSION: 4.3.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1c98a33a376e5b35ebc801d0f7d6ba7b9eb118ac
Last commit: 8 days ago
Core tap JSON: 15 Jul 18:24 UTC
Core cask tap JSON: 15 Jul 18:24 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 3.3.3 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/ruby
CPU: octa-core 64-bit arm_blizzard_avalanche
Clang: 15.0.0 build 1500
Git: 2.45.1 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false
No, still can reproduce.
HOMEBREW_VERSION: 4.3.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1c98a33a376e5b35ebc801d0f7d6ba7b9eb118ac
Last commit: 9 days ago
Core tap JSON: 17 Jul 07:26 UTC
Core cask tap JSON: 17 Jul 07:26 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 16
Homebrew Ruby: 3.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/ruby
CPU: 16-core 64-bit kabylake
Clang: 15.0.0 build 1500
Git: 2.45.2 => /usr/local/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.0-x86_64
CLT: 16.0.0.0.1.1720323432
Xcode: 15.4
The underlaying issue that unknown files spook brew is still there. Maybe your Finder doesn't create those .DS_Store files? One thing to try is to enable "Calculate all sizes" for the folder (⌘-J
or in main menu View → Show View Options). Or create a random file in the unpacked directory.
I narrowed it down to unexpected hidden files.
Here's a oneliner to try:
while true; do find /tmp/ -path '*/homebrew-unpack*' -type d -exec touch "{}/.hidden-file" \; ; done
This will create a .hidden-file
in every homebrew-unpack directory. Running this while installing a package makes the installation fail.
Can't reproduce this either. I had /tmp
open in Finder as I was installing go@1.21
and didn't have any problems.
I narrowed it down to unexpected hidden files.
Here's a oneliner to try:
while true; do find /tmp/ -path '*/homebrew-unpack*' -type d -exec touch "{}/.hidden-file" \; ; done
This will create a
.hidden-file
in every homebrew-unpack directory. Running this while installing a package makes the installation fail.
I can see why this would cause problems, but I don't see why this would happen if you had only /tmp
open in Finder.
I don't see why this would happen if you had only /tmp open in Finder.
I don't have a definite answer but my first guess would be that Finder puts .DS_Store
files all over the place when it calculates folder sizes.
I don't have a definite answer but my first guess would be that Finder puts
.DS_Store
files all over the place when it calculates folder sizes.
Sounds plausible, but I suspect you need to do more than just have /tmp
open in Finder for this to happen.
I can make you a screen recording to demonstrate that I don't do anything else.
Just tried it again. Extra piece of information is that /tmp
has to be in list view, so that folder size was actually displayed.
The issue is not present when the folder displayed as Icons.
I can make you a screen recording to demonstrate that I don't do anything else.
That's not necessary; I believe that you don't think you're doing anything else. By "do more" I was also referring to configuration changes, and that won't be visible from a screen recording.
Just tried it again. Extra piece of information is that
/tmp
has to be in list view, so that folder size was actually displayed.The issue is not present when the folder displayed as Icons.
That's good to know. Interestingly, folder sizes don't show up for me even in list view. I guess you need to enable "Calculate all sizes" in the view options in Finder in addition to using list view.
This does look like a bug (will need to try reproducing it later), but it seems difficult enough to encounter that it probably doesn't affect many users. We'll review PRs to fix this, but I think Homebrew maintainers are unlikely to pick this up due to the limited impact of the bug.
Sure, understandable. I just wanted to document it in case it's a symptom of something bigger.
That's good to know. Interestingly, folder sizes don't show up for me even in list view. I guess you need to enable "Calculate all sizes" in the view options in Finder in addition to using list view.
This does look like a bug (will need to try reproducing it later), but it seems difficult enough to encounter that it probably doesn't affect many users. We'll review PRs to fix this, but I think Homebrew maintainers are unlikely to pick this up due to the limited impact of the bug.
I tried reproducing again with "Calculate all sizes" checked and list new in the finder and couldn't recreate the issue. I am running an Apple chip Mac (ARM64) Mac and noticed the issue creator was running an intel chip Mac (x86_64). If someone can do a test with an Intel Mac that would be nice.
Multiple people can't reproduce so: closing, sorry.
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
I'm trying to install a package (to use what it provides).
What happened (include all command output)?
Installation fails with message: Directory not empty
Full output
``` ❯ brew install go@1.21 -d /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go@1.21 /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go@1.21 /usr/local/Homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::NullLoader): loading go@1.21 ==> Downloading https://ghcr.io/v2/homebrew/core/go/1.21/manifests/1.21.12 Already downloaded: /Users/pointlessone/Library/Caches/Homebrew/downloads/2331b31ebce664d008df62c60c405005a579f73b53c7beadb28d583c4bb10f74--go@1.21-1.21.12.bottle_manifest.json /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go ==> Fetching go@1.21 ==> Downloading https://ghcr.io/v2/homebrew/core/go/1.21/blobs/sha256:b4121b05ae63662ebd68a2807b3c7ea3f2363bf5 Already downloaded: /Users/pointlessone/Library/Caches/Homebrew/downloads/b51d7de3f15e734d0e45511f7defec66d11a5463d8157be7d83ba64678545347--go@1.21--1.21.12.sonoma.bottle.tar.gz /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go@1.21 /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go /usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading go ==> Pouring go@1.21--1.21.12.sonoma.bottle.tar.gz /usr/bin/env tar --extract --no-same-owner --file /Users/pointlessone/Library/Caches/Homebrew/downloads/b51d7de3f15e734d0e45511f7defec66d11a5463d8157be7d83ba64678545347--go@1.21--1.21.12.sonoma.bottle.tar.gz --directory /private/tmp/homebrew-unpack20240706-17784-x182cq /usr/bin/env cp -pR /private/tmp/homebrew-unpack20240706-17784-x182cq/.DS_Store /usr/local/Cellar/.DS_Store /usr/bin/env cp -pR /private/tmp/homebrew-unpack20240706-17784-x182cq/go@1.21/. /usr/local/Cellar/go@1.21 Error: Directory not empty @ dir_s_rmdir - /private/tmp/homebrew-unpack20240706-17784-x182cq/go@1.21/1.21.12/libexec/test /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2324:in `rmdir' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2324:in `block in remove_dir1' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2335:in `platform_support' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2323:in `remove_dir1' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2316:in `remove' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:1452:in `block in remove_entry' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2377:in `block (2 levels) in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2377:in `block (2 levels) in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2377:in `block (2 levels) in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2377:in `block (2 levels) in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2381:in `postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2376:in `block in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `each' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2376:in `block in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `each' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2376:in `block in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `each' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2376:in `block in postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `each' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:2375:in `postorder_traverse' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/fileutils.rb:1450:in `remove_entry' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/lib/ruby/3.3.0/tmpdir.rb:107:in `mktmpdir' /usr/local/Homebrew/Library/Homebrew/unpack_strategy.rb:126:in `extract_nestedly' /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:103:in `stage' /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:36:in `stage' /usr/local/Homebrew/Library/Homebrew/software_spec.rb:389:in `stage' /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:1291:in `block in pour' /usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:314:in `block in cd' /usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:314:in `chdir' /usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:314:in `cd' /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:1290:in `pour' /usr/local/Homebrew/Library/Homebrew/formula_installer.rb:434:in `install' /usr/local/Homebrew/Library/Homebrew/upgrade.rb:237:in `install_formula' /usr/local/Homebrew/Library/Homebrew/install.rb:350:in `install_formula' /usr/local/Homebrew/Library/Homebrew/install.rb:301:in `block in install_formulae' /usr/local/Homebrew/Library/Homebrew/install.rb:300:in `each' /usr/local/Homebrew/Library/Homebrew/install.rb:300:in `install_formulae' /usr/local/Homebrew/Library/Homebrew/cmd/install.rb:297:in `run' /usr/local/Homebrew/Library/Homebrew/brew.rb:92:in `What did you expect to happen?
Installation to finish successfully.
Step-by-step reproduction instructions (by running
brew
commands)/tmp
in Findergo
,go@1.21
, andtexlive
:brew install go
I suspect Finder creates some weird files in directories that brew doesn't expect (maybe
.DS_Store
or something like that).I tried some smaller packages and it doesn't happen with all of them. Finder probably needs some time to notice the directory and do its thing. For me installing go fails every time in this scenario.
Packages install with no issues when /tmp window is closed.
PS: I lied when I checked the brew doctor checkbox, obviously. I don't think it's relevant but I couldn't submit the issue without it.