GNOME Bugzilla – Bug 775668
Fix wrong exception type breaking sysdeps --install
Last modified: 2017-04-26 04:27:21 UTC
(disclaimer: I have no idea what I'm talking about! I just wanted to build something, not fix the build system. :D) My attempt at jhbuild sysdeps --install failed with an unhandled subprocess.CalledProcessError. As mcatanzaro immediately noticed, systeminstall.py tries to work around things like this by passing on OSError, but that isn't what pkg-config throws if deps are missing. I don't really know what wizardry is going on in there, but I can say that the attached patch enables me to get a lot further on (...until I get a different error, but that one looks like Debian's fault, so that's OK!)
Created attachment 341436 [details] [review] sys'install: Catch right exception from pkg-config
Review of attachment 341436 [details] [review]: Well pkg-config is not raising the exception. Just change the commit message: "catch right exception from subprocess"
Created attachment 341437 [details] [review] sys'install: Catch right exception from subprocess Told you I didn't know what I was talking about. :)
Review of attachment 341437 [details] [review]: OK
This broke jhbuild on macOS for me. Could it be that some versions of Python will throw CalledProcessError and some will throw OSError in this case, or that it's platform-dependent? I get "OSError: File not found" if pkg-config isn't installed, on Python 2.7.10.
Created attachment 350368 [details] [review] systeminstall: Catch both CalledProcessError and OSError It seems that either one may be thrown under different circumstances.
Review of attachment 350368 [details] [review]: Makes sense to me of course, but will let someone else ack. Thanks!
Attachment 350368 [details] pushed as 31c8983 - systeminstall: Catch both CalledProcessError and OSError