mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Lars Pedersen <lapeddk@gmail.com>
To: Markus Heidelberg <M.Heidelberg@cab.de>
Cc: "ptxdist@pengutronix.de" <ptxdist@pengutronix.de>
Subject: Re: [ptxdist] [PATCH] libgpiod: version bump 2.1.3 -> 2.2.2
Date: Thu, 10 Jul 2025 21:27:11 +0200	[thread overview]
Message-ID: <CAKd8=GvZiP_rnOYE4E=AO_YkQsXU2nGCoA+QuD6rTeBrC1G0yg@mail.gmail.com> (raw)
In-Reply-To: <aG_BOEpCbCFrRomL@KAN23-025>

Hi. Thanks for the feedback.

On Thu, 10 Jul 2025 at 15:33, Markus Heidelberg <M.Heidelberg@cab.de> wrote:
>
> On Wed, Jul 09, 2025 at 02:51:01PM +0200, Lars Alex Pedersen wrote:
> > * Revert commit 0b38f33360be9221c1bca62f7023ffdcb9a9c0e5, since it has
> >   been fixed in release 2.2.2.
> > * Add new options to install the dbus daemon with and without systemd.
> > * Add gpio in group
> > * Add gpio-manager user and group
> >
> > https://github.com/brgl/libgpiod/blob/v2.2.x/NEWS
>
> You could use the official upstream URL instead of the GitHub mirror:
> https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/NEWS?h=v2.2.2
>
> > Signed-off-by: Lars Alex Pedersen <lapeddk@gmail.com>
> > ---
> >  projectroot/etc/group  |  2 ++
> >  projectroot/etc/passwd |  1 +
> >  rules/libgpiod.in      | 17 +++++++++++++++++
> >  rules/libgpiod.make    | 28 +++++++++++++++++++++++-----
> >  4 files changed, 43 insertions(+), 5 deletions(-)
> >
>
> > diff --git a/rules/libgpiod.make b/rules/libgpiod.make
> > index 6272333b5..44f623b66 100644
> > --- a/rules/libgpiod.make
> > +++ b/rules/libgpiod.make
> > @@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_LIBGPIOD) += libgpiod
> >  #
> >  # Paths and names
> >  #
> > -LIBGPIOD_VERSION     := 2.1.3
> > -LIBGPIOD_MD5         := dd37487da746569b7311b2c8fd2f907d
> > +LIBGPIOD_VERSION     := 2.2.2
> > +LIBGPIOD_MD5         := 11e80ef978c7dbffc6f16dbac412ce42
> >  LIBGPIOD             := libgpiod-$(LIBGPIOD_VERSION)
> >  LIBGPIOD_SUFFIX              := tar.gz
> >  LIBGPIOD_URL         := https://www.kernel.org/pub/software/libs/libgpiod/$(LIBGPIOD).$(LIBGPIOD_SUFFIX)
> > @@ -45,15 +45,18 @@ LIBGPIOD_CONF_OPT := \
> >       --disable-tests \
> >       --disable-profiling \
> >       --disable-examples \
> > +     --$(call ptx/endis, PTXCONF_LIBGPIOD_DBUS_DAEMON)-bindings-glib \
> > +     --disable-introspection \
>
> Tab instead of space after "introspection".
>
> > +     --$(call ptx/endis, PTXCONF_LIBGPIOD_DBUS_DAEMON_SYSTEMD)-systemd \
> > +     --$(call ptx/endis, PTXCONF_LIBGPIOD_DBUS_DAEMON)-dbus \
>
> It seems to be customary to sort the options to make
> scripts/configure_helper.py silent, even if this script has a --sort
> option.
>
> >       --$(call ptx/endis, PTXCONF_LIBGPIOD_CXX)-bindings-cxx \
> >       --$(call ptx/endis, PTXCONF_LIBGPIOD_PYTHON3)-bindings-python \
> >       --disable-bindings-rust
> >
> >  LIBGPIOD_CONF_ENV := \
> >       $(CROSS_ENV) \
> > -     $(if $(PTXCONF_LIBGPIOD_PYTHON3), \
> > -             ac_cv_path_PYTHON=$(CROSS_PYTHON3) \
> > -             ac_cv_prog_has_python_config=python$(PYTHON3_MAJORMINOR)-config)
>
> Reversion of commit 0b38f33360be9221c1bca62f7023ffdcb9a9c0e5 went wrong,
> only ac_cv_prog_has_python_config has to be removed, the other lines
> joined into one.
>
> > +     systemdsystemunitdir=/usr/lib/systemd/system
> > +
>
> Whitespace error introduced, this blank line is superfluous anyway.
>
> >
> >  LIBGPIOD_LDFLAGS:= -Wl,-rpath-link,$(LIBGPIOD_DIR)/lib/.libs
> >
> > @@ -63,6 +66,8 @@ LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOGET)  += gpioget
> >  LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOSET)   += gpioset
> >  LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOMON)   += gpiomon
> >  LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIONOTIFY)        += gpionotify
> > +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_DBUS_DAEMON)       += gpio-manager
> > +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_DBUS_DAEMON)       += gpiocli
> >
> >  # ----------------------------------------------------------------------------
> >  # Target-Install
> > @@ -84,6 +89,19 @@ $(STATEDIR)/libgpiod.targetinstall:
> >                       /usr/bin/$$tool); \
> >       done
> >
> > +ifdef PTXCONF_LIBGPIOD_DBUS_DAEMON
> > +     @$(call install_tree, libgpiod, 0, 0, -, /usr/share/dbus-1/interfaces)
> > +     @$(call install_tree, libgpiod, 0, 0, -, /etc/dbus-1/system.d)
> > +     @$(call install_lib, libgpiod, 0, 0, 0644, libgpiodbus)
> > +     @$(call install_lib, libgpiod, 0, 0, 0644, libgpiod-glib)
> > +endif
> > +ifdef PTXCONF_LIBGPIOD_DBUS_DAEMON_SYSTEMD
> > +     @$(call install_tree, libgpiod, 0, 0, -, /usr/lib/udev/rules.d)
> > +     @$(call install_alternative, libgpiod, 0, 0, 0644, \
> > +             /usr/lib/systemd/system/gpio-manager.service)
> > +     @$(call install_link, libgpiod, ../gpio-manager.service, \
> > +             /usr/lib/systemd/system/multi-user.target.wants/gpio-manager.service)
> > +endif
>
> License information further above has to be extended for the new tools
> and files. See "COPYING" and grep for "SPDX-License-Identifier" in
> "dbus" directory.
>
> >  ifdef PTXCONF_LIBGPIOD_CXX
> >       @$(call install_lib, libgpiod, 0, 0, 0644, libgpiodcxx)
> >  endif
> >
> > base-commit: 51f6fea554acb994e4f082af28077e82aab221cc
> > --
> > 2.50.0
>
> Do Python bindings build in your setup? Not for me and that was the
> reason why I didn't yet update to v2.2.x. I didn't have enough time and
> knowledge to handle this error (the wrong revert has been corrected
> before invoking "ptxdist compile libgpiod"):
>
>   make[4]: Entering directory '/home/.../build-target/libgpiod-2.2.2/bindings/python'
>   CFLAGS="-I/home/.../build-target/libgpiod-2.2.2/include/ -I/home/.../build-target/libgpiod-2.2.2/tests/gpiosim \
>   -L/home/.../build-target/libgpiod-2.2.2/lib/.libs/ -L/home/.../build-target/libgpiod-2.2.2/tests/gpiosim/.libs/" \
>   /home/.../sysroot-cross/usr/bin/python3.13 -m build
>   * Creating venv isolated environment...
>
>   Traceback (most recent call last):
>     File "/home/.../sysroot-host/usr/lib/python3.13/site-packages/build/__main__.py", line 375, in main
>       built = build_call(
>           args.srcdir, outdir, distributions, config_settings, not args.no_isolation, args.skip_dependency_check
>       )
>     File "/home/.../sysroot-host/usr/lib/python3.13/site-packages/build/__main__.py", line 235, in build_package_via_sdist
>       sdist = _build(isolation, builder, outdir, 'sdist', config_settings, skip_dependency_check)
>     File "/home/.../sysroot-host/usr/lib/python3.13/site-packages/build/__main__.py", line 145, in _build
>       return _build_in_isolated_env(builder, outdir, distribution, config_settings)
>     File "/home/.../sysroot-host/usr/lib/python3.13/site-packages/build/__main__.py", line 109, in _build_in_isolated_env
>       with _IsolatedEnvBuilder() as env:
>            ~~~~~~~~~~~~~~~~~~~^^
>     File "/home/.../sysroot-host/usr/lib/python3.13/site-packages/build/env.py", line 107, in __enter__
>       executable, scripts_dir = _create_isolated_env_venv(self._path)
>                                 ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
>     File "/home/.../sysroot-host/usr/lib/python3.13/site-packages/build/env.py", line 279, in _create_isolated_env_venv
>       pip_distribution = next(iter(metadata.distributions(name='pip', path=[purelib])))  # type: ignore[no-untyped-call]
>   StopIteration
>
>   ERROR
>   make[4]: *** [Makefile:720: all-local] Error 1
>
> I found this related pybuild issue, but didn't get to a solution:
> https://github.com/pypa/build/issues/266

