Reduce friction needed for custom software distributions based on Homebrew #2031
Replies: 3 comments 22 replies
-
If you ask me your main issue: You're using homebrew as a dependency manager, while it is not.
I think this where all your issues begin. There is a reason https://docs.brew.sh/Installation#untar-anywhere says "One of the reasons Homebrew just works relative to the competition is because we recommend installing here. Pick another prefix at your peril!". The right solution might be to manage the required packages with homebrew, but having more than one homebrew install is a pain. Even for the one use case where we support it (arm with Rosetta) there is a lot of custom code involved to make it work. |
Beta Was this translation helpful? Give feedback.
-
Could you explain how to reproduce this? I tried to, and found that |
Beta Was this translation helpful? Give feedback.
-
This is intentional, sorry. We don't want it to be easy to swap out e.g.
This would be what I'd recommend in this situation. I appreciate it's not fun but, yes, this is probably the best bet if you want to built binaries for a non-default cellar/prefix. |
Beta Was this translation helpful? Give feedback.
-
I have a peculiar use case which, as of now, requires a lot of menial work that I believe can be reduced somehow.
There are a few pieces of in-house software distributed within the company. They pull in quite a bit of open-source dependencies, which to date are best managed with Homebrew. The installation I'm making is a Homebrew installation which lives in a prefix of its own and is completely self-contained — that is, it doesn't interfere with a regular installation the user might have.
To scale such an installation, building bottles is necessary. And this is the moment where an ungodly amount of work comes in.
There are formulae which are non-relocatable. For them, I make my own tap. The bottles containing these formulae are being downloaded from an alternative locations, and are installed into
/opt/my-stuff
. The most notable of these arepkg-config
,[email protected]
,gettext
, and[email protected]
. But then, once I build these bottles, I'd like other formulae which use those as dependencies, to latch onto my builds and not those from core... which is impossible unless I pull them into my tap and correct their dependencies. And then the formulae which depend on these, and so it goes. If I miss one dependency, it will start to build the whole chain from source, starting withpkg-config
, and then create problems on the way because it's going to bump intomy-stuff/pkg-config
.Note that above also applies to relocatable formulae, which otherwise would need no rebuilding!
At the end of the day, I ended up having to bottle and vendor into my tap around 50 formulae, including Rust compiler. Managing updates to those is far from being fun.
Also, there seems to exist a bug in how Homebrew makes bottles, because custom prefixes don't get into the bottles themselves, and then Homebrew denies to pour such bottles, claiming they have been built for the default prefix (/usr/local). I mitigated this by patching Homebrew so that its default prefix can be changed using an environment variable.
Still I think that a lot of work could be avoided if Homebrew supported custom prefixes as first-class citizens, and also enabled some kind of overrides which would give an alternative view of formulae — so that instead of pulling in 50 formulae, only a few would need it.
Mildly related:
Beta Was this translation helpful? Give feedback.
All reactions