Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libxml2 --with-python doesn't build; here's why and how to fix it. #1060

Open
gsteemso opened this issue Jan 25, 2024 · 2 comments
Open

libxml2 --with-python doesn't build; here's why and how to fix it. #1060

gsteemso opened this issue Jan 25, 2024 · 2 comments

Comments

@gsteemso
Copy link
Contributor

(I wanted to submit this as a proper pull request, but I'm still debugging some of the formulæ for various dependencies of git.)

In brief, if you install libxml2 --with-python, it gives you a huge blaring error message about not being able to see the installed Python packages, then dies messily.

It turns out those two things are unrelated. The huge blaring error message is, while technically correct, actually supposed to be that way -- libxml2 is a keg-only brew, and your python is not supposed to be able to see those packages unless you explicitly show them to it. Despite the huge "BUILD FAILED" message, it does in fact install successfully if you make the OTHER fix.

The reason it dies messily right before completion is that the Python installer script is supposed to be run by python3, not by python. Adding a conditional dependency on python3 if --with-python was specified, and tweaking the appropriate system statement to use it, makes it install flawlessly... aside from the huge glaring failure message, of course, but there's not much to be done about that.

@gsteemso
Copy link
Contributor Author

I'd also like to note that the python bindings installer is written to do bindings for libxslt at the same time, if it could see that library. Apparently they come from the same project?

Basically, I'm curious as to why libxml2 and libxslt are packaged as separate formulæ. One is a dependency of the other and neither is particularly large. What benefit accrues from making them separate packages, that outweighs the ability to use libxslt from within Python? (If, you know, somebody wanted to do that; I don't use Python enough to know whether that might be a plausible scenario.)

@gsteemso
Copy link
Contributor Author

If the only reason is that people need to be able to find 'libxslt' as its own search term... given that it already depends on libxml2, I would suggest giving the libxml2 formula a --with-xslt option and then making the libxslt formula - if explicitly installed - reinstall libxml2 with that option. Then, if either one had been specified as --with-python, they both would get the appropriate bindings.

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

No branches or pull requests

1 participant