From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4jFtdR1cwcz2xWP for ; Thu, 29 Oct 2026 18:52:27 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4jFtdQ13R5z2xLm for ; Thu, 29 Oct 2026 18:52:26 +0000 (UTC) Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4jFtdN6YsKzhP for ; Thu, 29 Oct 2026 18:52:24 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=gmail.com header.s=20260707 header.b="VKJ8XM/e"; spf=pass (mail01.ipfire.org: domain of valter.jansons@gmail.com designates 2607:f8b0:4864:20::52c as permitted sender) smtp.mailfrom=valter.jansons@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; d=lists.ipfire.org; s=202003rsa; cv=none; t=1793299945; b=d/3oMi57BR77wB6oNJDvs19TV2wU1pcQvHqgzmjMlAcEYEu+qPuclg4Uv5EjxH11MxgHaZ /cw2Fv4JRoA2XuJsmntE/lOotVXheCRuJsjqi6PMjIOmZ5ETR2PsAKkmWEC+EcYOrLS9x9 pEdJlj0GgTD97IAKPAut9y5uY7VWyAWY/DTXcZBJp4YrSQXJE0K0OvCYKMxZ0as63ZGwou LNElkHjjx+0nBw+PctDWLy3g1+KH2PExAORrxlXxdye2EG6Ey+JJz23m5w4Xd/tR2ikrqv xZbioPzQ/ORXxJ5CXqZ4KWZSL756U1wJ3rjegsFQjFZbmnBQp5GwvLVdRdbqDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1793299945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=9l/vRCHx37x+6APTtfI3lPSuIDXmBwxB+6H8V9cQQxM=; b=DC/GCEm8u7Ww5r5Ox17y32X0Xn2Le7TecVDobltj9q4aPNQgDy8n2cQpo7RvnHmGSHXSPm DKzS44rvg0UhaDSn8TW/cn5hk7yJgj8uWU+L5lK2Oe9nNKHEoxL5T2A1cZvGj3hioCBdBT f4HZLb2a1TXspQzBCJpsZoaDUCvSkSKSy+99IcNxKHnf4k42oRcGPsOuBLszi5BNXlWrtZ e3hBl/nomP8V+kUW+gltcikI0JsOXiOGRJwnm+rfm72mtu7mcpjNUnpYB4jdGCnr5KQRmV lS/cl5V5Q9sKIlmJRjORbpn2DNqo58iKBEGQrcipcg60s+yzq+wHcCuHB27iYg== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=gmail.com header.s=20260707 header.b="VKJ8XM/e"; spf=pass (mail01.ipfire.org: domain of valter.jansons@gmail.com designates 2607:f8b0:4864:20::52c as permitted sender) smtp.mailfrom=valter.jansons@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-cd60c5da24cso1552255a12.0 for ; Thu, 29 Oct 2026 11:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793299943; x=1793904743; darn=lists.ipfire.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=9l/vRCHx37x+6APTtfI3lPSuIDXmBwxB+6H8V9cQQxM=; b=VKJ8XM/e7M/HPh1Vb8iBBZArEpWlSAON8xS7fJS1V0uUvKpa0R6ZYP1MBlIfIEZedr 0zhKCWp3uEKwNK1K8HaTFJJxAv1IDDCZWWdF9sjq3j3q8Z8nufY/+5Avbr6pLG187eXT N/Ko5ut5t/0sX3nYyB3gn6fvVqVPFRcbJHF1VAnnJ0HYXJBIp/QKpMl+9CCSYNJlDlSB EfQC+DzmROVRFu44dMh/K4VPDMBwc4vhF6xdIkq7c0q0rgUqBU4mZN9sOJPNSpJPEFZo kZ6QmqLNMaArBO93yI0m7rzwyP0GimANPyzY1ccJnZn2nW5Ic7FpUjHg2xOhfwNjOfHI nc/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793299943; x=1793904743; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=9l/vRCHx37x+6APTtfI3lPSuIDXmBwxB+6H8V9cQQxM=; b=cmHQSv+ipmL5Gka93Qr81NLHsZBVFqGp9BPLryX0K7vLNEYN83oC3W+UmCEyq1DsiL zVhHOvi91T5ObRXphsAGCZ1vOX3tiueieGRvszXLrGkY1HHO5MW2VIUokxrZ9q+OcGBx nisoAfjYZNJe+pryHN2BqlBjP8IMd2AzIOLwz7Y5BDC8tyIg9qUdw4KN+DVAcLQZzKCX 9rCnXG8I90JWU997V/04wLBO8+2GKYzGnR+AR6etPAcWgay1FlVF8fmHBz6TvClx9WZY Qji7lskh2EnRaAVVtxaNUtYBn5xrfckOaJcxDUmoj3ViozRVJ+TMItKnMO715bQzpiZI 6XDA== X-Gm-Message-State: AFq9FYI04ZJ4huaaEC9gCY5jtSqVn7OYGJdI8BsBhqStf9y3jJZmlhfQ EvewiGmGHMtn0x3L3KA68xV0gnkjgO4RigBiRgq/bsYwh7nJ7xM4sAWCC53q9fFrovA= X-Gm-Gg: AYBFou3g/EmgrOGmgOtiMxtbXeZ+HVPNNEOp4JDcIVDqtwIuodRqO/p5nUbcz4EFuDF 6EyywNOVV5TW3E14uprPTggBpK3IhWTr8q8QZgY47PaNqo2gFetr6T4fC1Rz1Bw8Gowd/30NY/n RybRgXC24uriLrnUejUwZQFpuozeFbGeCjsf7Rmv3v7y/l4zrvfpc5BrWhLe5MeCH4/Ke6VhIED L5dgbGfvGT9YXTy6aRyb8/5gVJyy1HqMCHULNMHDT6erMwTenn2STxclqCuGz/SqO9+sAlLc76c /SLYPX8gfcGeggJbgfJzdmVrFZRRUV5q8J05jwqTL5WmhGfkIvgqwv5RuWlAmIRrvxWBDU0jVdf bvKI7OWc9W/uDD74anJ+HnzvmP1Tzt8QjYnlpIiA0+DLTTh9ZOC1kGKRQNpXr8saMLvbSsXk50j VL2M1m4iSLefcUn7xQ7h5sTYDk+S4VdE3PbygVroSorD2cthMjIPhfFoy/Vn0TUy3vYv/Tu6PXi o6PqWrnVGIj0NSUEXQGk/ladwmETPCKFJA6lftgRXsbHh+b8kxIlZ9l628PcCYNOEXoz8IGm3Cj G1UUv0UgXa6GPN6hCCy2IA2Yaay2Ijk3Np9bgtZlJ5G9vA== X-Received: by 2002:a17:90b:2887:b0:3a8:6045:5a19 with SMTP id 98e67ed59e1d1-3ae5822b129mr5216468a91.37.1793299942609; Thu, 29 Oct 2026 11:52:22 -0700 (PDT) Received: from VT14-G5.localdomain ([221.146.12.107]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ae6e7d5b8csm5522125a91.1.2026.10.29.11.52.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2026 11:52:22 -0700 (PDT) From: Valters Jansons To: location@lists.ipfire.org Subject: [PATCH] debian: Build each Python version independently Date: Fri, 30 Oct 2026 03:52:17 +0900 Message-ID: <20261029185217.112691-1-valter.jansons@gmail.com> X-Mailer: git-send-email 2.56.0 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Spamd-Result: default: False [-6.84 / 11.00]; BAYES_HAM(-3.00)[100.00%]; R_DKIM_ALLOW(-1.60)[gmail.com:s=20260707]; DKIM_REPUTATION(-0.97)[-0.96771129553882]; SPF_REPUTATION_HAM(-0.78)[-0.77691846176174]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56]; R_DKIM_ALIGNED(-0.10)[strict]; MX_GOOD(-0.10)[gmail-smtp-in.l.google.com]; MIME_GOOD(-0.10)[text/plain]; IP_REPUTATION_HAM(0.00)[asn: 15169(-0.30), country: US(-0.01), ip: 2607:f8b0:4864:20::(-0.80)]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52c:from]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; ALIAS_RESOLVED(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[location@lists.ipfire.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[] X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Queue-Id: 4jFtdN6YsKzhP The pybuild build system wants to build the Python module for each Python version. We must ensure that Autoconf is triggered in a different build directory each time. Otherwise, the builder will think the source is already built and re-use the binary. This is critical for when structs change in Python. Especially, if someone were to build with three or more minor versions, as the ABI is no longer guaranteed. Lua and Perl testing remains configured against the default Python version build. Signed-off-by: Valters Jansons --- For testing this locally, check if `py3versions -i` reports multiple Python versions as installed. Either /usr/share/python3/debian_defaults may need modifying, or a PYBUILD_INTERPRETERS="python3.14 python3.15" envvar should be set. The observed location.so should be different between the Python versions. CPython 3.15.2 headers have broken C extension builds when -Werror=undef is set, as pyport.h references an undefined _Py_STDC_VERSION macro. See https://github.com/python/cpython/issues/160719 Could pass `DEB_CFLAGS_MAINT_APPEND = -Wno-error=undef` to make Sid build as of now. In any case, testing (forky) has 3.15.0 which is ok. debian/rules | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/debian/rules b/debian/rules index 12cb34f..c17b8e6 100755 --- a/debian/rules +++ b/debian/rules @@ -21,24 +21,31 @@ ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES) $(DEB_BUILD_OPTIONS))) CONFIGURE_MAN_PAGES = --disable-man-pages endif +# The pybuild build system wants to build the Python module for each Python version. +# We must ensure that Autoconf is triggered in a different build directory each time. +# Otherwise, the builder will think the source is already built and re-use the binary. +AUTOTOOLS_ARGS = --buildsystem=autoconf --builddir=.pybuild/autotools-{version} +# However, Lua tests will not run against all the build trees - only the default version. +DEFAULT_BUILDDIR = .pybuild/autotools-$(shell py3versions -dv) + export PYBUILD_SYSTEM=custom -export PYBUILD_CLEAN_ARGS=dh_auto_clean +export PYBUILD_CLEAN_ARGS=true export PYBUILD_CONFIGURE_ARGS=intltoolize --force --automake; \ - PYTHON={interpreter} dh_auto_configure -- \ + PYTHON={interpreter} dh_auto_configure $(AUTOTOOLS_ARGS) -- \ $(CONFIGURE_MAN_PAGES) --disable-perl --with-systemd -export PYBUILD_BUILD_ARGS=dh_auto_build -export PYBUILD_INSTALL_ARGS=dh_auto_install --destdir={destdir}; \ +export PYBUILD_BUILD_ARGS=dh_auto_build $(AUTOTOOLS_ARGS) +export PYBUILD_INSTALL_ARGS=dh_auto_install $(AUTOTOOLS_ARGS) --destdir={destdir}; \ mkdir -p {destdir}/usr/lib/python{version}/dist-packages; \ mv {destdir}/usr/lib/python3/dist-packages/_location.so {destdir}/usr/lib/python{version}/dist-packages/_location.so; \ rm -f {destdir}/usr/lib/python3/dist-packages/_location.la {destdir}/usr/lib/*/libloc.la -export PYBUILD_TEST_ARGS=dh_auto_test +export PYBUILD_TEST_ARGS=dh_auto_test $(AUTOTOOLS_ARGS) %: dh $@ --buildsystem=pybuild execute_after_dh_auto_configure: dh_auto_configure $(PERL_MM) -- INC=-I$(CURDIR)/src LIBS= \ - 'LDFROM=$$(OBJECT) -L$(CURDIR)/src/.libs -lloc' + 'LDFROM=$$(OBJECT) -L$(CURDIR)/$(DEFAULT_BUILDDIR)/src/.libs -lloc' # The module does not link against Lua, which the program that loads it provides, # so that it does not pull in Lua 5.1 when it is being loaded by LuaJIT @@ -46,8 +53,8 @@ execute_after_dh_auto_build: set -e; for version in $(LUA_EXTRA_VERSIONS); do \ mkdir -p debian/lua$$version; \ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC \ - -include config.h -Isrc $$($(PKG_CONFIG) --cflags lua$$version) \ - -o debian/lua$$version/location.so src/lua/*.c -Lsrc/.libs -lloc; \ + -include $(DEFAULT_BUILDDIR)/config.h -Isrc $$($(PKG_CONFIG) --cflags lua$$version) \ + -o debian/lua$$version/location.so src/lua/*.c -L$(DEFAULT_BUILDDIR)/src/.libs -lloc; \ done dh_auto_build $(PERL_MM) @@ -66,16 +73,16 @@ execute_after_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) set -e; for version in $(LUA_EXTRA_VERSIONS); do \ - LD_LIBRARY_PATH=$(CURDIR)/src/.libs \ + LD_LIBRARY_PATH=$(CURDIR)/$(DEFAULT_BUILDDIR)/src/.libs \ LUA_CPATH="$(CURDIR)/debian/lua$$version/?.so;;" \ TEST_DATABASE=$(CURDIR)/data/database.db \ TEST_SIGNING_KEY=$(CURDIR)/data/signing-key.pem \ - lua$$version tests/lua/main.lua; \ + lua$$version $(DEFAULT_BUILDDIR)/tests/lua/main.lua; \ done - $(MAKE) testdata.db - LD_LIBRARY_PATH=$(CURDIR)/src/.libs \ - database=$(CURDIR)/testdata.db \ + $(MAKE) -C $(DEFAULT_BUILDDIR) testdata.db + LD_LIBRARY_PATH=$(CURDIR)/$(DEFAULT_BUILDDIR)/src/.libs \ + database=$(CURDIR)/$(DEFAULT_BUILDDIR)/testdata.db \ keyfile=$(CURDIR)/examples/public-key.pem \ dh_auto_test $(PERL_MM) endif -- 2.56.0