* [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf
@ 2024-06-03 18:02 Randolph Sapp
2024-06-03 21:22 ` Richard Purdie
0 siblings, 1 reply; 6+ messages in thread
From: Randolph Sapp @ 2024-06-03 18:02 UTC (permalink / raw)
To: richard.purdie, alex.kanavin, openembedded-core, Ryan Eatmon,
Denys Dmytriyenko, cordlandwehr, alexandre.belloni@bootlin.com,
Alexander Kanavin
Hello,
Forgive my ignorance, but is there any particular reason why pkg-config
is preferred over pkgconf for meson related recipes? It seems the two
treat the usage of the PKG_CONFIG_SYSROOT_DIR variable differently,
resulting in issues when build scripts attempting to use package config
variables directly.
It seems that pkgconf respects PKG_CONFIG_SYSROOT_DIR by prepending that
path to all variables queried, where as pkg-config just populates an
internal global variable that the *.pc file must then use (pc_sysrootdir).
The global variable method would work, if any package config generating
scripts used it by default. Unfortunately the only use I've been able to
find comes from Yocto related patches specifically added to work around
this difference in behavior.
You can see some of the attempts to work around this discrepancy here:
recipes-graphics/xorg-proto/xcb-proto/0001-xcb-proto.pc.in-reinstate-libdir.patch
recipes-graphics/wayland/wayland/0002-Consider-pkgconfig-sysroot-for-pkgdatadir.patch
meta-openembedded/meta-oe/recipes-extended/flatpak/flatpak_1.15.6.bb
If there's not an explicit reason we're preferring pkg-config, would
anyone be opposed to switching it out for pkgconf for meson related
packages? Of course, with a note about this behavior discrepancy. It
would reduce these Yocto specific patches and align meson behavior with
distros that currently default to pkgconf.
Regards,
Randolph
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf
2024-06-03 18:02 [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf Randolph Sapp
@ 2024-06-03 21:22 ` Richard Purdie
2024-06-03 21:32 ` Marko Lindqvist
2024-06-03 22:02 ` Randolph Sapp
0 siblings, 2 replies; 6+ messages in thread
From: Richard Purdie @ 2024-06-03 21:22 UTC (permalink / raw)
To: Randolph Sapp, alex.kanavin, openembedded-core, Ryan Eatmon,
Denys Dmytriyenko, cordlandwehr, alexandre.belloni@bootlin.com
On Mon, 2024-06-03 at 13:02 -0500, Randolph Sapp wrote:
> Forgive my ignorance, but is there any particular reason why pkg-
> config is preferred over pkgconf for meson related recipes?
Yes, as to try and mix both pkg-config and pkgconf would be a path to
madness.
> It seems the two treat the usage of the PKG_CONFIG_SYSROOT_DIR
> variable differently, resulting in issues when build scripts
> attempting to use package config variables directly.
Right, this is basically the problem. We have a long history of using
pkg-config, we worked with upstream to merge sysroot support and it is
the standard we built around.
pkgconf then came along and decided it would be a great idea to have
some slightly different behaviour. We did originally plan to have a
switchable virtual/ provider but due to the differences in behaviour it
doesn't work.
Things are bad enough that there are two standards. Saying "if building
with meson, it behaves differently again" would be a nightmare.
I have been asked to switch everything to pkgconf however I suspect
that would also involve carrying patches and would end up as ton of
work to be incompatible with a different set of software. I'm therefore
not keen on that either.
> If there's not an explicit reason we're preferring pkg-config, would
> anyone be opposed to switching it out for pkgconf for meson related
> packages? Of course, with a note about this behavior discrepancy. It
> would reduce these Yocto specific patches and align meson behavior
> with distros that currently default to pkgconf.
Personally, I think it would just confuse things even more. xcb-proto
might get used by meson or non-meson software. Mesa might get used by
either too. Keeping it simple and saying "pkg-config behaviour"
everywhere is simpler IMO.
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf
2024-06-03 21:22 ` Richard Purdie
@ 2024-06-03 21:32 ` Marko Lindqvist
2024-06-03 21:37 ` Richard Purdie
2024-06-03 22:02 ` Randolph Sapp
1 sibling, 1 reply; 6+ messages in thread
From: Marko Lindqvist @ 2024-06-03 21:32 UTC (permalink / raw)
To: richard.purdie
Cc: Randolph Sapp, alex.kanavin, openembedded-core, Ryan Eatmon,
Denys Dmytriyenko, cordlandwehr, alexandre.belloni@bootlin.com
On Tue, 4 Jun 2024 at 00:22, Richard Purdie via lists.openembedded.org
<richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:
>
> Keeping it simple and saying "pkg-config behaviour"
> everywhere is simpler IMO.
Do you think that pkg-config will still gain livelihood? I've
considered it a dead project for some time now. I was about to check
how many years it's since the latest commit to their repository, but
the repo URL from freedesktop site now gave 404.
- ML
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf
2024-06-03 21:32 ` Marko Lindqvist
@ 2024-06-03 21:37 ` Richard Purdie
2024-06-03 21:54 ` Randolph Sapp
0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2024-06-03 21:37 UTC (permalink / raw)
To: Marko Lindqvist
Cc: Randolph Sapp, alex.kanavin, openembedded-core, Ryan Eatmon,
Denys Dmytriyenko, cordlandwehr, alexandre.belloni@bootlin.com
On Tue, 2024-06-04 at 00:32 +0300, Marko Lindqvist wrote:
> On Tue, 4 Jun 2024 at 00:22, Richard Purdie via
> lists.openembedded.org
> <richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:
> >
> > Keeping it simple and saying "pkg-config behaviour"
> > everywhere is simpler IMO.
>
> Do you think that pkg-config will still gain livelihood? I've
> considered it a dead project for some time now. I was about to check
> how many years it's since the latest commit to their repository, but
> the repo URL from freedesktop site now gave 404.
It hasn't really needed to change to be honest. I do agree the 404 is
worrying and it has been a long time since there was a release.
The trouble is, who wants to take on chasing down all the bugs and
pushing changes to all the upstreams that will need patching? In
general people fix a small corner of the problem then get
bored/frustrated/distracted/whatever and move on to something else, not
that I blame them. This isn't a conversion we can half do, it will end
up as another flag day :/.
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf
2024-06-03 21:37 ` Richard Purdie
@ 2024-06-03 21:54 ` Randolph Sapp
0 siblings, 0 replies; 6+ messages in thread
From: Randolph Sapp @ 2024-06-03 21:54 UTC (permalink / raw)
To: Richard Purdie, Marko Lindqvist
Cc: alex.kanavin, openembedded-core, Ryan Eatmon, Denys Dmytriyenko,
cordlandwehr, alexandre.belloni@bootlin.com
On Mon Jun 3, 2024 at 4:37 PM CDT, Richard Purdie wrote:
> On Tue, 2024-06-04 at 00:32 +0300, Marko Lindqvist wrote:
> > On Tue, 4 Jun 2024 at 00:22, Richard Purdie via
> > lists.openembedded.org
> > <richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:
> > >
> > > Keeping it simple and saying "pkg-config behaviour"
> > > everywhere is simpler IMO.
> >
> > Do you think that pkg-config will still gain livelihood? I've
> > considered it a dead project for some time now. I was about to check
> > how many years it's since the latest commit to their repository, but
> > the repo URL from freedesktop site now gave 404.
>
> It hasn't really needed to change to be honest. I do agree the 404 is
> worrying and it has been a long time since there was a release.
>
> The trouble is, who wants to take on chasing down all the bugs and
> pushing changes to all the upstreams that will need patching? In
> general people fix a small corner of the problem then get
> bored/frustrated/distracted/whatever and move on to something else, not
> that I blame them. This isn't a conversion we can half do, it will end
> up as another flag day :/.
>
> Cheers,
>
> Richard
Don't worry about the 404. The freedesktop gitlab in in the middle of a
migration. The project is still alive :)
- Randolph
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf
2024-06-03 21:22 ` Richard Purdie
2024-06-03 21:32 ` Marko Lindqvist
@ 2024-06-03 22:02 ` Randolph Sapp
1 sibling, 0 replies; 6+ messages in thread
From: Randolph Sapp @ 2024-06-03 22:02 UTC (permalink / raw)
To: Richard Purdie, alex.kanavin, openembedded-core, Ryan Eatmon,
Denys Dmytriyenko, cordlandwehr, alexandre.belloni@bootlin.com
On Mon Jun 3, 2024 at 4:22 PM CDT, Richard Purdie wrote:
> On Mon, 2024-06-03 at 13:02 -0500, Randolph Sapp wrote:
> > Forgive my ignorance, but is there any particular reason why pkg-
> > config is preferred over pkgconf for meson related recipes?
>
> Yes, as to try and mix both pkg-config and pkgconf would be a path to
> madness.
Fair enough.
> > It seems the two treat the usage of the PKG_CONFIG_SYSROOT_DIR
> > variable differently, resulting in issues when build scripts
> > attempting to use package config variables directly.
>
> Right, this is basically the problem. We have a long history of using
> pkg-config, we worked with upstream to merge sysroot support and it is
> the standard we built around.
>
> pkgconf then came along and decided it would be a great idea to have
> some slightly different behaviour. We did originally plan to have a
> switchable virtual/ provider but due to the differences in behaviour it
> doesn't work.
>
> Things are bad enough that there are two standards. Saying "if building
> with meson, it behaves differently again" would be a nightmare.
>
> I have been asked to switch everything to pkgconf however I suspect
> that would also involve carrying patches and would end up as ton of
> work to be incompatible with a different set of software. I'm therefore
> not keen on that either.
Also fair, I can understand not wanting to switch to a newer tool after spending
time to get sysroots accepted upstream. The virtual provider thing is doable
though.
Both pkg-config providers can be passed --define-prefix to yield something
usable to Yocto. It makes both assume the value of "prefix" based on the path to
the current package config file, which will work with current sysroot structure
Yocto uses. If that structure ever changes, though, this will no longer work. A
wrapper would be able to ensure both follow the standard.
> > If there's not an explicit reason we're preferring pkg-config, would
> > anyone be opposed to switching it out for pkgconf for meson related
> > packages? Of course, with a note about this behavior discrepancy. It
> > would reduce these Yocto specific patches and align meson behavior
> > with distros that currently default to pkgconf.
>
> Personally, I think it would just confuse things even more. xcb-proto
> might get used by meson or non-meson software. Mesa might get used by
> either too. Keeping it simple and saying "pkg-config behaviour"
> everywhere is simpler IMO.
>
> Cheers,
>
> Richard
Fair enough. Would the wrapper be a useful solution (if applied globally), or
would this be too much of a deviation from expected default behavior as well...
- Randolph
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-06-03 22:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 18:02 [oe-core] [RFC] meson.bbclass: pkg-config vs pkgconf Randolph Sapp
2024-06-03 21:22 ` Richard Purdie
2024-06-03 21:32 ` Marko Lindqvist
2024-06-03 21:37 ` Richard Purdie
2024-06-03 21:54 ` Randolph Sapp
2024-06-03 22:02 ` Randolph Sapp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox