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 655553 - sysdeps: Do not use jhbuilt pkg-config
sysdeps: Do not use jhbuilt pkg-config
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2011-07-29 07:57 UTC by Vincent Untz
Modified: 2015-01-06 20:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
systeminstall: use the jhbuilt pkg-config again (1.72 KB, patch)
2015-01-06 19:59 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Vincent Untz 2011-07-29 07:57:38 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'
Comment 1 Vincent Untz 2011-07-29 07:59:34 UTC
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.
Comment 2 Vincent Untz 2011-07-29 08:03:40 UTC
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?
Comment 3 Colin Walters 2011-07-29 15:22:10 UTC
(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.
Comment 4 Vincent Untz 2011-07-29 17:14:23 UTC
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.
Comment 5 Colin Walters 2011-07-29 17:28:46 UTC
(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.
Comment 6 Vincent Untz 2011-07-29 17:32:15 UTC
(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.
Comment 7 Craig Keogh 2011-08-24 07:29:12 UTC
(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
Comment 8 Vincent Untz 2011-09-02 07:28:48 UTC
(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.
Comment 9 Craig Keogh 2011-09-02 12:16:20 UTC
Thank you for your help tracking it down. Fixed.
http://git.gnome.org/browse/jhbuild/commit/?id=98860ad416959f4dbab072aad76064c0dc3861b0
Comment 10 Allison Karlitskaya (desrt) 2014-12-24 15:24:02 UTC
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.
Comment 11 Frederic Peters 2015-01-06 18:55:57 UTC
In light of 1) I would be fine reverting this.
Comment 12 Allison Karlitskaya (desrt) 2015-01-06 19:59:49 UTC
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 13 Allison Karlitskaya (desrt) 2015-01-06 20:00:17 UTC
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