-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
glib: propagate dependency on pcre #15046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
glib is configured to use the system libpcre. pcre is listed as a private dependency in glibs .pc file but nixos has no such distinction.
By analyzing the blame information on this pull request, we identified @vcunat, @urkud and @lethalman to be potential reviewers |
Thanks, I ran into a similar issue just yesterday |
What's the issue? Most probably this is i not the right fix, given glib never had to propagate pcre. What's the error specifically? |
I will review if propagating is the right decision. From (Compiling the GLib package: GLib Reference Manual)[https://developer.gnome.org/glib/stable/glib-building.html]:
So it would probably be better to use the internal pcre version in the first place. |
I tested GRegex without the propagated libpcre and it seemed to work. What led me to believe propagation was required is the output of CMake when including glib-2.0:
I'm absolutely clueless if this is a bug in autoconf/pkg-config (should ignore Requires.private completely when building shared?) or whether .pc files should be available even for private dependencies. Any thoughts? |
We already have a patch changing the private deps somehow, in |
But I wonder why we're having problems with it right now... what changed since few weeks? Glib obviously has always been linked to other programs with pkgconfig. |
@lethalman The change was introduced in 6b8a8ca and merged with closure-size into master |
I agree the changes are likely from closure-size merge – there were also later commits adding the pcre dependency back after "splitting" pcre. |
@vcunat what about avoid touching pkgconfig and removing pcre from glib private require? It's clearly put by glib devs here https://github.com/GNOME/glib/blob/master/glib-2.0.pc.in but there's no need in nix because glib links directly to libpcre, and libpcre headers are not exposed. |
IIRC |
From https://people.freedesktop.org/~dbn/pkg-config-guide.html: Given
|
Ah looks like it only happens with cmake projects... like this: http://hydra.nixos.org/build/36252754/log/raw |
And I think it's because of this line: https://github.com/Kitware/CMake/blob/d08281094948eaefb495040f4a7bb45cba17a5a7/Modules/FindPkgConfig.cmake#L119 Looks like So looks like if we ever want to support static linking we still need to use |
Ah, apparently cmake always prepares variables for both cases. The PR will increase build-time closure, but I can't see a better solution ATM. |
@vcunat shall this go to staging first? |
Yes, better that way, I think. |
If it's a cmake problem, wouldn't it be better to fix cmake? Propagated build inputs are not a good idea in general... |
@edolstra it's not a problem. We need a policy about support for static builds. If you want to do a static build you need that pcre being propagated. |
Well, it's true that first we would need |
Was there consensus on this? Looks to me like a different solution is preferred? |
Last time nobody responded so closing this now. |
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)glib is configured to use the system libpcre.
pcre is listed as a private dependency in glibs .pc file but nixos has no such distinction.