Bug 1422256 - gnutls pc file has incorrect Requires.private statements
Summary: gnutls pc file has incorrect Requires.private statements
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gnutls
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Nikos Mavrogiannopoulos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1424391
TreeView+ depends on / blocked
 
Reported: 2017-02-14 21:59 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2017-02-20 17:46 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-20 07:38:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pkgconf pkgconf issues 114 0 None None None 2017-02-15 07:42:26 UTC

Description Zbigniew Jędrzejewski-Szmek 2017-02-14 21:59:23 UTC
In latest rawhide:
$ rpm -q gnutls-devel
gnutls-devel-3.5.9-1.fc26.x86_64
$ "/usr/bin/pkg-config" "--cflags" "gnutls"
Package libidn2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libidn2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libidn2', required by 'gnutls', not found

This breaks users of gnutls, in particular systemd.

Comment 1 Adam Williamson 2017-02-15 01:15:24 UTC
This could well be the new pkgconf thing, not gnutls' fault?

https://fedoraproject.org/wiki/Changes/pkgconf_as_system_pkg-config_implementation
https://bugzilla.redhat.com/show_bug.cgi?id=1413522

Comment 2 Mamoru TASAKA 2017-02-15 02:55:46 UTC
Rebuild of jd also fails.

Switching to pkgconf, this is due to that pkgconf does not handle Requires.private correctly:
https://people.freedesktop.org/~dbn/pkg-config-guide.html

Comment 3 Mamoru TASAKA 2017-02-15 04:31:05 UTC
For rebuilding jd:

[mockbuild@localhost jd-2.8.9-150226]$ gdb --args pkg-config --cflags --print-errors 'gnutls >= 1.2'
GNU gdb (GDB) Fedora 7.12.1-44.fc26
....
....
(gdb) break pkgconf_pkg_report_graph_error
Function "pkgconf_pkg_report_graph_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (pkgconf_pkg_report_graph_error) pending.
(gdb) r
Starting program: /usr/bin/pkg-config --cflags --print-errors gnutls\ \>=\ 1.2
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.25-1.fc26.x86_64

Breakpoint 1, pkgconf_pkg_walk_list (deplist=0x55555575c680, depth=1999, data=0x0, func=0x0, parent=0x55555575c5b0, 
    client=0x55555575b720 <pkg_client>) at libpkgconf/pkg.c:1253
1253				pkgconf_pkg_report_graph_error(client, parent, pkgdep, depnode, eflags_local);
(gdb) bt
#0  pkgconf_pkg_walk_list (deplist=0x55555575c680, depth=1999, data=0x0, func=0x0, parent=0x55555575c5b0, 
    client=0x55555575b720 <pkg_client>) at libpkgconf/pkg.c:1253
#1  pkgconf_pkg_traverse (client=0x55555575b720 <pkg_client>, root=0x55555575c5b0, func=0x0, data=0x0, maxdepth=1999)
    at libpkgconf/pkg.c:1367
#2  0x00007ffff7b8fc96 in pkgconf_pkg_walk_list (deplist=0x7ffffffedd88, depth=2000, data=0x0, func=0x0, 
    parent=0x7ffffffedcd0, client=0x55555575b720 <pkg_client>) at libpkgconf/pkg.c:1268
#3  pkgconf_pkg_traverse (client=0x55555575b720 <pkg_client>, root=0x7ffffffedcd0, func=0x0, data=0x0, maxdepth=2000)
    at libpkgconf/pkg.c:1359
#4  0x00007ffff7b91ed4 in pkgconf_queue_verify (maxdepth=2000, list=<optimized out>, world=0x7ffffffedcd0, 
    client=0x55555575b720 <pkg_client>) at libpkgconf/queue.c:115
#5  pkgconf_queue_apply (client=0x55555575b720 <pkg_client>, list=<optimized out>, func=0x555555557250 <apply_cflags>, 
    maxdepth=2000, data=0x0) at libpkgconf/queue.c:147
#6  0x0000555555556bb2 in main (argc=<optimized out>, argv=0x7fffffffe658) at main.c:1128

Comment 4 Mamoru TASAKA 2017-02-15 04:34:18 UTC
(gdb) up
#1  pkgconf_pkg_traverse (client=0x55555575b720 <pkg_client>, root=0x55555575c5b0, func=0x0, data=0x0, maxdepth=1999)
    at libpkgconf/pkg.c:1367
1367			eflags = pkgconf_pkg_walk_list(client, root, &root->requires_private, func, data, maxdepth);
(gdb) li
1362	
1363		if (client->flags & PKGCONF_PKG_PKGF_SEARCH_PRIVATE)
1364		{
1365			/* XXX: ugly */
1366			client->flags |= PKGCONF_PKG_PKGF_ITER_PKG_IS_PRIVATE;
1367			eflags = pkgconf_pkg_walk_list(client, root, &root->requires_private, func, data, maxdepth);
1368			client->flags &= ~PKGCONF_PKG_PKGF_ITER_PKG_IS_PRIVATE;
1369	
1370			if (eflags != PKGCONF_PKG_ERRF_OK)
1371				return eflags;

So for unknown reason, PKGCONF_PKG_PKGF_SEARCH_PRIVATE is marked here, which is probably wrong here.

Comment 5 Mamoru TASAKA 2017-02-15 04:47:29 UTC
Ah...
#6  0x0000555555556bb2 in main (argc=<optimized out>, argv=0x7fffffffe658) at main.c:1128
1128			if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_cflags, maximum_traverse_depth, NULL))
(gdb) li
1123	
1124		if ((want_flags & PKG_CFLAGS))
1125		{
1126			pkgconf_client_set_flags(&pkg_client, want_client_flags | PKGCONF_PKG_PKGF_SEARCH_PRIVATE);
1127	
1128			if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_cflags, maximum_traverse_depth, NULL))
1129			{
1130				ret = EXIT_FAILURE;
1131				goto out_println;
1132			}

