• Transition proposal: pkg-config to pkgconf

    From Andrej Shadura@21:1/5 to All on Sun Jul 24 17:40:01 2022
    Hi,

    Following a discussion at DebConf, I’d like to officially propose a transition
    from pkg-config to pkgconf in Debian.

    pkgconf is a newer, actively maintained implementation of pkg-config that supports more aspects of the pkg-config file specification and provides a library interface that applications can use to incorporate intelligent
    handling of pkg-config files into themselves (such as build file generators, IDEs, and compilers).

    pkgconf is compatible with pkg-config when it is run as "pkg-config", so it
    can completely replace the original implementation.

    Debian would benefit from switching to pkgconf by utilising a more complete implementation of pkg-config that handles aspects of .pc files that pkg-config does not. For example, Provides rules and Cflags.private rules are supported, and pkgconf has a better (and less costly) dependency resolver for .pc files.

    Having a more complete implementation of the pkg-config implementation can
    also help convince upstreams like Postgres and LLVM to switch to using pkg-config instead of their custom scripts like llvm-config.

    pkgconf also supports a feature called personalities [1], that can be used to implement cross-build support without a wrapper script (as currently implemented in both pkgconf and pkg-config packages).

    pkgconf is already used by other major distributions like Fedora, Gentoo and Arch, so by doing the switch we’ll be aligning ourselves with other distributions ([2], [3], [4])

    Migration plan
    ==============

    I believe that it would in the best interests of Debian to only ship one pkg-config implementation, so I propose to make pkgconf provide the binary package pkg-config without a possibility to fall back to the original implementation. This means that after pkgconf takes over the pkg-config
    binary package, all packages depending on pkg-config will be using the pkgconf implementation without being able to opt out and use the one from freedesktop.org. While this may seem limiting, it reduces the probability of some packages staying with the freedesktop.org implementation indefinitely and missing out on bug fixes or suffering from other differences in implementation details in future when pkgconf becomes even more widespread.

    In preparation for this migration, I ran a rebuild of all packages depending
    on pkg-config and found only very few failures [5], which may or may not be related to the difference in behaviour between pkg-config and pkgconf. I will perform another rebuild and continue investigating them to provide patches during the transition period.

    [0]: http://pkgconf.org/features.html
    [1]: https://manpages.debian.org/unstable/pkgconf/pkgconf-personality.5.en.html [2]: https://fedoraproject.org/wiki/Changes/pkgconf_as_system_pkg-config_implementation
    [3]: https://packages.gentoo.org/packages/virtual/pkgconfig/dependencies
    [4]: https://archlinux.org/packages/core/x86_64/pkgconf/
    [5]: http://pkgconf-migration.debian.net/failed.html

    --
    Cheers,
    Andrej

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrej Shadura@21:1/5 to Andrej Shadura on Mon Aug 29 15:40:01 2022
    Hi,

    It seems like the proposal went mostly unnoticed. Any comments, ideas, anything?

    Most importantly, I need a green light from the current pkg-config maintainer (Tollef) to proceed with the plan.

    Meanwhile, I have uploaded an updated version of the package which dropped the crosswrapper, and instead uses the "personalities" feature to implement its functionality. The package also no longer needs a dpkg hook, as it ships a per-architecture
    symlinks in arch-specific packages.

    On Sun, 24 Jul 2022, at 17:33, Andrej Shadura wrote:
    Hi,

    Following a discussion at DebConf, I’d like to officially propose a transition
    from pkg-config to pkgconf in Debian.

    pkgconf is a newer, actively maintained implementation of pkg-config that supports more aspects of the pkg-config file specification and provides a library interface that applications can use to incorporate intelligent handling of pkg-config files into themselves (such as build file generators, IDEs, and compilers).

    pkgconf is compatible with pkg-config when it is run as "pkg-config", so it can completely replace the original implementation.

    Debian would benefit from switching to pkgconf by utilising a more complete implementation of pkg-config that handles aspects of .pc files that pkg-config
    does not. For example, Provides rules and Cflags.private rules are supported, and pkgconf has a better (and less costly) dependency resolver for .pc files.

    Having a more complete implementation of the pkg-config implementation can also help convince upstreams like Postgres and LLVM to switch to using pkg-config instead of their custom scripts like llvm-config.

    pkgconf also supports a feature called personalities [1], that can be used to implement cross-build support without a wrapper script (as currently implemented in both pkgconf and pkg-config packages).

    pkgconf is already used by other major distributions like Fedora, Gentoo and Arch, so by doing the switch we’ll be aligning ourselves with other distributions ([2], [3], [4])

    Migration plan
    ==============

    I believe that it would in the best interests of Debian to only ship one pkg-config implementation, so I propose to make pkgconf provide the binary package pkg-config without a possibility to fall back to the original implementation. This means that after pkgconf takes over the pkg-config binary package, all packages depending on pkg-config will be using the pkgconf
    implementation without being able to opt out and use the one from freedesktop.org. While this may seem limiting, it reduces the probability of some packages staying with the freedesktop.org implementation indefinitely and
    missing out on bug fixes or suffering from other differences in implementation
    details in future when pkgconf becomes even more widespread.

    In preparation for this migration, I ran a rebuild of all packages depending on pkg-config and found only very few failures [5], which may or may not be related to the difference in behaviour between pkg-config and pkgconf. I will perform another rebuild and continue investigating them to provide patches during the transition period.

    [0]: http://pkgconf.org/features.html
    [1]: https://manpages.debian.org/unstable/pkgconf/pkgconf-personality.5.en.html [2]: https://fedoraproject.org/wiki/Changes/pkgconf_as_system_pkg-config_implementation
    [3]: https://packages.gentoo.org/packages/virtual/pkgconfig/dependencies
    [4]: https://archlinux.org/packages/core/x86_64/pkgconf/
    [5]: http://pkgconf-migration.debian.net/failed.html

    --
    Cheers,
    Andrej

    --
    Cheers,
    Andrej

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Guillem Jover@21:1/5 to Andrej Shadura on Mon Aug 29 16:50:02 2022
    Hi!

    On Mon, 2022-08-29 at 15:38:08 +0200, Andrej Shadura wrote:
    It seems like the proposal went mostly unnoticed. Any comments,
    ideas, anything?

    I at least read it, and it looked great. But…

    Most importantly, I need a green light from the current pkg-config
    maintainer (Tollef) to proceed with the plan.

    …as it was waiting for this, it slipped my mind.

    Meanwhile, I have uploaded an updated version of the package which
    dropped the crosswrapper, and instead uses the "personalities"
    feature to implement its functionality. The package also no longer
    needs a dpkg hook, as it ships a per-architecture symlinks in
    arch-specific packages.

    Thank you for getting rid of both of these annoyances! I switched all
    my hosts and chroots to pkgconf, when I watched your DebConf presentation
    and it's been working great.

    On Sun, 24 Jul 2022, at 17:33, Andrej Shadura wrote:
    Following a discussion at DebConf, I’d like to officially propose a transition
    from pkg-config to pkgconf in Debian.

    pkgconf is a newer, actively maintained implementation of pkg-config that supports more aspects of the pkg-config file specification and provides a library interface that applications can use to incorporate intelligent handling of pkg-config files into themselves (such as build file generators,
    IDEs, and compilers).

    Right, I track the pkg-config upstream git repo and it unfortunately has
    seen no major development since 2019, and not upstream release since 2017.

    I've also taken a peek to pkgconf from time to time, and it looks like
    a nice project, code wise, etc.

    Debian would benefit from switching to pkgconf by utilising a more complete implementation of pkg-config that handles aspects of .pc files that pkg-config
    does not. For example, Provides rules and Cflags.private rules are supported,
    and pkgconf has a better (and less costly) dependency resolver for .pc files.

    Yes.

    Migration plan
    ==============

    I believe that it would in the best interests of Debian to only ship one pkg-config implementation, so I propose to make pkgconf provide the binary package pkg-config without a possibility to fall back to the original implementation. This means that after pkgconf takes over the pkg-config binary package, all packages depending on pkg-config will be using the pkgconf
    implementation without being able to opt out and use the one from freedesktop.org. While this may seem limiting, it reduces the probability of
    some packages staying with the freedesktop.org implementation indefinitely and
    missing out on bug fixes or suffering from other differences in implementation
    details in future when pkgconf becomes even more widespread.

    If pkg-config was showing signs of activity, then this could perhaps
    be a potential concern, but given its current state, I think this makes
    perfect sense.

    In preparation for this migration, I ran a rebuild of all packages depending
    on pkg-config and found only very few failures [5], which may or may not be related to the difference in behaviour between pkg-config and pkgconf. I will
    perform another rebuild and continue investigating them to provide patches during the transition period.

    Great!

    Thanks,
    Guillem

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nick black@21:1/5 to All on Wed Aug 31 13:10:02 2022
    Andrej Shadura left as an exercise for the reader:
    It seems like the proposal went mostly unnoticed. Any comments, ideas, anything?

    fwiw, every time i've looked at a difference between the two,
    pkgconf was superior in every way. i've worked with the primary
    author, ariadne conill, on some Alpine stuff and some Notcurses
    stuff, and she's as competent and sedulous as they come. i'd
    love to see this transition, and appreciate you working on it.

    --
    nick black -=- https://www.nick-black.com
    to make an apple pie from scratch,
    you need first invent a universe.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wookey@21:1/5 to Andrej Shadura on Wed Aug 31 14:50:01 2022
    On 2022-08-29 15:38 +0200, Andrej Shadura wrote:
    Hi,

    It seems like the proposal went mostly unnoticed. Any comments, ideas, anything?

    I have an interest as having been responsible for the pkg-config
    crosswrapper stuff some years ago, but have not been taking much notice recently.

    If everything you said in your mail is true (the new one is a superset
    and better in every way, and the cross stuff will still work but in a
    less complicated way) then it sounds like a sensible plan. I must
    admit to having never heard of pkgconf before today, but you are a
    sensible chap so I assume this is indeed all as you say it is.

    Meanwhile, I have uploaded an updated version of the package which dropped the crosswrapper, and instead uses the "personalities" feature to implement its functionality. The package also no longer needs a dpkg hook, as it ships a per-architecture
    symlinks in arch-specific packages.

    I would like to understand how the cross stuff works with this
    personalities thing, but it may be a while before I get round to
    it. Again I shall assume that you know what you are doing :-)
    If Helmut is happy then I'm sure it's good.

    Wookey
    --
    Principal hats: Debian, Wookware, ARM
    http://wookware.org/

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEER4nvI8Pe/wVWh5yq+4YyUahvnkcFAmMPVuMACgkQ+4YyUahv nkcLPA//S3v1XW5agbeA3gDquqScGq1LLoYe6nvWvzTG+ccNd0rcDLbxnMoNzpHh Pllrc1FH4zGlSAaA3S1162+P8K4YjmZol+XzXaxzuGfqBguSE329hLbvipH87DpH R8TM4IVAR6ciLTHP/AHhN5qx5bpdM8ltnjzpBG4HIxUYzxI9pQLsIm02B+UNbKD3 R2bNG4k0JmpM7ulyvXMYWUT15XTUkS+bc4odwg+F6lEYlocHEFmVBB82gcZUJZW1 G5/UlWD+4nSJRAFR+RYpGhv8V8vY+sMo82OVPxBVxvRvnlmMabtPVx+2yAbCEnmx 0jbc4WOxoYvlokr+jZmOz96WJ/4Y7TgncSGM995T52fvvgqAuidB190RusR4Tr3L XPQKeYwHaBI6QFsF6yC3bLw3Zq6al8JL6xhW/+wGyFRZv+x13PK5jJkKsYpMvVc6 0rO8XwkuhFrIocP9+4sA/tXVO3K3fMhL15e5v4En1PRz9Dl/M/HaRIOrTnwSPV/m rsDodOmSCWI9yUMvrmR/HQYyrsXbxDKLORgMRR3Rzw9Py+C5AkEZY5GZDXmIkhf7 8FbK3Ptp/6Ny8WwJE404yHu7EQqnoQjgCcz/pBomSR2259NDJDFIpsQZL9sOlw7P 1dSDWXXqorzQIcWx9SXBJN5aBKOHlgKpvMrGKZUkMXUB5HEnpP0=
    =WFRV
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrej Shadura@21:1/5 to Wookey on Wed Aug 31 17:00:01 2022
    Hi,

    On Wed, 31 Aug 2022, at 14:41, Wookey wrote:
    Meanwhile, I have uploaded an updated version of the package which dropped the crosswrapper, and instead uses the "personalities" feature to implement its functionality. The package also no longer needs a dpkg hook, as it ships a per-architecture
    symlinks in arch-specific packages.

    I would like to understand how the cross stuff works with this
    personalities thing, but it may be a while before I get round to
    it. Again I shall assume that you know what you are doing :-)
    If Helmut is happy then I'm sure it's good.

    The idea is that e.g. pkgconf:amd64 provides /usr/bin/x86_64-linux-gnu-pkg-config, which is a symlink to pkgconf, and /usr/share/pkgconfig/personality.d/x86_64-linux-gnu.personality, which defines DefaultSearchPaths and SystemLibraryPaths to be
    appropriate values for amd64. pkgconf:amd64 itself doesn’t ship a pkgconf binary, which is, instead, provided in pkgconf-bin, a Multi-Arch: foreign package.
    pkgconf detects that it’s run using a symlink, and uses it to select the matching personality, and then provides results based on these settings.
    So, unless I’ve messed up with the multi-arch stuff, it should be enough to install pkgconf:<arch> to cross-build packages.

    --
    Cheers,
    Andrej

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrej Shadura@21:1/5 to Simon McVittie on Wed Aug 31 22:50:01 2022
    Hi,

    On Wed, 31 Aug 2022, at 22:25, Simon McVittie wrote:
    Beware that to be compatible with what pkg-config does (and what PKG_CHECK_MODULES wants), the cross-tools need to be prefixed with a
    GNU tuple, and *not* a multiarch tuple. So in particular for i386, you
    will need to provide /usr/bin/i686-linux-gnu-pkg-config (and presumably
    a matching personality).

    In other words, this is ${DEB_HOST_GNU_TYPE}-pkg-config and not ${DEB_HOST_MULTIARCH}-pkg-config. This matches the pattern used for
    other cross-tools like compilers.

    You might want to *also* provide ${DEB_HOST_MULTIARCH}-pkg-config, if they differ, but it is ${DEB_HOST_GNU_TYPE}-pkg-config that is canonically used.

    Thanks for pointing out, that’s something I need to fix.

    --
    Cheers,
    Andrej

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon McVittie@21:1/5 to Andrej Shadura on Wed Aug 31 22:30:01 2022
    On Wed, 31 Aug 2022 at 16:53:48 +0200, Andrej Shadura wrote:
    The idea is that e.g. pkgconf:amd64 provides /usr/bin/x86_64-linux-gnu-pkg-config, which is a symlink to pkgconf,
    and /usr/share/pkgconfig/personality.d/x86_64-linux-gnu.personality,
    which defines DefaultSearchPaths and SystemLibraryPaths to be appropriate values for amd64.

    Beware that to be compatible with what pkg-config does (and what PKG_CHECK_MODULES wants), the cross-tools need to be prefixed with a
    GNU tuple, and *not* a multiarch tuple. So in particular for i386, you
    will need to provide /usr/bin/i686-linux-gnu-pkg-config (and presumably
    a matching personality).

    In other words, this is ${DEB_HOST_GNU_TYPE}-pkg-config and not ${DEB_HOST_MULTIARCH}-pkg-config. This matches the pattern used for
    other cross-tools like compilers.

    You might want to *also* provide ${DEB_HOST_MULTIARCH}-pkg-config, if they differ, but it is ${DEB_HOST_GNU_TYPE}-pkg-config that is canonically used.

    smcv

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tollef Fog Heen@21:1/5 to All on Sun Sep 25 21:40:01 2022
    ]] "Andrej Shadura"

    Most importantly, I need a green light from the current pkg-config
    maintainer (Tollef) to proceed with the plan.

    My interest in pkg-config has waned over the years (and so has the hours
    put into maintenance of it), so if you want to bring it forward, go
    ahead.

    Cheers,
    --
    Tollef Fog Heen
    UNIX is user friendly, it's just picky about who its friends are

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)