Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.9] bpo-13501: allow choosing between readline and libedit#25420

Closed
tnir wants to merge 1 commit into
python:3.9python/cpython:3.9from
tnir:backport-bpo-13501-for-3.9tnir/cpython:backport-bpo-13501-for-3.9Copy head branch name to clipboard
Closed

[3.9] bpo-13501: allow choosing between readline and libedit#25420
tnir wants to merge 1 commit into
python:3.9python/cpython:3.9from
tnir:backport-bpo-13501-for-3.9tnir/cpython:backport-bpo-13501-for-3.9Copy head branch name to clipboard

Conversation

@tnir

@tnir tnir commented Apr 15, 2021

Copy link
Copy Markdown

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

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)
@the-knights-who-say-ni

Copy link
Copy Markdown

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 Missing

Our records indicate the following people have not signed the CLA:

@tnir

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
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@vstinner

Copy link
Copy Markdown
Member

@gpshead: Hum, this is a new feature. I'm not comfortable with backporting it.

@tnir: Can you please elaborate why do you need this change? Can't you use libreadline with Python 3.9 for now? Can you wait for Python 3.10, scheduled next October (2021)?

@gpshead

gpshead commented Apr 15, 2021

Copy link
Copy Markdown
Member

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.

@vstinner

Copy link
Copy Markdown
Member

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?

@tnir

tnir commented Apr 23, 2021

Copy link
Copy Markdown
Author

@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.

@vstinner

Copy link
Copy Markdown
Member

cc @ambv (Python 3.9 Release Manager)

@ambv

ambv commented Apr 23, 2021

Copy link
Copy Markdown
Contributor

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.

@ambv ambv closed this Apr 23, 2021
@tnir

tnir commented Apr 26, 2021

Copy link
Copy Markdown
Author

Thanks @ambv @vstinner

@tnir tnir deleted the backport-bpo-13501-for-3.9 branch April 26, 2021 02:01
@vstinner

Copy link
Copy Markdown
Member

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!).

@tnir

tnir commented Apr 29, 2021

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.