I'll check our other suggestions, but this seems like the main issue.
I got something working by patching libgpiod:

--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -36,7 +36,7 @@ clean-local:
 all-local: python-tests
  CFLAGS="-I$(abs_top_srcdir)/include/ -I$(abs_top_srcdir)/tests/gpiosim \
  -L$(abs_top_builddir)/lib/.libs/ -L$(abs_top_builddir)/tests/gpiosim/.libs/" \
- $(PYTHON) -m build
+ $(PYTHON) -m build --skip-dependency-check --wheel --no-isolation

--- a/ptxdist/rules/libgpiod.in
+++ b/ptxdist/rules/libgpiod.in
@@ -3,12 +3,14 @@
 menuconfig LIBGPIOD
        tristate
        prompt "libgpiod                      "
-       select HOST_SYSTEM_PYTHON3
-       select DBUS             if LIBGPIOD_DBUS_DAEMON
-       select LIBGUDEV         if LIBGPIOD_DBUS_DAEMON
-       select GLIB             if LIBGPIOD_DBUS_DAEMON
-       select GCCLIBS_CXX      if LIBGPIOD_CXX
-       select PYTHON3          if LIBGPIOD_PYTHON3
+       select HOST_PYTHON3             if LIBGPIOD_PYTHON3
+       select HOST_PYTHON3_PYBUILD     if LIBGPIOD_PYTHON3
+       select HOST_PYTHON3_PIP         if LIBGPIOD_PYTHON3
+       select DBUS                     if LIBGPIOD_DBUS_DAEMON
+       select LIBGUDEV                 if LIBGPIOD_DBUS_DAEMON
+       select GLIB                     if LIBGPIOD_DBUS_DAEMON
+       select GCCLIBS_CXX              if LIBGPIOD_CXX
+       select PYTHON3                  if LIBGPIOD_PYTHON3

I guess the reason is something with that the python compile options
from ptxdist in ptxd_make_world_compile.sh isn't being passed
correctly, probably because it is a python3 build within a autoconf
env.

I don't know if this is the correct way to fix it.

/Lars Pedersen

>
> Markus



      reply	other threads:[~2025-07-10 19:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 12:51 Lars Alex Pedersen
2025-07-10 13:33 ` Markus Heidelberg via ptxdist
2025-07-10 19:27   ` Lars Pedersen [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='CAKd8=GvZiP_rnOYE4E=AO_YkQsXU2nGCoA+QuD6rTeBrC1G0yg@mail.gmail.com' \
    --to=lapeddk@gmail.com \
    --cc=M.Heidelberg@cab.de \
    --cc=ptxdist@pengutronix.de \
    /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