From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: pkg-config "Requires" fields and propagated inputs Date: Tue, 31 Mar 2015 14:14:27 +0200 Message-ID: <87pp7pcqjg.fsf@gnu.org> References: <87d2444stf.fsf@taylan.uni.cx> <87iodnh0we.fsf@taylan.uni.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycv3z-0003ZF-V9 for guix-devel@gnu.org; Tue, 31 Mar 2015 08:14:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycv3t-0004Ly-TV for guix-devel@gnu.org; Tue, 31 Mar 2015 08:14:35 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycv3t-0004Lu-Qi for guix-devel@gnu.org; Tue, 31 Mar 2015 08:14:29 -0400 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") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Taylan Ulrich =?utf-8?Q?=22Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer=22?= Cc: guix-devel@gnu.org taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/Kammer") skribis: > taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/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 =E2=80=98sat= isfy=E2=80=99 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-mis= sing-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=E2=80=99s always found (libc librari= es 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/dxfv00pgmnhxkj5jh3yxyp0q94l6i2= ch-libgc-7.4.2/lib -lgc=20 So here -lgc is a false positive: libgc is found by virtue of the -L flag. =E2=80=98-lffi=E2=80=99 only appears in =E2=80=98Libs.private=E2=80=99 (sta= tic 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=E2=80=99.