After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775668 - Fix wrong exception type breaking sysdeps --install
Fix wrong exception type breaking sysdeps --install
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2016-12-05 21:31 UTC by Daniel Boles
Modified: 2017-04-26 04:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sys'install: Catch right exception from pkg-config (1.23 KB, patch)
2016-12-05 21:33 UTC, Daniel Boles
none Details | Review
sys'install: Catch right exception from subprocess (1.23 KB, patch)
2016-12-05 21:36 UTC, Daniel Boles
committed Details | Review
systeminstall: Catch both CalledProcessError and OSError (1.38 KB, patch)
2017-04-25 06:35 UTC, Philip Chimento
committed Details | Review

Description Daniel Boles 2016-12-05 21:31:08 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!)
Comment 1 Daniel Boles 2016-12-05 21:33:00 UTC
Created attachment 341436 [details] [review]
sys'install: Catch right exception from pkg-config
Comment 2 Michael Catanzaro 2016-12-05 21:34:47 UTC
Review of attachment 341436 [details] [review]:

Well pkg-config is not raising the exception. Just change the commit message: "catch right exception from subprocess"
Comment 3 Daniel Boles 2016-12-05 21:36:40 UTC
Created attachment 341437 [details] [review]
sys'install: Catch right exception from subprocess

Told you I didn't know what I was talking about. :)
Comment 4 Michael Catanzaro 2016-12-05 21:37:51 UTC
Review of attachment 341437 [details] [review]:

OK
Comment 5 Philip Chimento 2017-04-25 06:33:35 UTC
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.
Comment 6 Philip Chimento 2017-04-25 06:35:22 UTC
Created attachment 350368 [details] [review]
systeminstall: Catch both CalledProcessError and OSError

It seems that either one may be thrown under different circumstances.
Comment 7 Daniel Boles 2017-04-25 08:57:47 UTC
Review of attachment 350368 [details] [review]:

Makes sense to me of course, but will let someone else ack. Thanks!
Comment 8 Philip Chimento 2017-04-26 04:27:17 UTC
Attachment 350368 [details] pushed as 31c8983 - systeminstall: Catch both CalledProcessError and OSError