Apparently main.c:1126 is the culprit.

Comment 6 Mamoru TASAKA 2017-02-15 06:00:13 UTC
Reported upstream:
https://github.com/pkgconf/pkgconf/issues/114

Comment 7 Nikos Mavrogiannopoulos 2017-02-15 10:44:54 UTC
It seems that libidn2 doesn't yet have a libidn2.pc (I was using the git repo which has it, but no release version does). Would it make sense to temporarily drop the libidn2 froms Libs.private to work-around the issue in gnutls?

Comment 8 Zbigniew Jędrzejewski-Szmek 2017-02-15 13:23:20 UTC
(In reply to Nikos Mavrogiannopoulos from comment #7)
> It seems that libidn2 doesn't yet have a libidn2.pc (I was using the git
> repo which has it, but no release version does). Would it make sense to
> temporarily drop the libidn2 froms Libs.private to work-around the issue in
> gnutls?

Seems that's not enough. See http://pkgs.fedoraproject.org/cgit/rpms/systemd.git/commit/?id=d4f0a28c8cdae71933f4a012091c9549c85e22d1, which failed to build.

Comment 9 Igor Gnatenko 2017-02-15 16:59:25 UTC
This is clearly bug in gnutls.

[root@e44c7538a100 /]# cat foo.pc 
Name: foo
Libs: -lfoo
Libs.private: -lbar
Requires.private: bar
[root@e44c7538a100 /]# PKG_CONFIG_PATH=. pkg-config --libs --cflags foo
Package bar was not found in the pkg-config search path.
Perhaps you should add the directory containing `bar.pc'
to the PKG_CONFIG_PATH environment variable
Package 'bar', required by 'foo', not found


This is how old-good-pkg-config worked.

Replace libidn with libidn2 or whatever to fix it.

Comment 10 Fedora Update System 2017-02-16 13:52:33 UTC
gnutls-3.5.9-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-072fe89544

Comment 11 Fedora Update System 2017-02-17 15:26:53 UTC
gnutls-3.5.9-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-072fe89544

Comment 12 Dridi Boukelmoune 2017-02-18 09:38:06 UTC
Hello,

When trying to mockbuild varnish-agent I get a similar complaint at configure-time but more libraries are missing:

    [...]
    Installing  : gnutls-c++-3.5.9-1.fc26.x86_64                 51/117
    [...]
    Installing  : gnutls-dane-3.5.9-1.fc26.x86_64                69/117
    Installing  : gnutls-devel-3.5.9-1.fc26.x86_64               70/117
    Installing  : libmicrohttpd-1:0.9.52-4.fc26.x86_64           71/117
    [...]
    Installing  : libmicrohttpd-devel-1:0.9.52-4.fc26.x86_64    110/117
    [...]
    checking for MICROHTTPD... no
    configure: error: Package requirements (libmicrohttpd) were not met:

    Package nettle was not found in the pkg-config search path.
    Perhaps you should add the directory containing `nettle.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'nettle', required by 'gnutls', not found
    Package 'hogweed', required by 'gnutls', not found
    Package 'libtasn1', required by 'gnutls', not found
    Package 'libidn2', required by 'gnutls', not found
    Package 'p11-kit-1', required by 'gnutls', not found
    Package 'zlib', required by 'gnutls', not found

I'm also getting gnutls via a build requirement on µhttpd.

On my f25 system, it matches all private dependencies, so maybe systemd explicitly requires the others:

    $ pkg-config --print-requires-private gnutls
    nettle
    hogweed
    libtasn1
    libidn
    p11-kit-1
    zlib

Comment 13 Zbigniew Jędrzejewski-Szmek 2017-02-18 14:54:57 UTC
Dridi, in rawhide systemd has no problems with detecting µhttpd and gnutls with the latest gnutls build. See e.g. https://koji.fedoraproject.org/koji/buildinfo?buildID=859753.

Comment 14 Fedora Update System 2017-02-18 18:20:56 UTC
gnutls-3.5.9-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Nikos Mavrogiannopoulos 2017-02-20 07:38:46 UTC
I'm closing it because Dridi you are building against 3.5.9-1 and not the latest 3.5.9-2. If that's not the case please re-open.

Comment 16 Dridi Boukelmoune 2017-02-20 10:06:30 UTC
Nikos, for reasons byond me running `fedpkg mockbuild` still doesn't get the latest package even days after, even after clearing the cache. I tried a scratch build on rawhide and my pkg-config (or pkgconf) failure is gone. Thanks

Comment 17 Adam Williamson 2017-02-20 17:43:49 UTC
https://lists.fedoraproject.org/archives/list/test@lists.fedoraproject.org/message/XHS7K5RH7ROGKGSM5V7HY4BVLEEYMSZV/

You can copy /etc/mock/fedora-rawhide-x86_64.cfg as /etc/mock/fedora-rawhide-x86_64-koji.cfg (etc.) and add this repository definition:

[koji]
name=koji
baseurl=http://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/
cost=2000
enabled=1

then build for fedora-rawhide-x86_64-koji mock target, and your package will build against the actual current Rawhide buildroot.

Comment 18 Dridi Boukelmoune 2017-02-20 17:46:40 UTC
Thanks for the tip, I rarely interact with rawhide outside of `fedpkg build`.


Note You need to log in before you can comment on or make changes to this bug.