-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
[3.9] bpo-13501: allow choosing between readline and libedit #25420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In contrast to macOS, libedit is available as its own include file and library on Linux systems to prevent file name clashes. So if both libraries are available on the system, readline is currently chosen by default; and if only libedit is available, it is not found at all. This patch adds a way to link against libedit by adding the following arguments to configure: --with-readline link against libreadline (the default) --with-readline=editline link against libeditline --with-readline=no disable building the readline module --without-readline (same) The runtime detection of libedit vs. readline was already done in commit 7105319 (2019-12-04, serge-sans-paille: "bpo-38634: Allow non-apple build to cope with libedit (pythonGH-16986)"). Fixes: pythonGH-12076 ("bpo-13501 Build or disable readline with Editline") Fixes: bpo-13501 ("Make libedit support more generic; port readline / libedit to FreeBSD") Co-authored-by: Enji Cooper (ngie-eign) Co-authored-by: Martin Panter (vadmium) Co-authored-by: Robert Marshall (kellinm)
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
FWIW I didn't create this backport PR. But I think we have made build enabling changes in a 3.x release in the past (the enable optimizations stuff? i'd have to go searching configure.ac history in 3.n branches). Ultimately up to the release manager to decide if we want to accept this in our 3.9 branch. This is most useful for BSD and Darwin systems, and in environments where LGPL avoidance is required. |
I'm not going to hold this PR, it's up to you @gpshead ;-) I'm just surprised that it became an issue in 2021, whereas Python was linked to libreadline for years without complains, no? |
@vstinner This could be a new feature on build... With this change, we can have two options: to avoid GPL-licensed component, which helps various environments and companies avoiding GPL, and to compile CPython without readline-dev or libedit-dev in a lower-resource environment. |
cc @ambv (Python 3.9 Release Manager) |
This is a cool enhancement but it's definitely not a bugfix so it's questionable for inclusion in 3.9. Yes, we had somebody force similar changes in the past, he's no longer contributing. This is a perfect candidate for the upcoming 3.10, especially seeing how 3.9 is already mid-way through its bugfix release lifecycle. |
Yep, the feature should already be part of Python 3.10 alpha releases: https://docs.python.org/dev/using/configure.html#cmdoption-with-readline (I recently wrote this whole new page, to document configure options!). |
But, currently I am building Python 3.7, I will need to patch Python 3.7 (and then 3.9 in the future) with this patch 😁 as this patch was rejected. |
Backport GH-24189 (bpo-13501) for Python 3.9.
In contrast to macOS, libedit is available as its own include file and
library on Linux systems to prevent file name clashes. So if both
libraries are available on the system, readline is currently chosen by
default; and if only libedit is available, it is not found at all. This
patch adds a way to link against libedit by adding the following
arguments to configure:
--with-readline link against libreadline (the default)
--with-readline=editline link against libeditline
--with-readline=no disable building the readline module
--without-readline (same)
The runtime detection of libedit vs. readline was already done in commit
7105319 (2019-12-04, serge-sans-paille: "bpo-38634: Allow
non-apple build to cope with libedit (GH-16986)").
Fixes: GH-12076 ("bpo-13501 Build or disable readline with Editline")
Fixes: bpo-13501 ("Make libedit support more generic; port readline / libedit to FreeBSD")
Co-authored-by: Enji Cooper (ngie-eign)
Co-authored-by: Martin Panter (vadmium)
Co-authored-by: Robert Marshall (kellinm)
https://bugs.python.org/issue13501