bpo-38634: Allow non-apple build to cope with libedit by serge-sans-paille · Pull Request #16986 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation12 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
If Python is used as a library by a binary linking to libedit, the linker
resolves the rl_initialize symbol required by the readline module against
libedit instead of libreadline, which leads to a segfault.
Take advantage of the existing supporting code to have readline module being
compatible with both situations.
https://bugs.python.org/issue38634
Thanks for this PR. There is a long standing open issue (bpo-13501) to generalize libedit support in Python including a PR (#12076) that is more involved than just removing the APPLE conditional code as proposed here. libedit itself has changed over the years so perhaps not all of the changes in #12076 need to be made. But we should probably start from there. Assigning to @gpshead who last looked at bpo-13501.
If Python is used as a library by a binary linking to libedit, the linker resolves the rl_initialize symbol required by the readline module against libedit instead of libreadline, which leads to a segfault.
Take advantage of the existing supporting code to have readline module being compatible with both situations.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I didn't check manually, but I trust @serge-sans-paille for testing it properly :-)
Sorry @serge-sans-paille and @vstinner, I had trouble checking out the 3.7
backport branch.
Please backport using cherry_picker on command line.cherry_picker 7105319ada2e663659020cbe9fdf7ff38f421ab2 3.7
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
The readline module now detects if Python is linked to libedit at runtime on all platforms. Previously, the check was only done on macOS.
If Python is used as a library by a binary linking to libedit, the linker resolves the rl_initialize symbol required by the readline module against libedit instead of libreadline, which leads to a segfault.
Take advantage of the existing supporting code to have readline module being compatible with both situations. (cherry picked from commit 7105319)
Co-authored-by: serge-sans-paille serge.guelton@telecom-bretagne.eu
I did the 3.8 since it was possible to automate it. I'm not interested to backport it to 3.7, since it's too much effort for a rare use case.
miss-islington added a commit that referenced this pull request
The readline module now detects if Python is linked to libedit at runtime on all platforms. Previously, the check was only done on macOS.
If Python is used as a library by a binary linking to libedit, the linker resolves the rl_initialize symbol required by the readline module against libedit instead of libreadline, which leads to a segfault.
Take advantage of the existing supporting code to have readline module being compatible with both situations. (cherry picked from commit 7105319)
Co-authored-by: serge-sans-paille serge.guelton@telecom-bretagne.eu
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request
The readline module now detects if Python is linked to libedit at runtime on all platforms. Previously, the check was only done on macOS.
If Python is used as a library by a binary linking to libedit, the linker resolves the rl_initialize symbol required by the readline module against libedit instead of libreadline, which leads to a segfault.
Take advantage of the existing supporting code to have readline module being compatible with both situations.
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request
The readline module now detects if Python is linked to libedit at runtime on all platforms. Previously, the check was only done on macOS.
If Python is used as a library by a binary linking to libedit, the linker resolves the rl_initialize symbol required by the readline module against libedit instead of libreadline, which leads to a segfault.
Take advantage of the existing supporting code to have readline module being compatible with both situations.
rohieb added a commit to rohieb/cpython that referenced this pull request
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)
gpshead pushed a commit that referenced this pull request
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)
adorilson pushed a commit to adorilson/cpython that referenced this pull request
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)
tnir pushed a commit to tnir/cpython that referenced this pull request
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)
tnir mentioned this pull request