* [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors
@ 2025-12-21 17:15 Bernd Kuhls
2025-12-27 15:05 ` Thomas Petazzoni via buildroot
2026-01-07 17:49 ` Arnout Vandecappelle via buildroot
0 siblings, 2 replies; 3+ messages in thread
From: Bernd Kuhls @ 2025-12-21 17:15 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain, Antoine Tenart, Marcus Folkesson
Fixes:
https://autobuild.buildroot.org/results/953/953b8c6d7da0f150ec56760c4a3191e630c01381/
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Co-Authored-By: Julien Olivain <ju.o@free.fr>
---
...uild-python-module-without-isolation.patch | 41 +++++++++++++++++++
package/libselinux/libselinux.mk | 4 ++
2 files changed, 45 insertions(+)
create mode 100644 package/libselinux/0003-Build-python-module-without-isolation.patch
diff --git a/package/libselinux/0003-Build-python-module-without-isolation.patch b/package/libselinux/0003-Build-python-module-without-isolation.patch
new file mode 100644
index 0000000000..9614efa6c8
--- /dev/null
+++ b/package/libselinux/0003-Build-python-module-without-isolation.patch
@@ -0,0 +1,41 @@
+From: =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com>
+Date: Mon, 27 Oct 2025 22:40:59 +0100
+Subject: Build python module without isolation (Closes: #1119155)
+
+Let pip find the system installed setuptools.
+
+Downloaded from
+https://sources.debian.org/src/libselinux/3.9-4/debian/patches/Build-python-module-without-isolation-Closes-1119155.patch
+
+Used by Debian to fix a build error:
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1119155
+
+Building the Buildroot package breaks with a different error:
+
+ ModuleNotFoundError: No module named '_sysconfigdata__linux_aarch64-linux-gnu'
+
+which is also fixed by this patch, most likely both are caused by
+incorrect usage of python-pip by libselinux:
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121121#29
+
+Upstream: buildroot-specific
+
+[Bernd: rebased after patch 0002 was applied]
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ src/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 261c22d..29057a8 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -198,7 +198,7 @@ ifneq ($(DISABLE_SHARED),y)
+ endif
+
+ install-pywrap: pywrap
+- CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
++ CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps --no-build-isolation` $(PYTHON_SETUP_ARGS) .
+ install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
+ ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/
+
diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
index 405c4a9f21..a77ee7659a 100644
--- a/package/libselinux/libselinux.mk
+++ b/package/libselinux/libselinux.mk
@@ -35,8 +35,12 @@ LIBSELINUX_DEPENDENCIES += \
python3 \
python-setuptools \
host-python-pip \
+ host-python-setuptools \
host-swig
+LIBSELINUX_MAKE_ENV += \
+ $(PKG_PYTHON_SETUPTOOLS_ENV)
+
LIBSELINUX_MAKE_OPTS += \
$(PKG_PYTHON_SETUPTOOLS_ENV) \
PYTHON=python$(PYTHON3_VERSION_MAJOR)
--
2.47.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors
2025-12-21 17:15 [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors Bernd Kuhls
@ 2025-12-27 15:05 ` Thomas Petazzoni via buildroot
2026-01-07 17:49 ` Arnout Vandecappelle via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-12-27 15:05 UTC (permalink / raw)
To: Bernd Kuhls; +Cc: buildroot, Julien Olivain, Antoine Tenart, Marcus Folkesson
Hello Bernd,
On Sun, 21 Dec 2025 18:15:50 +0100
Bernd Kuhls <bernd@kuhls.net> wrote:
> diff --git a/package/libselinux/0003-Build-python-module-without-isolation.patch b/package/libselinux/0003-Build-python-module-without-isolation.patch
> new file mode 100644
> index 0000000000..9614efa6c8
> --- /dev/null
> +++ b/package/libselinux/0003-Build-python-module-without-isolation.patch
> @@ -0,0 +1,41 @@
> +From: =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com>
> +Date: Mon, 27 Oct 2025 22:40:59 +0100
> +Subject: Build python module without isolation (Closes: #1119155)
> +
> +Let pip find the system installed setuptools.
> +
> +Downloaded from
> +https://sources.debian.org/src/libselinux/3.9-4/debian/patches/Build-python-module-without-isolation-Closes-1119155.patch
> +
> +Used by Debian to fix a build error:
> +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1119155
> +
> +Building the Buildroot package breaks with a different error:
> +
> + ModuleNotFoundError: No module named '_sysconfigdata__linux_aarch64-linux-gnu'
> +
> +which is also fixed by this patch, most likely both are caused by
> +incorrect usage of python-pip by libselinux:
> +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121121#29
> +
> +Upstream: buildroot-specific
This makes no sense. The patch comes from Debian, so surely it is NOT
Buildroot-specific. That's just an excuse not to upstream it :-)
So I did send it upstream:
https://lore.kernel.org/selinux/20251227143911.1630813-1-thomas.petazzoni@bootlin.com/
I don't know if it will be accepted of course, but at least I've tried.
> + install-pywrap: pywrap
> +- CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
> ++ CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps --no-build-isolation` $(PYTHON_SETUP_ARGS) .
This patch was passing --no-build-isolation only when $(DESTDIR) was
not empty.
In the context of Buildroot, this means that --no-build-isolation was
passed for the target libselinux (which is installed with
DESTDIR=$(TARGET_DIR)), but --no-build-isolation was not passed for the
host libselinux (which is installed with prefix=$(HOST_DIR), but an
empty $(DESTDIR).
So, I've moved --no-build-isolation outside of this condition, which
solves the issue that your patch "package/libselinux: host-python3
needs SSL support" was trying to solve.
Also, as very often your patch was missing a very critical piece of
information: since when was this failing? Without this information, we
cannot merge your patches. We've asked you time and time again to
provide this important piece of information, but you continue to omit
this information, putting on the reviewers/maintainers the burden of
doing the necessary investigation. I would _really_ appreciate if you
could improve on this. Basically, *everytime* you send a patch fixing
something, it must *always* *always* *always* explain when the problem
was introduced.
Thanks a lot for your contributions!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors
2025-12-21 17:15 [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors Bernd Kuhls
2025-12-27 15:05 ` Thomas Petazzoni via buildroot
@ 2026-01-07 17:49 ` Arnout Vandecappelle via buildroot
1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2026-01-07 17:49 UTC (permalink / raw)
To: Bernd Kuhls; +Cc: Arnout Vandecappelle, buildroot
In reply of:
> Fixes:
> https://autobuild.buildroot.org/results/953/953b8c6d7da0f150ec56760c4a3191e630c01381/
>
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> Co-Authored-By: Julien Olivain <ju.o@free.fr>
Applied to 2025.02.x and 2025.11.x. Thanks
> ---
> ...uild-python-module-without-isolation.patch | 41 +++++++++++++++++++
> package/libselinux/libselinux.mk | 4 ++
> 2 files changed, 45 insertions(+)
> create mode 100644 package/libselinux/0003-Build-python-module-without-isolation.patch
>
> diff --git a/package/libselinux/0003-Build-python-module-without-isolation.patch b/package/libselinux/0003-Build-python-module-without-isolation.patch
> new file mode 100644
> index 0000000000..9614efa6c8
> --- /dev/null
> +++ b/package/libselinux/0003-Build-python-module-without-isolation.patch
> @@ -0,0 +1,41 @@
> +From: =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com>
> +Date: Mon, 27 Oct 2025 22:40:59 +0100
> +Subject: Build python module without isolation (Closes: #1119155)
> +
> +Let pip find the system installed setuptools.
> +
> +Downloaded from
> +https://sources.debian.org/src/libselinux/3.9-4/debian/patches/Build-python-module-without-isolation-Closes-1119155.patch
> +
> +Used by Debian to fix a build error:
> +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1119155
> +
> +Building the Buildroot package breaks with a different error:
> +
> + ModuleNotFoundError: No module named '_sysconfigdata__linux_aarch64-linux-gnu'
> +
> +which is also fixed by this patch, most likely both are caused by
> +incorrect usage of python-pip by libselinux:
> +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121121#29
> +
> +Upstream: buildroot-specific
> +
> +[Bernd: rebased after patch 0002 was applied]
> +Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> +---
> + src/Makefile | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/Makefile b/src/Makefile
> +index 261c22d..29057a8 100644
> +--- a/src/Makefile
> ++++ b/src/Makefile
> +@@ -198,7 +198,7 @@ ifneq ($(DISABLE_SHARED),y)
> + endif
> +
> + install-pywrap: pywrap
> +- CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) .
> ++ CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps --no-build-isolation` $(PYTHON_SETUP_ARGS) .
> + install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
> + ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/
> +
> diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
> index 405c4a9f21..a77ee7659a 100644
> --- a/package/libselinux/libselinux.mk
> +++ b/package/libselinux/libselinux.mk
> @@ -35,8 +35,12 @@ LIBSELINUX_DEPENDENCIES += \
> python3 \
> python-setuptools \
> host-python-pip \
> + host-python-setuptools \
> host-swig
>
> +LIBSELINUX_MAKE_ENV += \
> + $(PKG_PYTHON_SETUPTOOLS_ENV)
> +
> LIBSELINUX_MAKE_OPTS += \
> $(PKG_PYTHON_SETUPTOOLS_ENV) \
> PYTHON=python$(PYTHON3_VERSION_MAJOR)
> --
> 2.47.3
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-07 17:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-21 17:15 [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors Bernd Kuhls
2025-12-27 15:05 ` Thomas Petazzoni via buildroot
2026-01-07 17:49 ` Arnout Vandecappelle via buildroot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.