GNOME Bugzilla – Bug 655553
sysdeps: Do not use jhbuilt pkg-config
Last modified: 2015-01-06 20:00:17 UTC
vuntz@etaules ~/>ls /usr/lib/pkgconfig/dbus-1.pc /usr/lib/pkgconfig/dbus-1.pc vuntz@etaules ~/>pkg-config --modversion dbus-1 1.5.4 vuntz@etaules ~/>jhbuild sysdeps [...] No matching system package installed: dbus-1 (required=1.4.0) I see the same issue with other pkg-config files. This definitely comes from the SystemInstall.get_installed_pkgconfigs() method, since playing with the env variable there can make this work. For instance, instead of doing: del env['PKG_CONFIG_PATH'] it will work if I change that to: env['PKG_CONFIG_PATH'] = '/usr/lib/pkgconfig'
Ah, found the issue: proc = subprocess.Popen(['pkg-config', '--list-all'], stdout=subprocess.PIPE, env=env, close_fds=True) This will call pkg-config from my jhbuild prefix, instead of the system one. And so it won't look at the system path if PKG_CONFIG_PATH is unset.
Not sure what's best: hard-coding /usr/bin/pkg-config, hard-coding $PATH in env to /usr/bin:/bin (and more), removing the jhbuild prefix from $PATH, etc. This all sounds hacky... Opinions?
(In reply to comment #2) > Not sure what's best: hard-coding /usr/bin/pkg-config, hard-coding $PATH in env > to /usr/bin:/bin (and more), removing the jhbuild prefix from $PATH, etc. > > This all sounds hacky... Opinions? I think we should explicitly save the original environment in config.py, and keep it around for this purpose.
This is still not good, as we're still using the jhbuilt pkg-config. For instance: vuntz@etaules ~/>pkg-config --modversion webkitgtk-3.0 1.5.1 vuntz@etaules ~/>jhbuild sysdeps | grep webkit webkitgtk-3.0 (required=1.5.1, installed=1.3.12) It turns out I do have webkitgtk 1.3.12 installed in my jhbuild, which is why the jhbuilt pkg-config find this version. Interestingly, the behavior, even if buggy, could make sense, since building with jhbuild would use webkit 1.3.12. But anyway, the output of sysdeps is wrong in this case.
(In reply to comment #4) > This is still not good, as we're still using the jhbuilt pkg-config. Oh, are you already inside a jhbuild shell? Yeah, in that case we pretty much have to hardcode /bin /usr/bin I think.
(In reply to comment #5) > (In reply to comment #4) > > This is still not good, as we're still using the jhbuilt pkg-config. > > Oh, are you already inside a jhbuild shell? Yeah, in that case we pretty much > have to hardcode /bin /usr/bin I think. I'm not, but jhbuild will change $PATH before calling this command, I guess.
(In reply to comment #6) > I'm not, but jhbuild will change $PATH before calling this command, I guess. The information you've provided suggests you have /opt/gnome/bin manually set early in your path, or you've manually set PKG_CONFIG_PATH to /opt/gnome/lib64/pkgconfig. If so, what should JHBuild do to help? I think nothing - don't do that :) or Colin's patch [1] doesn't correctly use the original environment. But the patch looks ok to me. [1] http://git.gnome.org/browse/jhbuild/commit/?id=5a1515299de6966f22c63e1d69ab5023206b8613
(In reply to comment #7) > (In reply to comment #6) > > I'm not, but jhbuild will change $PATH before calling this command, I guess. > > The information you've provided suggests you have /opt/gnome/bin manually set > early in your path, or you've manually set PKG_CONFIG_PATH to > /opt/gnome/lib64/pkgconfig. If so, what should JHBuild do to help? I think > nothing - don't do that :) Why is the information I've provided suggesting that? I don't have /opt/gnome/bin set in my path and I didn't change PKG_CONFIG_PATH. However, I'm calling /opt/gnome/bin/jhbuild.
Thank you for your help tracking it down. Fixed. http://git.gnome.org/browse/jhbuild/commit/?id=98860ad416959f4dbab072aad76064c0dc3861b0
I vaguely want to revert this change because I don't think it's required anymore and it's causing trouble. 1) we don't bootstrap anymore, so we don't install our own pkg-config 2) on some systems where we still do bootstrap, it's because we really need to (ie: there is no system pkg-config). I also specifically want 'jhbuild sysdeps' to be able to find the sysdeps that were installed as part of bootstrapping and not complain about them (which requires running pkg-config inside of the jhbuild environment). We could maybe continue to try to solve both problems by taking only PATH from the original environment and pasting it onto the front of the PATH variable from jhbuild. That would find pkg-config from "outside" before finding the one from "inside" but in either case we'd still have the PKG_CONFIG_PATH fully-populated.
In light of 1) I would be fine reverting this.
Created attachment 293969 [details] [review] systeminstall: use the jhbuilt pkg-config again Since we're no longer doing 'jhbuild bootstrap' on "normal" systems, it is safe to go back to using the jhbuilt pkg-config if we have it.
Comment on attachment 293969 [details] [review] systeminstall: use the jhbuilt pkg-config again Attachment 293969 [details] pushed as 02914fc - systeminstall: use the jhbuilt pkg-config again