Problem symlinking /home/linuxbrew/.linuxbrew?

(James T White) #1

I recently decided to do a complete re-install of my linuxbrew set-up; however, there have been several problems with it. Mysql won’t build properly, and an R package doesn’t run properly. I had mysql installed in the old set-up and the R package was working there too. I’ll address these in github issues.

In the meantime, I’ve been switching back and forth between the set-ups using a symlink. The symlink /home/linuxbrew/.linuxbrew points to /home/linuxbrew/.linuxbrew_old when I need that functionality and to /home/linuxbrew/.linuxbrew_new when I want to troubleshoot what’s going on with the new set-up. The output of brew dr, however, hints that this may cause problems… Warning: Your Homebrew's prefix is not /home/linuxbrew/.linuxbrew. Some of Homebrew's bottles (binary packages) can only be used with the default prefix (/home/linuxbrew/.linuxbrew).

One may suggest that I just use “mv” as no data is actually moved but only the inode associated with the path is changed; however, I plan to move .linuxbrew_old to a network share as I’m running out of space that has been allotted by our IT to dirs in /home, and I believe that this would actually consist of an actual move of data rather than just changing the inode associated with the path, meaning a “mv” would take forever whenever I’d like to switch.

Any insight would be appreciated. Thanks.

(Jonathan Chang) #2

For this setup, you might find it better to symlink the Cellar (brew --cellar) rather than the prefix. I believe this will cause fewer problems when pouring bottles, but a few might still not work quite right (e.g., python@2 I believe)

(James T White) #3

Jonathan, thanks for the reply. If symlinking the Cellar breaks python@2, it won’t work for me. I haven’t coded in Python2 for about 5 years now. I’m strictly Python3; however, many applications that I use still depend on Python2.

(James T White) #4

Ok. Problems will arise when I eventually move to the new installation. Builds will fail. The builds will resolve symlinks to the absolute paths. I re-installed R when /home/.linuxbrew was a symlink to /home/.linuxbrew_new. I then did, mv /home/.linuxbrew_new /home/.linuxbrew which broke R.
$ R
/home/linuxbrew/.linuxbrew/bin/R: line 238:
/home/linuxbrew/.linuxbrew_new/Cellar/r/3.5.2_2/lib/R/etc/ldpaths: No such file or

(Michka Popoff) #5

Regarding MySQL:

We know it is broken, but it is broken for everyone. I had no time to investigate. Any help on that topic is welcome.

(Michka Popoff) #6

And regarding moving installations somewhere else: you can do that, but you need to reinstall all your packages in the new location. Patchelf will fix some paths when possible, and some other will stay hardcoded to their initial absolute value.

(James T White) #7

Thanks for the response regarding Mysql, Michka. In cases like these, would it be possible to make the old version available until the build problems are sorted out? Mysql v8.0.12 built well in my older set-up of Linuxbrew. In that set-up when I attempted to upgrade Mysql to 8.0.15, the build failed, so the problems don’t seem to be associated with my different Linuxbrew set-ups. In fact, I’m going to attempt to copy over the Mysql v8.0.12 from the Cellar on the old set-up to the Cellar of the new set-up, and see if that works.

(James T White) #8

Thanks for the response regarding moving installations, Michka. I find it’s only a problem with the builds when .linuxbrew is symlinked. An application built with .linuxbrew symlinked to .linuxbrew_new, will not work if .linuxbrew_new is moved to .linuxbrew. Simply running, in the symlink context, applications that were built within the absolute path of /home/linuxbrew/.linuxbrew is not a problem. Since I don’t plan on installing any new applications to the old set-up, I will be moving that to the network share and using a symlink on that. For the new set-up, I will just use a mv, since that is local.

(Michka Popoff) #9

I would prefer that we try to fix the build. We may need help from the upstream MySQL developers. I really had no time to look at this. I have some more urgent topics to fix in Homebrew right now (mostly infrastructure related). So any help fixing broken formulae is welcome.

(James T White) #10

Thanks, Michka. I will definitely do what I can do to troubleshoot the problems with the MySQL build. I’m very far from being a C-build expert, however. What I see in the logs now are many references to missing header and library files, 44 to be exact. I installed libsasl2 and that got rid of the message, -- Looking for include file sasl/sasl.h - not found. I’m not finding many of the other dependencies in the Linuxbrew repo, however.

(Shaun Jackman) #11

Hi, James. You can install a bottle of an older version of mysql from Bintray.

brew install

brew tap brewsci/base
brew installv mysql=8.0.12_0.1

You can use brew pin mysql to prevent automatic upgrading.