Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

HOMEBREW_PREFIX ignored/not respected. hard-coded paths ensue. #46275

Closed
mralexgray opened this issue Nov 23, 2015 · 3 comments
Closed

HOMEBREW_PREFIX ignored/not respected. hard-coded paths ensue. #46275

mralexgray opened this issue Nov 23, 2015 · 3 comments

Comments

@mralexgray
Copy link

In the same vein as Investigate making prefix/cellar configurable via environment variables... I urge the powers-that-be to reconsider the current setup - which results in needlessly hard-coded paths during linking/compilation.

Example...

mv /usr/local /Volumes/NoneYa
ln -s /Volumes/NoneYa/local /usr
export HOMEBREW_PREFIX=/usr/local # will be ignored
brew reinstall some-formula
==> Reinstalling some-formula
==> Downloading http://ftp.godknowswhere.org/some-formula.tar.gz
Already downloaded: /Library/Caches/Homebrew/some-formula.tar.gz
==> ./configure --prefix=/Volumes/NoneYa/local/Cellar/some-formula/ --mandir=/Volumes/NoneYa/local/Cellar/some-formula/2 

In this totally mundane and plausible example, I have now compiled, linked... and can enjoy some-formula. That is, until, _gasp_.. I want to change the location of where I ACTUALLY keep the contents of /usr/local. Even though I TRIED to tell homebrew..

"Hey listen, I know /usr/local isn't EXACTLY where you think it's going to be... but lets just pretend. I will _make sure_ you can always find it at /usr/local - that's why I set $HOMEBREW_PREFIX in my .profile, OK?"

I know you guys do some clever ruby hocus-pocus to make sure you are installing to the actual location of whatever is sitting at /usr/local, but why? Just follow the symlinks according to what we want, and by extension - are responsible for ensuring exists - per the HOMEBREW_PREFIX.

Or maybe there is some way that I am unaware to magically recompile every formula when the physical location of our prefix changes?

for x in $(brew list); { brew unlink $x && brew link $x; }

But even if there is... why are we hardcoding paths at compile/install/link time that can just as easily be more configurable/flexible?

@xu-cheng
Copy link
Member

Sorry but we don't support such use case.

why are we hardcoding paths at compile/install/link time that can just as easily be more configurable/flexible?

Majority of packages hardcode prefix path inside their binary files. So it's not configurable/flexible.

As far as I understand, you want to use /usr/local/ as prefix, but use a different Volume to store actually files (To save space?). If you insist to do this, you may want to just mount the volume to /usr/local/. But be aware, such configuration is completely unsupported by us.

@mralexgray
Copy link
Author

But why? Is there no room for improvement here? It's not a race to close issues... it's a battle to improve the software.

@MikeMcQuaid
Copy link
Member

@mralexgray We do not consider this an issue and will not be working on fixing it so we've closed the issue. This feature request will make it harder to debug Homebrew issues so we do not wish to work on it.

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants