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: Re: pkg-config "Requires" fields and propagated inputs Date: Tue, 24 Mar 2015 23:52:18 +0100 Message-ID: <877fu62el9.fsf@taylan.uni.cx> References: <87d2444stf.fsf@taylan.uni.cx> <87twxayuz6.fsf@gnu.org> 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]:50361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaXgR-0001QU-9i for guix-devel@gnu.org; Tue, 24 Mar 2015 18:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaXgQ-0002hO-6c for guix-devel@gnu.org; Tue, 24 Mar 2015 18:52:27 -0400 In-Reply-To: <87twxayuz6.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 24 Mar 2015 21:57:17 +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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Do you have an example of a package that uses Requires.private? libxrandr is a good test case. Indeed I patched it a few days ago because some libraries in its Requires.private weren't propagated, which fixed my issue. >> 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? I hit the issue with libxrandr while packaging mpv. It has x11 under its Requires.private, and: $ ./pre-inst-env guix environment --pure -E guile guile-json mpv GNU Guile 2.0.11 Copyright (C) 1995-2014 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,use (srfi srfi-1) scheme@(guile-user)> (define path (string-split (getenv "PKG_CONFIG_PATH") = #\:)) scheme@(guile-user)> (find (lambda (s) (string-match "x11" s)) path) $1 =3D "/gnu/store/99bgd1yjf51y0mrh2p40g499ida8l1qr-libx11-1.6.2/lib/pkgcon= fig" scheme@(guile-user)> (system* "pkg-config" "--exists" "xrandr") $2 =3D 0 scheme@(guile-user)> (system* "pkg-config" "--print-errors" "xrandr") $3 =3D 0 scheme@(guile-user)> (system* "pkg-config" "--libs" "xrandr") -L/gnu/store/05a5lxii4qvgf9jnxq85jvmbpalljr9a-libxrandr-1.4.2/lib -lXrandr $4 =3D 0 scheme@(guile-user)> (define path* (filter (lambda (s) (not (string-match "= x11" s))) path)) scheme@(guile-user)> (setenv "PKG_CONFIG_PATH" (string-join path* ":")) scheme@(guile-user)> (system* "pkg-config" "--exists" "xrandr") $5 =3D 256 scheme@(guile-user)> (system* "pkg-config" "--print-errors" "xrandr") Package x11 was not found in the pkg-config search path. Perhaps you should add the directory containing `x11.pc' to the PKG_CONFIG_PATH environment variable Package 'x11', required by 'xrandr', not found $6 =3D 256 scheme@(guile-user)> (system* "pkg-config" "--libs" "xrandr") -L/gnu/store/05a5lxii4qvgf9jnxq85jvmbpalljr9a-libxrandr-1.4.2/lib -lXrandr $7 =3D 0 scheme@(guile-user)> So while e.g. --libs actually works, --exists reports failure, and --print-errors explains why. One could say this is partially a bug, because if libxrandr statically linked against libx11, then libx11 needn't exist at build nor run time. It might be nice to have build-only propagated inputs. On the other hand, someone installing libxrandr in their profile will expect pkg-config on libxrandr to work without errors. More generally, they will expect any build operation to work; i.e. a user might want to use Guix-installed libraries for Guix-external development, and build-only propagated inputs would mean annoying such users because they now have to install them manually. Unless we provide a special "install for development" operation that is. But the complexity grows. :-) Taylan