lang/python310: Add OPTIONS for: editline, ports editline, ports readline or none Reviewed_by: ??? (python) Differential_Revision: D35282
Details
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
I think I'll need to drop the "editline (ports)" option, there's no way to choose one or the other when both are installed.
Huh, as it is, it cannot pick up the base editline at all. It's looking for /lib/libedit.so.0 and ours (well, mine) is /lib/libedit.so.8.
What the port does is:
$ file /usr/local/lib/libedit.so.0
/usr/local/lib/libedit.so.0: symbolic link to libedit.so.0.0.68
The port turns out to be a Debian-made repackaging of the NetBSD library.
But what we do is:
$ file /lib/libedit.so.0
/lib/libedit.so.0: cannot open `/lib/libedit.so.0' (No such file or directory)
$ file /lib/libedit.so.8
/lib/libedit.so.8: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, for FreeBSD 13.1 (1301502), stripped
python3.10 looks for these:
open("/lib/libedit.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) ERR#2 'No such file or directory'
open("/usr/lib/libedit.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) ERR#2 'No such file or directory'
open("/usr/lib/compat/libedit.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) ERR#2 'No such file or directory'
open("/usr/local/lib/libedit.so.0",O_RDONLY|O_CLOEXEC|O_VERIFY,014232266000) = 3 (0x3)
Thanks for this Piotr.
Python has supported multiple editline implementations at build time for a long time, though getting the correct build/linking behaviour has been problematic for various reasons as the Python build system is notoriously finicky. See our problems with gettext (libintl) and include ordering in the past, and in some cases still today for other third party dependencies).
The best path forward, and something we've wanted for a long time is to use Modules/Setup [1] functionality provided by upstream to explicitly pass build/link customisations for each component, such that more widely scoped and problematic global flags modifications that cause major issues are not required.
- Use Modules/Setup to set editline build/link flags/variables
- We'll want to add these OPTIONS for all lang/python* ports whos upstream branch supports multiple editline implementations. I believe this is all of them.
- Prefer OPTION name readline in line with upstream naming of their autoconf option AC_ARG_WITH([readline],
- QA test confirmation across all supported FreeBSD versions, tier 1 archs and editline options would be great, in particular confirming Python links against the expected implementation in all cases, deterministically, even when other implementations are available on the system.
[1] https://github.com/python/cpython/blob/main/Modules/Setup#L210