Why do bottles need to be in /home/linuxbrew/.linuxbrew?

(Kit Monisit) #1

Hi! I have been using Linuxbrew for a long time (~4 years). Updates break backwards compatibility periodically (about once every 6 months). Because of that, I tend to fully remove my Linuxbrew installation and start from scratch. Some new policy crops up and I have to figure out how to make it work.

So, to my main question, why do bottles need to be in /home/linuxbrew/.linuxbrew? How did you make that decision? Previously, bottles were okay to be in $HOME/.linuxbrew.

Specifically, I’m having trouble installing git, which requires glibc, which requires gcc. So I cheated and went for --force-bottle. I do not know what troubles that would bring later on.

Why the default installation path is better?
(Steve Peters) #2

Installing to the home folder is listed as one of the features in the documentation and is especially useful for running specialized software on machines to which they don’t have full administrative access. This is especially relevant in scientific computing environments that may have powerful computers that the users do not administer themselves.

(Shaun Jackman) #3

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like util-linux.

The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below. On macOS the default installation directory is /usr/local. On Linux the default installation directory is /home/linuxbrew/.linuxbrew.

If you use the installation script at http://linuxbrew.sh and have sudo access, it will use the default installation directory of /home/linuxbrew/.linuxbrew and you will be able to install everything using bottles. Do you have sudo access?

(Kit Monisit) #4

No, I do not have sudo access. Yes, this is me :slight_smile: https://github.com/Linuxbrew/install/issues/53

I see, so non-relocatable formula like util-linux are the main reason for the /home/linuxbrew/.linuxbrew requirement?

(Shaun Jackman) #5

Yes, that is correct. Relocatable bottles may be used in any installation prefix. Non-relocatable formulae must be built from source in non-default-prefix installations (locations other than /home/linuxbrew/.linuxbrew).

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like util-linux. If it’s an option for you, you could open a ticket with your information systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew.

(Franklin Yu) #6

It’s not $HOME/linuxbrew/.linuxbrew, but /home/linuxbrew/.linuxbrew. $HOME expands to your home directory like /home/tolvalds.

(Kit Monisit) #7

Thanks for the catch. I’ve edited the title and my post with the correction.

(Kit Monisit) #8

@sjackman, I just want to validate my understanding:

A bottled formula such as util-linux is deemed non-relocatable because, by nature of the util-linux package, the installation prefix is hard-coded into the software at compile time.

Therefore… non-relocatable bottles are compatible only with /home/linuxbrew/.linuxbrew because that specific installation prefix has been hard-coded at compile time by whoever is building the official bottle distribution archive.

Is that correct?

(Jonathan Chang) #9

Yes, that’s right. We have a number of checks that determine if a bottle is relocatable, but we probably err too much on the side of caution. We would welcome any improvements since bottles vastly improve the user experience.

1 Like
(Jonathan Chang) #10

In addition, sometimes the formula itself can be updated to avoid being marked as non-relocatable. I can’t think of an example off-hand though.

1 Like