Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Kuhls <bernd@kuhls.net>
To: buildroot@buildroot.org
Cc: Julien Olivain <ju.o@free.fr>,
	Antoine Tenart <atenart@kernel.org>,
	Marcus Folkesson <marcus.folkesson@gmail.com>
Subject: [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors
Date: Sun, 21 Dec 2025 18:15:50 +0100	[thread overview]
Message-ID: <20251221171550.2356174-1-bernd@kuhls.net> (raw)

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

             reply	other threads:[~2025-12-21 17:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-21 17:15 Bernd Kuhls [this message]
2025-12-27 15:05 ` [Buildroot] [PATCH 1/1] package/libselinux: fix Python build errors Thomas Petazzoni via buildroot
2026-01-07 17:49 ` Arnout Vandecappelle via buildroot

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=20251221171550.2356174-1-bernd@kuhls.net \
    --to=bernd@kuhls.net \
    --cc=atenart@kernel.org \
    --cc=buildroot@buildroot.org \
    --cc=ju.o@free.fr \
    --cc=marcus.folkesson@gmail.com \
    /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