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, 24 Mar 2015 21:57:17 +0100 Message-ID: <87twxayuz6.fsf@gnu.org> References: <87d2444stf.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]:39475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaVt5-0008Mi-R3 for guix-devel@gnu.org; Tue, 24 Mar 2015 16:57:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaVt2-0001zm-LN for guix-devel@gnu.org; Tue, 24 Mar 2015 16:57:23 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaVt2-0001zi-Ik for guix-devel@gnu.org; Tue, 24 Mar 2015 16:57:20 -0400 In-Reply-To: <87d2444stf.fsf@taylan.uni.cx> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Thu, 19 Mar 2015 21:48:28 +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: > If I'm reading pkg-config documentation[0] right, Requires are full > run-time dependencies, meaning if a program uses libfoo which Requires > libbar, the program will also want/have to use libbar's interface; OTOH > Requires.private are "link-time" dependencies, i.e. libfoo dynamically > links to libbar, so libbar needs to exist on the system at run-time, but > a program using libfoo needn't use libbar's interface. My reading of pkg-config(1) is that Requires.private is taken into account only for =E2=80=98pkg-config foo --static --cflags/--libs=E2=80=99: Requires.private: A list of packages required by this package. The difference from Requires is that the packages listed under Requires.private are not taken into account when a flag list is computed for dynamically linked executable (i.e., when --static was not specified). This is analogous to Libs.private in that regard. In practice, we usually only care about shared libraries, thus... > This would mean that Requires should be propagated inputs, and > Requires.private only normal inputs; ... is mostly correct. =E2=80=9CMostly,=E2=80=9D because it might be that,= unless --static is passed, things in Requires.private don=E2=80=99t even need to be present. Do you have an example of a package that uses Requires.private? > However, pkg-config isn't aware of compile-time/run-time dependency > differences; it's considered an error if a Requires.private of libfoo > isn't found, Really, even without --static? > because as far as pkg-config is concerned, it means libfoo is > dysfunctional. So we *do* need to propagate Requires.private, for the > sake of pkg-config. (The problem mainly manifests in the form of > ./configure scripts claiming libfoo isn't found when it's only libbar > that's missing, because in that case pkg-config returns an error to > the ./configure script when inquired about libfoo.) Do you have an example of that? > 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. Would be neat! Thanks, Ludo=E2=80=99.