Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output
Date: Wed, 06 Jan 2021 22:47:37
Message-Id: 20210106224711.70b8b8e5@symphony.aura-online.co.uk
In Reply to: Re: [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output by Mike Gilbert
1 On Mon, 4 Jan 2021 19:28:37 -0500
2 Mike Gilbert <floppym@g.o> wrote:
3
4 > On Mon, Jan 4, 2021 at 6:45 PM Mike Gilbert <floppym@g.o> wrote:
5 > >
6 > > On Mon, Jan 4, 2021 at 6:18 PM James Le Cuirot <chewi@g.o> wrote:
7 > > > $ PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev
8 > > > /lib/udev
9 > > >
10 > > > The udevdir variable is not affected by PKG_CONFIG_SYSROOT_DIR at all.
11 > > > And why would it be? The man page says that this variable is only
12 > > > applied to -I and -L flags. I don't know for sure but I suspect that
13 > > > pkg-config just sees this as some arbitrary variable with no special
14 > > > path handling at all. I wonder what led you to think that this fix was
15 > > > necessary?
16 > >
17 > > Interesting!
18 > >
19 > > pkg-config behaves differently on my system:
20 > >
21 > > % PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev
22 > > /foo/lib/udev
23 > >
24 > > This appears to be a difference in behavior between dev-util/pkgconfig
25 > > and dev-util/pkgconf. I am using pkgconf, and I would guess you are
26 > > using pkgconfig.
27 > >
28 > > I guess I will ask pkgconf upstream for help on this; it seems like
29 > > this is probably an unintended behavior.
30 >
31 > It seems that the pkgconf behavior is intentional.
32 >
33 > https://github.com/pkgconf/pkgconf/issues/69
34 >
35 > I opened an issue to see if we can get some kind of opt-out.
36 >
37 > https://github.com/pkgconf/pkgconf/issues/205
38
39 Hmmm. At this point, I'm thinking maybe we should just address this in
40 cross-pkg-config. It seems unfair to ask upstream to accommodate this
41 when the tool is just doing what we asked it to. Perhaps it could
42 respect PKG_CONFIG_SYSROOT_DIR if it is already set, even when empty.
43 It wouldn't allow to you set this differently for the build host but
44 you shouldn't ever have to. I think I'd prefer this over adding yet
45 another confusing variable. The same could be applied to
46 PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSTEM_LIBRARY_PATH for consistency.
47 What do you think?
48
49 On a side note, I think that what cross-pkg-config does should be part
50 of Portage or something rather than part of crossdev because there's
51 nothing really cross-compile-specific about it. You can set SYSROOT
52 when building natively, although that tends to run into even more
53 issues than you get with cross.
54
55 --
56 James Le Cuirot (chewi)
57 Gentoo Linux Developer

Replies