all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: pkg-config "Requires" fields and propagated inputs
Date: Wed, 29 Apr 2015 22:17:42 +0200	[thread overview]
Message-ID: <87fv7ieljt.fsf@taylan.uni.cx> (raw)
In-Reply-To: <87pp7pcqjg.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 31 Mar 2015 14:14:27 +0200")

Picking this topic back up after some things got in between:

ludo@gnu.org (Ludovic Courtès) writes:

> taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:
>
>> Maybe I should try to move to a strategy that calls pkg-config instead
>> of parsing the files in Guile, but it might be nontrivial to get the
>> PKG_CONFIG_PATH right for each call, and doing many execs might be too
>> slow, so I'll first see how much further I can get with this strategy.
>
> Yeah forking would be slow; parsing sounds good.  However, the ‘satisfy’
> predicates could be based on actual package contents (when available):
> looking for actual .pc files and libraries.

I overhauled the strategy somewhat, and indeed look for actual .pc files
(under $prefix/lib/pkgconfig directories) and libfoo.so files (under
$prefix/lib directories) now.  For .pc files, the extension is stripped,
for libfoo.so files, the foo part is taken.  These then serve as exact
pkg-config package names and library names respectively, making
everything more robust.  Thanks for the idea!

>> $ ./pre-inst-env guile -c '((@ (guix missing-propagated-inputs) print-missing-propagated-inputs))'
>> "fftw": ("-lfftw3" "-lm")
>> "fftwf": ("-lfftw3f" "-lm")
>
> This is a false positives: -lfftw3* is actually provided by the package
> itself, and -lm is part of libc, so it’s always found (libc libraries
> will have to be special-cased.)

Libc components are now handled.  The fftw3 stuff is handled fine under
the new strategy.

>> "apr": ("-ldl" "-lpthread" "-lcrypt" "-lrt" "-lapr-${APR_MAJOR_VERSION}")
>
> Again libc libraries, and the library of APR itself.  Problem is that
> this one requires almost a full reimplementation of pkg-config, to be
> able to do variable substitution (probably not insurmountable though.)

Implementing variable substitution was fairly straightforward, so these
are fine now.

>> "guile": ("-lgc" "-lffi")
>
> guile-2.0.pc has this:
>
>   Libs: -L${libdir} -lguile-2.0 -L/gnu/store/dxfv00pgmnhxkj5jh3yxyp0q94l6i2ch-libgc-7.4.2/lib -lgc
>
> So here -lgc is a false positive: libgc is found by virtue of the -L
> flag.

The -L flags are handled too now; the directory they point at is handled
equivalently to $prefix/lib directories under the new strategy.
(I.e. they're scanned for libfoo.so files.)

> ‘-lffi’ only appears in ‘Libs.private’ (static linking) so I would just
> ignore it.

You're right; unlike Requires.private, Libs.private has no effect on
e.g. pkg-config --exists, so it's really only for static linking; I
removed the parsing of Libs.private fields.

> It looks like there are 3 classes of false positives here that would
> need to be addressed to make the report more directly readable.

I think all these false positives are fixed now!

New sample output from my machine:

portaudio: pkg-config: () libs: ("asound")
avahi: pkg-config: ("glib-2.0" "gobject-2.0" "glib-2.0") libs: ()
libatomic-ops: pkg-config: () libs: ("atomic_ops")
ijs: pkg-config: () libs: ("ijs")
mesa: pkg-config: ("xcb-dri3" "xcb-dri2" "libudev" "xcb-dri3" "xcb-dri2") libs: ()
dbus-glib: pkg-config: ("gobject-2.0" "glib-2.0" "dbus-1") libs: ()
libcroco: pkg-config: ("libxml-2.0" "glib-2.0") libs: ()
gst-plugins-base: pkg-config: ("gio-2.0" "glib-2.0" "gio-2.0") libs: ()
harfbuzz: pkg-config: ("icu-uc") libs: ()
gtk+: pkg-config: ("gio-2.0" "cairo" "gio-2.0" "cairo" "gio-2.0" "cairo") libs: ()
pango: pkg-config: ("gobject-2.0" "glib-2.0" "gmodule-no-export-2.0" "fontconfig" "freetype2" "xft") libs: ()
cairo: pkg-config: ("xcb-shm" "xcb-render" "xcb-render") libs: ("z" "z")
eudev: pkg-config: ("gobject-2.0" "glib-2.0") libs: ()
qpdf: pkg-config: ("zlib") libs: ()
poppler: pkg-config: ("cairo" "cairo" "gio-2.0" "gobject-2.0" "glib-2.0") libs: ()
pulseaudio: pkg-config: ("glib-2.0") libs: ()
libdvdnav: pkg-config: ("dvdread") libs: ()
libxslt: pkg-config: ("libxml-2.0" "libxml-2.0") libs: ("z" "z")
libxv: pkg-config: ("xproto" "xext" "x11") libs: ()
libx11: pkg-config: ("xproto") libs: ()
libxmu: pkg-config: ("xt" "x11" "xproto" "xext" "xt" "x11" "x11" "xproto" "x11") libs: ()
libxinerama: pkg-config: ("xext" "x11") libs: ()
libxft: pkg-config: ("xproto") libs: ()
libxext: pkg-config: ("x11") libs: ()
libxaw: pkg-config: ("xproto" "x11" "xproto" "x11") libs: ()
libxdmcp: pkg-config: ("xproto") libs: ()
libxpm: pkg-config: ("x11" "x11") libs: ()
libxkbfile: pkg-config: ("kbproto" "x11") libs: ()
xkbcomp: pkg-config: ("x11") libs: ()
libxxf86vm: pkg-config: ("x11") libs: ()
libxrender: pkg-config: ("x11" "xproto" "x11") libs: ()
libxfixes: pkg-config: ("xproto" "x11") libs: ()
libxt: pkg-config: ("xproto") libs: ()
libsm: pkg-config: ("xproto") libs: ()

Taylan

  reply	other threads:[~2015-04-29 20:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 20:48 pkg-config "Requires" fields and propagated inputs Taylan Ulrich Bayırlı/Kammer
2015-03-24 20:57 ` Ludovic Courtès
2015-03-24 22:52   ` Taylan Ulrich Bayırlı/Kammer
2015-03-25 16:56     ` Ludovic Courtès
2015-03-25 19:48       ` Taylan Ulrich Bayırlı/Kammer
2015-03-26 22:03 ` Taylan Ulrich Bayırlı/Kammer
2015-03-31 12:14   ` Ludovic Courtès
2015-04-29 20:17     ` Taylan Ulrich Bayırlı/Kammer [this message]
2015-05-03 19:48       ` Ludovic Courtès
2015-05-03 20:57         ` Taylan Ulrich Bayırlı/Kammer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fv7ieljt.fsf@taylan.uni.cx \
    --to=taylanbayirli@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.