Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 01/17] package/python-iptables: fix _find_library()
@ 2023-06-08 23:28 Romain Naour
  2023-06-08 23:28 ` [Buildroot] [PATCH v2 02/17] support/testing: TestPythonPy3S3transfer: increase ext2 size to 250M Romain Naour
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Romain Naour @ 2023-06-08 23:28 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour

While the commit [1] already fixed some runtime issue with
uClibc toolchain, the same test TestPythonPy3Iptables fail
with Glibc toolchain.

  xtables_version = 12
  if xtables_version:
      _searchlib = "libxtables.so.%s" % (xtables_version,)
  else:
      _searchlib = "xtables"
  _lib_xtables, xtables_version = find_library(_searchlib)

  _lib_xtables and xtables_version are null with glibc

The implementation of find_library() rely on the custom
_find_library() that try to use the IPTABLES_LIBDIR
environment variable (that does not exist in the context
of Buildroot).

Within the scope of buildroot we can determine what
IPTABLES_LIBDIR should be at build time and replace the
calls to os.environ.get('IPTABLES_LIBDIR', None) with
the correct value.

[1] d341ec035067120b456f669a826e26eb594c0237

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
I don't know why TestPythonPy3Iptables pass succesfully
with a uClibc toolchain but not with a glibc toolchain.
The current python code searching for xtables, modules
and libraries seems fragile...
---
 package/python-iptables/python-iptables.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/python-iptables/python-iptables.mk b/package/python-iptables/python-iptables.mk
index 0ccf064217..9cb4285ec3 100644
--- a/package/python-iptables/python-iptables.mk
+++ b/package/python-iptables/python-iptables.mk
@@ -15,6 +15,7 @@ define PYTHON_IPTABLES_SET_XTABLES_ENV_VARS
 	XTABLES_VERSION=`awk '/XTABLES_VERSION_CODE/ {print $$NF}' $(STAGING_DIR)/usr/include/xtables-version.h`; \
 	sed -i "s%os.getenv(\"PYTHON_IPTABLES_XTABLES_VERSION\")%$$XTABLES_VERSION%" $(@D)/iptc/xtables.py
 	sed -i "s%os.getenv(\"XTABLES_LIBDIR\")%\"/usr/lib/xtables\"%" $(@D)/iptc/xtables.py
+	sed -i "s%os.environ.get('IPTABLES_LIBDIR', None)%\"/usr/lib\"%" $(@D)/iptc/util.py
 endef
 
 PYTHON_IPTABLES_PRE_BUILD_HOOKS += PYTHON_IPTABLES_SET_XTABLES_ENV_VARS
-- 
2.34.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-08-25 16:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-08 23:28 [Buildroot] [PATCH v2 01/17] package/python-iptables: fix _find_library() Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 02/17] support/testing: TestPythonPy3S3transfer: increase ext2 size to 250M Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 03/17] support/testing: TestPythonPy3Boto3: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 04/17] support/testing: TestPythonPy3Botocore: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 05/17] support/testing: TestSELinuxSystemd: kernel bump 6.1.26 Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 06/17] support/testing/infra/basetest.py: use Bootlin toolchain stable 2022.08-1 Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 07/17] support/testing: TestMtools: use base configuration Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 08/17] support/testing: TestZ3: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 09/17] support/testing: Test{No, All, NonDefaultLimited}Timezone: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 10/17] support/testing: TestPythonPy3SciPy: use python " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 11/17] support/testing: TestPythonPy3Autobahn: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 12/17] support/testing: TestPythonPy3Crossbar: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 13/17] support/testing: TestPythonPy3Cryptography: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 14/17] support/testing: TestPythonPy3MagicWormhole: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 15/17] support/testing: TestPythonPy3ServiceIdentity: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 16/17] support/testing: TestPythonPy3Treq: " Romain Naour
2023-06-08 23:28 ` [Buildroot] [PATCH v2 17/17] support/testing: TestPythonPy3Txtorcon: " Romain Naour
2023-07-12 21:24 ` [Buildroot] [PATCH v2 01/17] package/python-iptables: fix _find_library() Thomas Petazzoni via buildroot
2023-08-25 16:11 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox