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 683832 - jhbuild crashes if there isn't an installed pkg-config
jhbuild crashes if there isn't an installed pkg-config
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
3.6.x
Other Mac OS
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2012-09-11 23:30 UTC by John Ralls
Modified: 2012-09-30 12:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Provide an empty installed_pkgconfig list in get_installed_pkgconfigs raises an exception (1.43 KB, patch)
2012-09-11 23:33 UTC, John Ralls
needs-work Details | Review

Description John Ralls 2012-09-11 23:30:31 UTC
Traceback (most recent call last):
  • File "/Users/john/.local/bin/jhbuild", line 31 in <module>
    jhbuild.main.main(sys.argv[1:])
  • File "/Users/john/Source/jhbuild/jhbuild/main.py", line 148 in main
    rc = jhbuild.commands.run(command, config, args, help=lambda: print_help(parser))
  • File "/Users/john/Source/jhbuild/jhbuild/commands/__init__.py", line 183 in run
    return cmd.execute(config, args, help)
  • File "/Users/john/Source/jhbuild/jhbuild/commands/__init__.py", line 52 in execute
    return self.run(config, options, args, help)
  • File "/Users/john/Source/jhbuild/jhbuild/commands/base.py", line 257 in run
    module_state = module_set.get_module_state(full_module_list)
  • File "/Users/john/Source/jhbuild/jhbuild/moduleset.py", line 188 in get_module_state
    installed_pkgconfig = systeminstall.get_installed_pkgconfigs(self.config)
  • File "/Users/john/Source/jhbuild/jhbuild/utils/systeminstall.py", line 32 in get_installed_pkgconfigs
    proc = subprocess.Popen(['pkg-config', '--list-all'], stdout=subprocess.PIPE, env=config.get_original_environment(), close_fds=True)
  • File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679 in __init__
    errread, errwrite)
  • File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228 in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Not having an installed pkg-config is the starting condition for OSX and Win32, so it's not a reasonable dependency.
Comment 1 John Ralls 2012-09-11 23:33:33 UTC
Created attachment 224059 [details] [review]
Provide an empty installed_pkgconfig list in get_installed_pkgconfigs raises an exception
Comment 2 Craig Keogh 2012-09-30 12:28:46 UTC
Review of attachment 224059 [details] [review]:

Thank you for the patch.

::: jhbuild/moduleset.py
@@ +189,3 @@
+        try:
+            installed_pkgconfig = systeminstall.get_installed_pkgconfigs(self.config)
+        except:

Catch all exception isn't a good idea because it catches Python syntax errors.

@@ +233,3 @@
+                (self.config)
+        except:
+            pass

This repeated code can be avoided by making the required modifications one level up the call stack.
Comment 3 Craig Keogh 2012-09-30 12:30:23 UTC
Thank you for the report and patch. I fixed this in a different way.
http://git.gnome.org/browse/jhbuild/commit/?id=a34a0bfc063d028c34896115c6e63498e05627a3