From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: Re: Dropping Python 2 (python-m2crypto) Date: Sat, 22 May 2021 14:25:20 +0200 Message-ID: <8536194f-d8e7-b90a-dbaa-860691ce726d@ipfire.org> In-Reply-To: <309E6440-7625-4B74-A571-DBD2D81DA9E3@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1625733411239746288==" List-Id: --===============1625733411239746288== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Michael and All, On 20/05/2021 12:15, Michael Tremer wrote: > Hello, >=20 > Since Core Update 158 is now open, I would like to finish migrating the rem= aining Python 2 modules. >=20 > Fedora has dropped crda a little while ago and added some scripts to wirele= ss-regdb: >=20 > https://src.fedoraproject.org/rpms/wireless-regdb >=20 > I think we should follow that path and add the udev rules to lfs/wireless-r= egdb and adapt this script for our needs: >=20 > https://src.fedoraproject.org/rpms/wireless-regdb/blob/rawhide/f/setregd= omain I have been working on this script but I have reached an impasse. The script as it is, presumes that /etc/localtime is a symlink to one of=20 the timezones in /usr/share/zoneinfo/ If localtime is a file and not a symlink then the scripts man page says=20 that the system admin must create a file called regdomain containing the=20 country code in /etc/sysconfig/ IPFire does not use symlinks to the zoneinfo files so the country code=20 can't be created by the script. localtime can't just be read as it is a binary file. zdump could read it=20 but that is not available in IPFire as it is commented out in the glibc=20 rootfile and anyway it would say that the TZ=3D"/etc/localtime" so that=20 wouldn't help either. I tried it on another system that did have zdump. I thought I could use the location routine with the local-ipaddress from=20 red but that won't work if IPFire is behind another router as red would=20 then be a private ip address. Then I thought about doing a similar thing as with DDNS to "Guess the=20 real public IP with help of an external server" but I am not sure if=20 that could be just done without letting people know we are accessing an=20 external server. So I have reached the point where the script will not work as it is and=20 I have not been able to figure out a way to find the country code that=20 has been selected for the IPFire installation. Hopefully there is an easy option that someone can point me to that I=20 have missed to recognise. Looking forward to any suggestions. Regards, Adolf. >=20 > We could then drop crda and all dependencies. >=20 > Would you be up for having a look at this? >=20 > -Michael >=20 >> On 14 May 2021, at 20:28, Adolf Belka wrote: >> >> Hi Michael, >> >> The blockage of nmap to removing python2 was resolved but I have a new one= now that may be more difficult to resolve. >> >> python-m2crypt was able to be successfully built with python3. However crd= a uses python-m2crypt and from what I have read it only works with python2. >> >> When I do the build then M2Crypto is in python3.8/site-packages/ and crda = gives the following error >> >> >> make[1]: Entering directory '/usr/src/crda-4.14' >> GEN keys-gcrypt.c >> Trusted pubkeys: pubkeys/linville.key.pub.pem pubkeys/sforshee.key.pu= b.pem >> ERROR: Failed to import the "M2Crypto" module: No module named _m2cry= pto >> Please install the "M2Crypto" Python module. >> On Debian GNU/Linux the package is called "python-m2crypto". >> >> >> No matter what I do crda doesn't find python-m2crypto. If I change the pyt= hon-m2crypto lfs from using >> >> cd $(DIR_APP) && python3 setup.py build >> cd $(DIR_APP) && python3 setup.py install --root=3D/ >> >> to >> >> cd $(DIR_APP) && python setup.py build >> cd $(DIR_APP) && python setup.py install --root=3D/ >> >> then crda builds successfully. >> >> Arch Linux and Gentoo have a python3 patch for crda (the same patch for bo= th) but it makes no difference for my build. >> >> >> Regards, >> >> Adolf >> >> >> On 05/05/2021 16:27, Michael Tremer wrote: >>> Hello, >>> >>> I would like to talk about what has been discussed at the last developer = conference call this week: Dropping Python 2 >>> >>> This version of Python has reached its end of life and will no longer rec= eive any security fixes. Hence we need to get rid of it as soon as possible. >>> >>> However, there is lots of software that still depends on it which has to = be migrated away first. >>> >>> There are at least the following packages: >>> >>> boost >>> fetchmail >>> fireinfo >>> iotop >>> ipaddr >>> libxml2 >>> libxslt >>> newt >>> nmap >>> python >>> python-clientform >>> python-daemon >>> python-distutils >>> python-distutils-extra >>> python-docutils >>> python-feedparser >>> python-inotify >>> python-ipaddress >>> python-m2crypto >>> python-mechanize >>> python-optional-src >>> python-pyparsing >>> python-rssdler >>> python-setuptools >>> python-six >>> python-typing >>> >>> We also have the following scripts: >>> >>> config/ca-certificates/certdata2pem.py >>> config/unbound/unbound-dhcp-leases-bridge >>> >>> Fireinfo is written by us and has a lot of C which will make it a little = bit more difficult to migrate. We would also have to be very careful to not c= hange any behaviour of the current implementation. >>> >>> The rest is probably either software that is entirely written in Python 2= or software that brings bindings for Python. The latter case is easy because= we can either force it to build with Python 3 or we just disable the binding= s. >>> >>> Ultimately we might need to keep Python around in the build system if the= re are other packages that rely on it. However, it would be great if we were = able to remove it from the distribution very soon. Looking at his list, it do= es not seem to be too difficult. >>> >>> Would anyone be up to help and remove Python from any of those packages a= bove? I would like to aim for Core Update 158 and remove as much stuff as pos= sible - if we can everything - and then remove Python 2 in the update after t= hat. If anyone has any custom scripts or applications, people will have some = time to migrate away. >>> >>> Best, >>> -Michael >=20 --=20 Sent from my laptop --===============1625733411239746288==--