Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Ice formula broken by forcing use of system python #29054

Closed
ghost opened this issue May 8, 2014 · 3 comments
Closed

Ice formula broken by forcing use of system python #29054

ghost opened this issue May 8, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented May 8, 2014

Hi,

#28870 broke all the systems we have deployed which make heavy use of the Ice formula and its python bindings (and will break all our users' systems too). We rely on being able to build everything against the homebrew python when available, and this has broken everything. We also have documentation published for several releases which is also broken in addition to the systems.

While building against the system python works, the package is then unusable without manually setting the PYTHONPATH for every single package, which is unsuitable for trying to deploy stuff. For all formulas which build python modules, the system python is a poor second choice over the homebrew python for this reason. If you could ensure that the homebrew python paths were automatically set for the system python, that might change, but right now this is causing significant problems.

Please consider reverting the change.

Thanks,
Roger

@MikeMcQuaid
Copy link
Member

Hi Roger,

You can read here more about our plans for some of the Python formulae moving forward:
#27112

#28870 broke all the systems we have deployed which make heavy use of the Ice formula and its python bindings (and will break all our users' systems too)

I'd advise you not to upgrade all your production systems to Homebrew without testing this stuff first.

We rely on being able to build everything against the homebrew python when available, and this has broken everything.

As mentioned in #27112 the new policy (slowly being implemented):

  • Packages which use Python but don't provide Python bindings will always use the system Python
  • Packages with optional Python bindings will default to :optional and will use whatever Python is installed
  • Packages which are only or mostly Python bindings (e.g. PyQt) will be always on (no :optional or :recommended unless choosing between Python 2 and 3) and will be bottled against the Homebrew Python and will use whatever Python is installed when building from source

While building against the system python works, the package is then unusable without manually setting the PYTHONPATH for every single package, which is unsuitable for trying to deploy stuff.

This is not the case. As the caveats state you need to create a single .pth file which will handle all linked formulae. You can handle any unlinked/keg-only formulae by adding them to this file.

For all formulas which build python modules, the system python is a poor second choice over the homebrew python for this reason.

That's operating under the assumption that anyone who uses a package with Python bindings (e.g. Boost) will use the Python bindings. That's not correct, I'm afraid.

This all said I've made ice consistent with what I've mentioned above in d57cea3 by making the bindings optionally installed with --with-python. If you have similar issues in future the quickest way of resolving them is creating a similar PR.

Thanks!

@ghost
Copy link
Author

ghost commented May 8, 2014

@MikeMcQuaid Hi there. You're right that production systems shouldn't be upgraded without testing. We have two types of CI node: ones which do a daily wipe and rebuild of our homebrew dependencies to make sure our projects build with a current homebrew, and ones which are upgraded less frequently. It's the former which are affected at present, and catching stuff like this is indirectly part of their job. The other reason for doing this is that any end user who follows our instructions for deploying on homebrew will currently find them broken; that's the larger issue. We need to make sure that the current state of homebrew is functional since this is what an end user deploying our projects will experience.

Thanks for the links, it's interesting reading. And I've experienced issues with python when updating the ice.rb formula in the past, so I can certainly sympathise with this being a bit of a can of worms.

However, I think that the thinking that there are different classes of python user and that developers are a special case is wrong. Yes, I'm a developer and I might need to jump through hoops to get the Ice python bindings working. But our end-users are not, yet they will be forced to go through the same hoops. Whether I'm using a python module as a developer or indirectly as a user, there's no difference in how I install it. I really think that python stuff, be it scripts or modules, should work out of the box irrespective of whether they are optional or not. Setting PYTHONPATH is full of gotchas, as noted. Setting a .pth file is a good alternative, but only if it's completely transparent; this still isn't something an end user should be forced to do manually.

Thanks for the patch to make the Ice python bindings optional so we at least have the choice here. It would be nice if this could be set across the board so that all python-using formulas can be made to use homebrew python.

Many thanks,
Roger

@MikeMcQuaid
Copy link
Member

We're not making it so all python-using formulae can use Homebrew Python, I'm afraid. Making other formulae :optional will be happening at some point in the future. We'll review requests to change other individual formulae on a case-by-case basis. Thanks!

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 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

1 participant