On Mon, 4 Jan 2021 19:28:37 -0500
Mike Gilbert <flop...@gentoo.org> wrote:

> On Mon, Jan 4, 2021 at 6:45 PM Mike Gilbert <flop...@gentoo.org> wrote:
> >
> > On Mon, Jan 4, 2021 at 6:18 PM James Le Cuirot <ch...@gentoo.org> wrote:  
> > > $ PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev
> > > /lib/udev
> > >
> > > The udevdir variable is not affected by PKG_CONFIG_SYSROOT_DIR at all.
> > > And why would it be? The man page says that this variable is only
> > > applied to -I and -L flags. I don't know for sure but I suspect that
> > > pkg-config just sees this as some arbitrary variable with no special
> > > path handling at all. I wonder what led you to think that this fix was
> > > necessary?  
> >
> > Interesting!
> >
> > pkg-config behaves differently on my system:
> >
> > % PKG_CONFIG_SYSROOT_DIR=/foo pkg-config --variable=udevdir udev
> > /foo/lib/udev
> >
> > This appears to be a difference in behavior between dev-util/pkgconfig
> > and dev-util/pkgconf. I am using pkgconf, and I would guess you are
> > using pkgconfig.
> >
> > I guess I will ask pkgconf upstream for help on this; it seems like
> > this is probably an unintended behavior.  
> 
> It seems that the pkgconf behavior is intentional.
> 
> https://github.com/pkgconf/pkgconf/issues/69
> 
> I opened an issue to see if we can get some kind of opt-out.
> 
> https://github.com/pkgconf/pkgconf/issues/205

Hmmm. At this point, I'm thinking maybe we should just address this in
cross-pkg-config. It seems unfair to ask upstream to accommodate this
when the tool is just doing what we asked it to. Perhaps it could
respect PKG_CONFIG_SYSROOT_DIR if it is already set, even when empty.
It wouldn't allow to you set this differently for the build host but
you shouldn't ever have to. I think I'd prefer this over adding yet
another confusing variable. The same could be applied to
PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSTEM_LIBRARY_PATH for consistency.
What do you think?

On a side note, I think that what cross-pkg-config does should be part
of Portage or something rather than part of crossdev because there's
nothing really cross-compile-specific about it. You can set SYSROOT
when building natively, although that tends to run into even more
issues than you get with cross.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

Attachment: pgpNBAoelSf5e.pgp
Description: OpenPGP digital signature

Reply via email to