public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Gilbert <floppym@gentoo.org>
To: Gentoo Dev <gentoo-dev@lists.gentoo.org>
Subject: Re: [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output
Date: Wed, 6 Jan 2021 18:18:01 -0500	[thread overview]
Message-ID: <CAJ0EP41GJdSY7rS5cS6Tmzk0UhDmu=6ndRnbTAqpr=xMiPP7bg@mail.gmail.com> (raw)
In-Reply-To: <20210106224711.70b8b8e5@symphony.aura-online.co.uk>

On Wed, Jan 6, 2021 at 5:47 PM James Le Cuirot <chewi@gentoo.org> wrote:
>
> On Mon, 4 Jan 2021 19:28:37 -0500
> Mike Gilbert <floppym@gentoo.org> wrote:
>
> > On Mon, Jan 4, 2021 at 6:45 PM Mike Gilbert <floppym@gentoo.org> wrote:
> > >
> > > On Mon, Jan 4, 2021 at 6:18 PM James Le Cuirot <chewi@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?

I like the idea of having cross-pkg-config respect
PKG_CONFIG_SYSROOT_DIR from the calling environment (even if it is
empty). That's just a more flexible design overall.

However, I think there's a fundamental design conflict here. Prefixing
all pkgconfig variables that happen to start with a slash is
problematic, and the desired result depends on the context in which it
will be used.

If the result is going to be used to find some existing file in
SYSROOT (like the SDK example included in issue 69 from above), then
we want it to be prefixed with SYSROOT.

If the result is going to be used to install new files, we don't want
SYSROOT in the result. The package manager is responsible for
prefixing the paths with ROOT when merging the files.

We could apply workarounds in ebuilds/eclasses to make this
distinction in Gentoo by setting PKG_CONFIG_SYSROOT_DIR selectively.
However, I wonder if there is a workable solution to this that could
be applied in upstream projects.


      reply	other threads:[~2021-01-06 23:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-03  1:09 [gentoo-dev] [PATCH] systemd.eclass: remove SYSROOT from pkg-config output Mike Gilbert
2021-01-03 12:52 ` James Le Cuirot
2021-01-03 13:02   ` James Le Cuirot
2021-01-03 15:16   ` Mike Gilbert
2021-01-04 23:18     ` James Le Cuirot
2021-01-04 23:45       ` Mike Gilbert
2021-01-05  0:28         ` Mike Gilbert
2021-01-06 22:47           ` James Le Cuirot
2021-01-06 23:18             ` Mike Gilbert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ0EP41GJdSY7rS5cS6Tmzk0UhDmu=6ndRnbTAqpr=xMiPP7bg@mail.gmail.com' \
    --to=floppym@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox