Page MenuHomeFreeBSD

lang/python310: Add OPTIONS for: editline, ports editline, ports readline or none
AbandonedPublic

Authored by pstef on May 21 2022, 10:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 7:07 AM
Unknown Object (File)
Dec 30 2023, 9:48 AM
Unknown Object (File)
Dec 20 2023, 8:19 AM
Unknown Object (File)
Nov 29 2023, 11:22 AM
Unknown Object (File)
Oct 27 2023, 4:43 PM
Unknown Object (File)
Oct 11 2023, 8:35 PM
Unknown Object (File)
Oct 9 2023, 9:02 AM
Unknown Object (File)
Oct 9 2023, 9:02 AM
Subscribers

Details

Reviewers
koobs
Group Reviewers
Python
Summary
lang/python310: Add OPTIONS for: editline, ports editline, ports readline or none

Reviewed_by: ??? (python)
Differential_Revision: D35282

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

pstef created this revision.

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)

koobs retitled this revision from python310: give choice between base editline, ports editline, ports readline or none to lang/python310: Add OPTIONS for: editline, ports editline, ports readline or none.May 22 2022, 1:11 AM
koobs edited the summary of this revision. (Show Details)
koobs added a reviewer: Python.
koobs requested changes to this revision.May 22 2022, 1:20 AM
koobs added a subscriber: koobs.

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

This revision now requires changes to proceed.May 22 2022, 1:20 AM