New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch/installation fails #13
Comments
More failures. After the above I did $ sudo ./brewdo switch
./brewdo:325:in `stat': No such file or directory - /usr/local/Library/ENV/pkgconfig/fuse/fuse.pc (Errno::ENOENT)
from ./brewdo:325:in `file_owner'
from ./brewdo:345:in `block in switch_owners'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/find.rb:43:in `block in find'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/find.rb:42:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/find.rb:42:in `find'
from ./brewdo:344:in `switch_owners'
from ./brewdo:361:in `cmd_migrate'
from ./brewdo:298:in `cmd_switch'
from ./brewdo:392:in `<main>' The file Some more output: $ ls -la /usr/local/Library/ENV/pkgconfig/fuse/fuse.pc
lrwxrwxr-x 1 dev admin 32 May 5 09:55 /usr/local/Library/ENV/pkgconfig/fuse/fuse.pc -> /usr/local/lib/pkgconfig/fuse.pc
$ stat /usr/local/Library/ENV/pkgconfig/fuse/fuse.pc
16777218 537076 lrwxrwxr-x 1 dev admin 0 32 "May 5 09:55:20 2015" "May 5 09:55:20 2015" "May 8 13:54:49 2015" "May 5 09:55:20 2015" 4096 8 0 /usr/local/Library/ENV/pkgconfig/fuse/fuse.pc
$ brew ls
autoconf gettext libgpg-error nano openssl tree
automake git libksba ncurses pcre
bash-completion iftop libtool nginx-full pkg-config
brew-cask jenkins libyaml nvm readline |
For any future users: this is the equivalent of what the script is doing: sudo chown -R _homebrew:wheel /usr/local/
sudo chown -R _homebrew:admin /Library/Caches/Homebrew/Formula
sudo chmod 755 /usr/local
sudo chmod 755 /Library/Caches/Homebrew/Formula Try that in the mean time this issue gets resolved. |
Thanks for letting us know, Michael 👍 |
Wondering if that symlink might be dangling, i.e. the file that references it is missing? I might be able to test this and try to fix it this evening. Sorry it's giving you so much trouble; I appreciate your willingness to dig into it. |
@Zigg Yes, good catch. It is dangling. I think that this should be guarded against in line 345@4057ca01 I'm glad to help. Let me know if there is something else I can help with. |
I'm looking into this today and I'm wondering if the correct solution is to avoid trying to chown symlinks at all. If a symlink happened to point outside the homebrew home, then we could end up touching files outside. Not good. And on the other side of that coin, symlink ownership really doesn't matter, unless there's a case I'm not thinking of. Thoughts? Aside: I'm having some bothersome issues with the OS X VMs I usually use to test out bigger things like brewdo switch, so a fix may be slow in coming. |
@Zigg The only significance I know of symlink ownership is tied to |
I'm still wrestling with VMs—see timsutton/osx-vm-templates#43. But I did do a little bit of digging and I'm wondering if perhaps replacing chown(2) calls with lchown(2) calls would solve the issue, and be a better citizen regarding files living outside When presented with a symlink, lchown(2) will change ownership on the symlink and leave the referenced file alone. If presented with a normal file or directory, it behaves the same as chown(2). Ruby's File class has lchown and it appears to operate correctly. |
@Zigg I think |
Hi @michaellopez, Have a look at 2.0.2. I've converted brewdo to use lchown and lstat to avoid symlink-following problems. |
@Zigg I am unable to test this again as I do not have that setup available anymore. But glad to see an action was taken to hopefully make things better on this point! |
I had an installation of Homebrew already in
/usr/local
.Ran
sudo ./brewdo switch
inside my clone of zigg/brewdo. It gave me an error that/Library/Caches/Homebrew/Formula
does not exist.Trying to do another switch gave me:
After a
sudo ./brewdo deluser
I tried to switch again:After a
sudo ./brewdo deluser && rm -rf /var/log/homebrew
I managed to switch again but gave me the first error message again (understandably, I hadn't created the path).I think all the above shouldn't error out. The paths should be optional and the user account creation should be satisfied that it exists rather than throwing an error saying that it already exists.
Please don't add
HOMEBREW_CACHE
to the directories created bycmd_mkdirs
to fix the first error message above! If it does not exist, it is still a valid and working Homebrew installation. I don't want unnecessary folders loitering on my system.What are your thoughts on this? @Zigg
The text was updated successfully, but these errors were encountered: