Homebrew-core: GLib 2.60.0 depends on *python*

Created on 6 Mar 2019  ·  14Comments  ·  Source: Homebrew/homebrew-core

Upgrading 1 outdated package:
glib 2.58.3 -> 2.60.0
==> Upgrading glib
==> Installing dependencies for glib: python
==> Installing glib dependency: python
==> Downloading https://homebrew.bintray.com/bottles/python-3.7.2_2.hig
[...]
==> Pouring python-3.7.2_2.high_sierra.bottle.tar.gz
Error: An unexpected error occurred during the brew link step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Warning: Skipping glib: most recent version 2.60.0 not installed

This surely is a joke, right? glib depending on python? I do not want python, I want a low level C library. I am kind of glad Homebrew did not create a /usr/local/Frameworks when I installed it the first time around, so I avoided that plague of a useless python installation.

Most helpful comment

I understand that you're not happy about this, but we are just packaging glib, not developing it, so we cannot be held responsible for a decision made by the GNOME devs.

I recommend you open an issue on the official GNOME Glib bug tracker.

All 14 comments

poke @tschoonj on that one

No, the new version has a hard dependency on python3, sorry... it is used in some of the utilities like glib-mkenums.

See https://github.com/GNOME/glib/blob/62bd79b6a2d9eb9c2f11bbf7b701aa35291bac1c/meson.build#L1881-L1891 for the meson.build code responsible for it...

glib now requires python 3, and macOS doesn't provide it. Indeed there's little we can do here.

Not beating a dead horse here, but is it documented somewhere how best to deal with dependencies like these for those of us who manage Python installations outside of Homebrew? In the past I've been surprised by a Homebrew formula changing to pull in Python, which can interfere with installations elsewhere. I seem to remember there was some way to let it install but then render Python invisible to anything other than Homebrew; that might be a helpful thing to put front and center in the documentation, especially with the removal of a lot of build options that make it so more packages are pulling in Python surprisingly. (cf #36124)

I'm not saying it isn't the right choice, but given the potential to interfere with outside installations, it might be worth communicating ways of working around it. (I actually have a wrapper script around brew that checks dependencies and stops me if I'm accidentally about to install Python/Node/etc. but got surprised by this one because it wasn't filtering upgrade commands.)

If you change the shebang in these scripts from #!/usr/bin/env python3 to #!/usr/local/opt/python/bin/python3 you could safely unlink python3 and they would still work.

IMHO the real problem here is that Apple is stubbornly refusing to ship a python3 interpreter themselves with macOS.

If you change the shebang in these scripts from #!/usr/bin/env python3 to #!/usr/local/opt/python/bin/python3 you could safely unlink python3 and they would still work.

Ah, right, it was unlinking. That's the bit I was looking for, saying it might be worth documenting more prominently as an "if you manage Python installations outside of Homebrew, this could help..." kind of thing.

That said, changing those build scripts in glib isn't the best or most sustainable option either... I can give my own installation of Python 3 precedence in my path, but then /usr/bin/env python3 would return my outside installation of it, which might not be the version that glib is expecting anyway. It just keeps getting trickier to maintain Python environments outside of Homebrew. :-/ (I know that's a minority case, but it used to be easier than it is now.)

IMHO the real problem here is that Apple is stubbornly refusing to ship a python3 interpreter themselves with macOS.

Yeah, I'm hoping with the impending EOL of Python2 that they get on it, but not holding my breath.

Not beating a dead horse here, but is it documented somewhere how best to deal with dependencies like these for those of us who manage Python installations outside of Homebrew?

Put your Python installations before Homebrew's Python installations in your $PATH and it will work as expected. We print something similar for keg-only packages; where would you look for documentation for this more generally?

Put your Python installations before Homebrew's Python installations in your $PATH and it will work as expected.

Does that have the potential to interfere when Homebrew runs a package's build scripts, though? Or does the Homebrew build environment set its own $PATH?

where would you look for documentation for this more generally?

Something in the Homebrew FAQ would probably be good!

Does that have the potential to interfere when Homebrew runs a package's build scripts, though? Or does the Homebrew build environment set its own $PATH?

No, Homebrew manages its own PATH so you can set yours to whatever you want. If there's any parts of Homebrew that complain: let us know and we'll fix them.

Something in the Homebrew FAQ would probably be good!

Cool, thanks 👍

No, Homebrew manages its own PATH so you can set yours to whatever you want.

Ah, that's good to know. Thanks, Mike!

This is unfortunate. A small tool like midnight commander now requires yet another runtime (Python) because of glib dependency.

I understand that you're not happy about this, but we are just packaging glib, not developing it, so we cannot be held responsible for a decision made by the GNOME devs.

I recommend you open an issue on the official GNOME Glib bug tracker.

As I started the thread I might chime in. The glib development is what it is (I am nagging the folks at GNOME though), the latest glib could not even get python installed as a dependency because /usr/local/Frameworks does not exist in my (admittedly quite old) homebrew installation.

Having said that after my complaint either python got installed in Cellar or it was dropped (or I had python installed in Cellar already -- without having noticed I did), but irrespectively glib upgraded to the latest without trying to install python in /usr/local/Frameworks

Locking the conversation to avoid a potential string of “I would rather glib not use Python” comments, since there is nothing Homebrew can do about it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakepetroules picture jakepetroules  ·  3Comments

BluePawDev picture BluePawDev  ·  3Comments

xeoneux picture xeoneux  ·  3Comments

faraazkhan picture faraazkhan  ·  3Comments

bantl23 picture bantl23  ·  3Comments