ublue-os / toolboxes

Centralized repository of containers designed for Toolbox/Distrobox
Apache License 2.0
54 stars 11 forks source link

bluefin-cli brew install PACKAGE error no file or directory #111

Open lethedata opened 2 months ago

lethedata commented 2 months ago

When trying to install any package with brew via bluefin-cli on bluefin-dx I'm receiving the following error with slightly different paths:

cp: No such file or directory (os error 2)
Error: Failure while executing; `/usr/bin/env cp -pR /tmp/homebrew-unpackXXXXXXXX-XXXXX-XXXXXX/icu4c/. /home/linuxbrew/.linuxbrew/Cellar/icu4c` exited with 1. Here's the output:
cp: No such file or directory (os error 2)

Verbosing the command reveals it's the /tmp/homebrew-unpackXXXXXXXX-XXXXX-XXXXXX/ not existing which is causing tar to fail. Testing with the Fedora and Ubuntu toolboxes work fine and even have access to tools that are already installed.

The other thing I noticed is that this box doesn't see any brew applications installed by the host tho this might actually be expected.

Brew Version: Homebrew >=4.1.0 (shallow or no git repository)

m2Giles commented 2 months ago

Bluefin-cli uses its own brew installation and is using brew packaged by Wolfi which is slightly different in implementation from brews default installation method.

This was done prior to having homebrew on the bluefin image.

lethedata commented 2 months ago

Looks like it might have a broken brew installation. It seems to be cp command having a "." at the end. Instead of copying folder name to folder name it's trying to copy folder contents into a folder which doesn't exist.

Upstream might have fixed this as their brew.yaml was updated 3 days ago to version 4.3.9 manually getting a new brew version installed via homebrew directly lead to the same thing. Might be something on the Wolfi side?

To figure this out I monitored /tmp with inotifyd to see the tmp files were getting created. Freezing the command I was able to verify that it was extracting properly. I then manually stepped through the process it was trying to do and realized there was that extra dot in the copy command.


Bluefin-cli uses its own brew installation and is using brew packaged by Wolfi which is slightly different in implementation from brews default installation method.

That makes since and helps explain what I was reading on the introduction page and why the other two work.

9d4 commented 1 month ago

I found same issue. Does it still happen to you @lethedata?

lethedata commented 1 month ago

Yeah, still broken. I tried a lot of different things but it always gets stuck on copying files. Manually doing it works which confuses me.

The /. does cause copy errors but I think its because brew is failing to create folders before copying.

9d4 commented 1 month ago

Did you run using distrobox create?

lethedata commented 1 month ago

Distrobox assemble via ujust scripts and systemd quadlet. Same issue on both.

I took a peak at brews code snd the /. is actually legitimate: directory.rb line 25

This means brew is supposed to create folders before moving tho the debug doesn't really show that. I think the next thing to look at is if wolfi has this problem to see if its some packaging issue.