From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: pkg-config "Requires" fields and propagated inputs Date: Thu, 19 Mar 2015 21:48:28 +0100 Message-ID: <87d2444stf.fsf@taylan.uni.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYhMn-0006q9-Ao for guix-devel@gnu.org; Thu, 19 Mar 2015 16:48:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYhMm-0005Fd-Ba for guix-devel@gnu.org; Thu, 19 Mar 2015 16:48:33 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:34924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYhMm-0005F7-5O for guix-devel@gnu.org; Thu, 19 Mar 2015 16:48:32 -0400 Received: by wibdy8 with SMTP id dy8so970355wib.0 for ; Thu, 19 Mar 2015 13:48:30 -0700 (PDT) Received: from taylan.uni.cx (p200300514A4A861F0213E8FFFEED36FB.dip0.t-ipconnect.de. [2003:51:4a4a:861f:213:e8ff:feed:36fb]) by mx.google.com with ESMTPSA id gd6sm125587wib.17.2015.03.19.13.48.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 13:48:30 -0700 (PDT) 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: guix-devel@gnu.org I would appreciate it if someone helped me wrap my head around this. Ideally I already got it and the following summary is correct; otherwise please correct. Pkg-config files (e.g. lib/pkgconfig/foo.pc for libfoo) may have a "Requires" and a "Requires.private" field. 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. This would mean that Requires should be propagated inputs, and Requires.private only normal inputs; they needn't be in the profile of the user who installs libfoo; it's enough that libfoo refers directly to their path in the store. 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, 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.) [0] http://people.freedesktop.org/~dbn/pkg-config-guide.html 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. Taylan