Skip to content
This repository has been archived by the owner on Mar 12, 2019. It is now read-only.

Symlinked standard location /home/linuxbrew/.linuxbrew being ignored when installing non-relocatible bottles #586

Closed
3 of 4 tasks
Char-Aznable opened this issue Jan 31, 2018 · 3 comments
Assignees
Labels

Comments

@Char-Aznable
Copy link

Please fill out the issue checklist below, and provide all of the requested information.

Please always follow these steps:

  • Confirmed this is a problem with running a brew command and not brew installing or the post-install behaviour of one or more formulae? If it's a formulae-specific problem please file this issue at the relevant tap e.g. for Linuxbrew/homebrew-core https://github.com/Linuxbrew/homebrew-core/issues/new
  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed all issues and retried your prior step?
  • Ran brew config and brew doctor and included their output with your issue?

My linuxbrew is installed in /scratch/.linuxbrew and I create a symlink /home/linuxbrew -> /scratch in order to install the non-relocatible bottles. However, I find recently that I have to --force-bottle to install them and this option is not passed down the dependency chain so that I have to manually pass --force-bottle to every single install. For example:

==> Installing iso-codes dependency: ncurses
Warning: Building ncurses from source:
  The bottle needs a /home/linuxbrew/.linuxbrew/Cellar Cellar (yours is /scratch/.linuxbrew/Cellar).

Somehow linuxbrew ignores the /home/linuxbrew/.linuxbrew path as if the symlink is followed. Is there a way to relax this path check so that it's OK even if the standard location is a symlink? Or is there a way to force bottle to be installed in a dependency tree?

@sjackman sjackman self-assigned this Jan 31, 2018
@sjackman
Copy link
Member

sjackman commented Jan 31, 2018

Symlinking HOMEBREW_PREFIX in this way is not supported. It mostly works, but a couple of formula break, in particular python and python3. Those are in fact the only two that I've encountered to break. Here's a hack that I use to use Homebrew on macOS with a symlinked Cellar. sjackman/brew@6a97bf5
You could adapt this for Linuxbrew by changing /usr/local to /home/linuxbrew/.linuxbrew, and changing it to look for a PREFIX symlink rather than a CELLAR symlink. For example, get rid of the if statement and add

HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"

Good luck!

@Char-Aznable
Copy link
Author

What did you mean when you said the python was broken by symlinking this way? Why not incorporate the hack you mentioned into the codes? I think a lot of people can benefit from this because symlinking this way might be the only solution when one doesn't have permission to the hard-coded prefix, which I believe is the main reason why people choose to use linuxbrew in the first place.

@sjackman
Copy link
Member

sjackman commented Feb 2, 2018

brew postinstall python fails because a symlink to site-library is incorrect. I haven't had time to look into the issue. If it were fixed, the above hack could possible be incorporated into Linuxbrew.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants