unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Taylan Ulrich \"Bayırlı/Kammer\"" <taylanbayirli@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: pkg-config "Requires" fields and propagated inputs
Date: Tue, 31 Mar 2015 14:14:27 +0200	[thread overview]
Message-ID: <87pp7pcqjg.fsf@gnu.org> (raw)
In-Reply-To: <87iodnh0we.fsf@taylan.uni.cx> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Thu, 26 Mar 2015 23:03:29 +0100")

taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") skribis:

> taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:
>
>> P.S.: I'll see if I can write a tool that compares the union of the
>> Requires[.private] fields of all .pc files in a package to the package's
>> propagated inputs, so we can detect mismatches automatically.
>
> So here's a first version.
>
> https://notabug.org/taylanub/guix/src/master/missing-propagated-inputs.scm
>
> Sample output from my system is below; evidently it's open to some
> improvement.

Nice!

> 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.

> $ ./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.)

> "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.)

> "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.

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


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

WDYT?

Thank you!

Ludo’.

  reply	other threads:[~2015-03-31 12:14 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 [this message]
2015-04-29 20:17     ` Taylan Ulrich Bayırlı/Kammer
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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87pp7pcqjg.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=taylanbayirli@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).