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 4c5Jqz1Znkz2ylk for ; Mon, 18 Aug 2025 17:00:31 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4c5Jqv4dHYz2xQT for ; Mon, 18 Aug 2025 17:00:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (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) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4c5Jqt4qDhz1XY; Mon, 18 Aug 2025 17:00:26 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1755536426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bc6042hDqcoszAv7IroxeINr20sui5GdCkgY3dnB9CM=; b=sworYrlXlotBh6md1+sISyaJTFSfMGjif1CS4CUf0kKDQT0bzO6P2OQxZ3rgBJdVDi4HOF NiVtxPkW2ZzCPFAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1755536426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bc6042hDqcoszAv7IroxeINr20sui5GdCkgY3dnB9CM=; b=PoqJ0aW74CpHYYYSoznGhWeFH7Sf4Zo0mWEK44kGvN3qMVanPyU+95CxeU7DpQlrkElUFk ZtZZybVA2cbxXtiqk5NgMyF/uln+U/CJT3B/CyiSoOnjARt3g9BJ4JFvZ96JLl9CgOn/ds E4Qehc3k9TKt9A5R1RNBh7dMrFUAl9T3TLEbusofj5rt+He/98V+pSuLiBpYmMhpqbRjz5 ZwlMUDpoliVQ5fwkpKSTzQ/aYMZNI6X3xFMP6X3I1Mt/db4WMaUXLNPWFLdB8Ds9VPH3JW z3AWMyeOl8wLflX4lmzH04/FvOntDG8I/yBFBUzh+jMg1gz4Myt+wY66NNM9oQ== Message-ID: <82074d6c-ea9c-4cc5-a77a-1d0b6c837878@ipfire.org> Date: Mon, 18 Aug 2025 19:00:22 +0200 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Subject: Re: [RFC PATCH 1/2] unbound: Enable the Python module(s) From: Adolf Belka To: Michael Tremer Cc: "IPFire: Development-List" References: <20250425123717.3462310-1-michael.tremer@ipfire.org> <7ab65405-afa1-4d56-8a74-4e9d180940e0@ipfire.org> <851b759d-74da-4df3-aa8f-4838c7db8bba@ipfire.org> Content-Language: en-GB In-Reply-To: <851b759d-74da-4df3-aa8f-4838c7db8bba@ipfire.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Michael, On 18/08/2025 18:17, Adolf Belka wrote: > Hi Michael, > > So I tried swig-4.3.1 but dtc failed to build. > > Looking up the failure message I believe it is the same error that u-boot would have had. A function was changed in swig-4.3.x to use 3 parameters instead of 2. The latest version of dtc and u-boot from Jan 2025 both have commits to resolve it. > > So I will do a build with the newer dtc and test out the building of u-boot on aarch64 with the newer swig and a newer u-boot. The newer dtc built without problems but the python3-tomli still failed. So then I thought it might be because the tomli file was too old so I tried a newer version. That also failed to build but with a different message which Seemed to ring a bell for problems with the pyproject2setuppy module as tomli only has pyproject.toml and no setup.py So then did the build for python3-tomli using the newer commands for working with pyproject.toml however then it failed for no build module, so I put that before the python3-tomli file and did the build again but this time it failed for the same error message as we had with tomli originally File "/usr/lib/python3.10/re.py", line 209, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or bytes-like object I'll have a further think about these build issues. Regards, Adolf. > > Regards, > > Adolf. > > > On 18/08/2025 14:40, Adolf Belka wrote: >> Hi Michael, >> >> On 18/08/2025 13:50, Michael Tremer wrote: >>> Hello, >>> >>> I have the same problem. >>> >>> I have built this from a non-clean build initially and everything was fine. I used that version of Unbound to write and test the code. No problems there whatsoever. >>> >>> But I never managed to run a clean build. It seems that swig messes something up and I cannot tell you at all what that could be. It is not only tomli not compiling. If you comment it out and try to compile the next thing it won’t work either. I don’t know what it could break like this because the problems suddenly seem to occur in the Python standard library. >>> >>> Maybe an update of Swig solves the problem? Would you like to give that a try? >> >> The last swig update I provided had to be reverted because uboot would not build with it. >> >> However there is a new version out now, 4.3.1 from 2025-04-15, so I will give that a go and see if it helps and also do an aarch64 build and see if uboot builds or not. >> >> If it doesn't help or uboot fails to build then I will look at what other packages might need to be moved earlier to be before swig so that all the expected swig bits are built. >> >> Currently we have swig-4.1.0 and the reverted version was 4.3.0, so there are also other versions newer than the existing one that might allow uboot to build and help the issue we are having. >> >> Will have a go at it, although might take a while as I am cleaning my house up to make it child proof as my nephew and family are visiting from end of this week for 5 days. >> >> Regards, >> >> Adolf. >> >>> >>> -Michael >>> >>>> On 16 Aug 2025, at 17:23, Adolf Belka wrote: >>>> >>>> Hi Michael, >>>> >>>> After some time I thought I should have a go at building  with your two patches for the unbound fast flux option but the build fails to complete. >>>> >>>> I am doing the build with the current next repo. >>>> >>>> I have done the build twice and it fails at the same point each time at the python3-tomli build. >>>> >>>> The following is the log output, which I have not been able to interpret to identify what is causing the build to fail. >>>> >>>> >>>> Aug 16 15:11:49: Building python3-tomli make: Entering directory '/home/ahb/sandbox/ipfire-2-builder3/lfs' >>>> make: Nothing to be done for 'download'. >>>> make: Leaving directory '/home/ahb/sandbox/ipfire-2-builder3/lfs' >>>> make: Entering directory '/usr/src/lfs' >>>> tomli-2.0.1.tar.gz checksum OK >>>> ====================================== Installing tomli-2.0.1 ... >>>> Install started; saving file list to /usr/src/lsalr ... >>>> cd /usr/src/tomli-2.0.1 && python3 -m pyproject2setuppy.main build >>>> Traceback (most recent call last): >>>>   File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main >>>>     return _run_code(code, main_globals, None, >>>>   File "/usr/lib/python3.10/runpy.py", line 86, in _run_code >>>>     exec(code, run_globals) >>>>   File "/usr/lib/python3.10/site-packages/pyproject2setuppy/main.py", line 15, in >>>>     main() >>>>   File "/usr/lib/python3.10/site-packages/pyproject2setuppy/__main__.py", line 53, in main >>>>     handler(data) >>>>   File "/usr/lib/python3.10/site-packages/pyproject2setuppy/flit.py", line 91, in handle_flit >>>>     setup(**setup_metadata) >>>>   File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 86, in setup >>>>     _install_setup_requires(attrs) >>>>   File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 75, in _install_setup_requires >>>>     dist = MinimalDistribution(attrs) >>>>   File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 57, in __init__ >>>>     super().__init__(filtered) >>>>   File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 474, in __init__ >>>>     for ep in metadata.entry_points(group='distutils.setup_keywords'): >>>>   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points >>>>     return SelectableGroups.load(eps).select(**params) >>>>   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 459, in load >>>>     ordered = sorted(eps, key=by_group) >>>>   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 1006, in >>>>     eps = itertools.chain.from_iterable( >>>>   File "/usr/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen >>>>     k = key(element) >>>>   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 941, in _normalized_name >>>>     return self._name_from_stem(stem) or super()._normalized_name >>>>   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 622, in _normalized_name >>>>     return Prepared.normalize(self.name) >>>>   File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 871, in normalize >>>>     return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_') >>>>   File "/usr/lib/python3.10/re.py", line 209, in sub >>>>     return _compile(pattern, flags).sub(repl, string, count) >>>> TypeError: expected string or bytes-like object >>>> make: *** [python3-tomli:78: /usr/src/log/tomli-2.0.1] Error 1 >>>> make: Leaving directory '/usr/src/lfs' >>>> >>>> Regards, >>>> >>>> Adolf. >>>> >>>> On 25/04/2025 14:37, Michael Tremer wrote: >>>>> This can be used to script the resolver and use libunbound from Python. >>>>> Signed-off-by: Michael Tremer >>>>> --- >>>>>   config/rootfiles/common/unbound | 4 ++++ >>>>>   lfs/unbound                     | 3 +++ >>>>>   make.sh                         | 2 +- >>>>>   3 files changed, 8 insertions(+), 1 deletion(-) >>>>> diff --git a/config/rootfiles/common/unbound b/config/rootfiles/common/unbound >>>>> index 57390d6d9..03c956503 100644 >>>>> --- a/config/rootfiles/common/unbound >>>>> +++ b/config/rootfiles/common/unbound >>>>> @@ -13,6 +13,10 @@ etc/unbound/unbound.conf >>>>>   usr/lib/libunbound.so.8 >>>>>   usr/lib/libunbound.so.8.1.30 >>>>>   #usr/lib/pkgconfig/libunbound.pc >>>>> +#usr/lib/python3.10/site-packages/_unbound.la >>>>> +usr/lib/python3.10/site-packages/_unbound.so >>>>> +usr/lib/python3.10/site-packages/unbound.py >>>>> +usr/lib/python3.10/site-packages/unboundmodule.py >>>>>   usr/sbin/unbound >>>>>   usr/sbin/unbound-anchor >>>>>   usr/sbin/unbound-checkconf >>>>> diff --git a/lfs/unbound b/lfs/unbound >>>>> index 537ccff7e..8c79125ec 100644 >>>>> --- a/lfs/unbound >>>>> +++ b/lfs/unbound >>>>> @@ -71,6 +71,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) >>>>>    @$(PREBUILD) >>>>>    @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) >>>>>    cd $(DIR_APP) && \ >>>>> + PYTHON_VERSION=3 \ >>>>>    ./configure \ >>>>>    --prefix=/usr \ >>>>>    --sysconfdir=/etc \ >>>>> @@ -83,6 +84,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) >>>>>    --enable-tfo-server \ >>>>>    --enable-ipset \ >>>>>    --with-libmnl \ >>>>> + --with-pythonmodule \ >>>>> + --with-pyunbound \ >>>>>    ac_cv_func_getentropy=no >>>>>      cd $(DIR_APP) && make $(MAKETUNING) >>>>> diff --git a/make.sh b/make.sh >>>>> index 3643b469e..3a673cd2b 100755 >>>>> --- a/make.sh >>>>> +++ b/make.sh >>>>> @@ -1534,6 +1534,7 @@ build_system() { >>>>>    lfsmake2 libevent2 >>>>>    lfsmake2 apr >>>>>    lfsmake2 aprutil >>>>> + lfsmake2 swig >>>>>    lfsmake2 unbound >>>>>    lfsmake2 gnutls >>>>>    lfsmake2 libuv >>>>> @@ -1930,7 +1931,6 @@ build_system() { >>>>>    lfsmake2 minicom >>>>>    lfsmake2 ddrescue >>>>>    lfsmake2 parted >>>>> - lfsmake2 swig >>>>>    lfsmake2 python3-pyelftools >>>>>    lfsmake2 u-boot >>>>>    lfsmake2 wireless-regdb >>>> >>> >>> >> >