GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Build the readline module against libedit instead of GNU readline by hmaarrfk · Pull Request #936 · conda-forge/python-feedstock

Conversation

@hmaarrfk

@hmaarrfk hmaarrfk commented Sep 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I would really love to revive this effort.

I don't think many of the original objections were right, and now that uv has shipped with libedit support, i feel like there is a strong precedence for this.

I'm waiting on conda-forge/libedit-feedstock#15 to mark this PR as ready for review

Claude's write-up

This depends on conda-forge/libedit-feedstock#15. conda-forge's current libedit (3.1.20250104) re-sends signals with kill(0, signo), which signals the whole process group. With CPython on libedit, Ctrl-C then turns into an endless KeyboardInterrupt loop when python runs under another process such as uv run (astral-sh/uv#13919). #15 updates libedit to 20260512, which calls raise(signo) instead. This PR stays in draft until that update is merged and published.

Why reprioritize this now

#387 (open since 2020) asks for a way to use python without GPL-3 readline. Past discussion (#191, #192, #387, conda-forge/sqlite-feedstock#30) stalled because of concerns that libedit is "an incomplete readline clone". Since then, two major Python distributions have switched to libedit on Linux, not only macOS:

  • uv / python-build-standalone builds its own libedit for Linux and macOS, "to avoid GPL licensing requirements of readline" (quirks).
  • Homebrew passes --with-readline=editline unconditionally for [email protected]+ and depends on its own libedit on Linux (uses_from_macos "libedit", formula). The stated reason is licensing.
  • The python.org macOS installers have always used libedit.

Since 3.13 the default interactive REPL is _pyrepl, which does its own line editing, history, completion and bracketed paste without readline or libedit (PEP 762). That reduces the user-visible risk.

GNU readline has also caused problems of its own here: conda-forge/readline-feedstock#35 was conda's libreadline.so.8 shadowing the system copy and breaking the system /bin/sh. libedit's library is libedit.so.0, so it can't clash like that.

Changes

  • recipe/meta.yaml: readline → libedit in host, and in build when cross-compiling (unix only).
  • recipe/build_base.sh: add --with-readline=editline.
  • recipe/run_test.py: assert readline.backend == "editline". Without it, a configure fallback to GNU readline or to no readline module would pass the tests.
  • Re-rendered; the readline pin drops out of .ci_support. libedit has no global pin, so its run_exports (>=3.1.x,<3.2) provides the bound.

This uses NetBSD libedit (conda-forge libedit, editline/readline.h, -ledit), which is what CPython's --with-readline=editline expects. It is not conda-forge's editline package, which is troglobit/editline. CPython doesn't support that one, and it lacks about 30 functions Modules/readline.c needs.

Local testing

  • linux_64_build_typereleasechannel_targetsconda-forge_mainfreethreadingno built in docker with build-locally.py, against libedit 20250104.
  • configure: checking how to link readline... edit.
  • readline.cpython-315-x86_64-linux-gnu.so links libedit.so.0. The python package depends on libedit >=3.1.20250104,<3.2.0a0 and no longer on readline.
  • All package tests passed, including the backend assert, plus the cython, setuptools, libpython and libpython-static tests.
  • osx, the other linux arches, debug and freethreading builds have not been built locally.

Known behavior differences

These matter only when the readline backend is used: PYTHON_BASIC_REPL, input that isn't a terminal, input(), pdb/cmd, the sqlite3 CLI.

  • libedit reads ~/.editrc, not ~/.inputrc. Third-party readline.parse_and_bind("tab: complete") silently does nothing; the stdlib's site, cmd, pdb and sqlite3 branch on readline.backend and handle it.
  • The history file format differs (_HiStOrY_V2_ header, \040 escapes). Existing GNU-format ~/.python_history files are unreadable in the basic REPL. _pyrepl reads both formats.
  • History truncation drops the libedit header, and libedit then can't read the file back (Python limited history test fails when configured to use editline instead of readline python/cpython#123018). The fix, gh-123018: Keep the libedit history file header when truncating python/cpython#157165, is merged to main and 3.14; the 3.15 backport ([3.15] gh-123018: Keep the libedit history file header when truncating (GH-157165) python/cpython#157172) is still open.
  • Minor: a skipped set history-size test; get_begidx/get_endidx count characters instead of bytes for non-ASCII input; Ctrl-C in Ctrl-R search needs three presses (CTRL+C/KeyboardInterrupt in editline not working properly on macOS REPL python/cpython#100610).

TODO before leaving draft

  • Update libedit to 3.1.20260512 (includes signal fix) libedit-feedstock#15 merged and published; rebuild against libedit 20260512.
  • Carry gh-123018: Keep the libedit history file header when truncating python/cpython#157165 as a recipe patch until the 3.15 backport lands.
  • Get green CI on osx. conda-forge has never shipped python with libedit on osx.
  • Decide whether downstream packages that relied on python bringing in readline without declaring it need attention.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

claydugo reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@conda-forge-admin

conda-forge-admin commented Sep 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipe/meta.yaml:

  • ℹ️ The recipe is not parsable by parser conda-souschef (grayskull). This parser is not currently used by conda-forge, but may be in the future. We are collecting information to see which recipes are compatible with grayskull.
  • ℹ️ The recipe is not parsable by parser conda-recipe-manager. The recipe can only be automatically migrated to the new v1 format if it is parseable by conda-recipe-manager.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/37564196210. Examine the logs at this URL for more detail.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hmaarrfk hmaarrfk mentioned this pull request Sep 22, 2026
Add global pin for libedit 3.1 conda-forge/conda-forge-pinning-feedstock#8962
Merged
conda-forge-admin pushed a commit to conda-forge/conda-forge-pinning-feedstock that referenced this pull request Sep 22, 2026
@hmaarrfk
Add global pin for libedit 3.1
a778645
<details><summary>Claude's draft</summary>

libedit had no global pin, so each feedstock built against whatever
libedit version was latest at build time. Pin it to '3.1', matching the
x.x upper bound in libedit's run_exports (the date component changes on
every release without an ABI break; soname has stayed libedit.so.0).

This gives consistent host versions across feedstocks and a place to
start a migration if a 3.2 / soname bump ever happens. No migration is
needed now since all existing builds are 3.1.

Motivated by conda-forge/python-feedstock#936, which switches python's
readline module from GNU readline to libedit.

Resume this Claude session:
```
cd /home/mark/git/feedstock/python-feedstock
claude --resume 6596da16-c7f8-423a-8123-3dde1ed72ef3
```
</details>
@isuruf

isuruf commented Oct 6, 2026

Copy link
Copy Markdown
Member

@conda-forge-admin, rerender

conda-forge-webservices[bot] reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hmaarrfk

hmaarrfk commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@conda-forge-admin please rerender

conda-forge-webservices[bot] reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@conda-forge-admin

conda-forge-admin commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/37556995841. Examine the logs at this URL for more detail.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

h-vetinari
h-vetinari reviewed Oct 7, 2026
View reviewed changes
Comment thread recipe/meta.yaml Resolved

Uh oh!

There was an error while loading. Please reload this page.

hmaarrfk added 2 commits October 6, 2026 22:53
@hmaarrfk
Build readline module against libedit instead of GNU readline
1ccf96e
<details><summary>Claude's draft</summary>

Swap GNU readline (GPL-3) for NetBSD libedit as the backend of the
`readline` module on unix.

- recipe/meta.yaml: `readline` -> `libedit` in host, and in build when
  cross-compiling. The line carries no version bound; libedit has no
  global pin, so its run_exports provide the runtime constraint.
- recipe/build_base.sh: pass `--with-readline=editline` to configure.
- recipe/run_test.py: assert `readline.backend == "editline"` so that a
  configure fallback to GNU readline, or to no readline module at all,
  fails the tests instead of passing silently.

This is conda-forge's `libedit` (editline/readline.h, -ledit), which is
what CPython's `--with-readline=editline` expects, not the troglobit
`editline` package.

Resume this Claude session:
```
cd /home/mark/git/feedstock
claude --resume 7ff2fa23-4419-41f9-a79e-e91603337a97
```
</details>
@hmaarrfk
MNT: Re-rendered with conda-smithy 2026.9.23 and conda-forge-pinning …
d00cac6
…2026.10.06.17.21.00

Other tools:
- conda-build 26.9.0
- rattler-build 0.76.1
- rattler-build-conda-compat 1.4.19
@hmaarrfk
hmaarrfk force-pushed the libedit branch from af6fc42 to d00cac6 Compare October 7, 2026 02:54
@hmaarrfk
hmaarrfk marked this pull request as ready for review October 7, 2026 02:55
@hmaarrfk
hmaarrfk requested review from chrisburr, isuruf, jakirkham, katietz, mbargull, msarahan, ocefpaf, pelson, scopatz and xhochy as code owners October 7, 2026 02:55
@hmaarrfk

hmaarrfk commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

rebased and ready to go. thx @isuruf and @h-vetinari

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@conda-forge-admin
conda-forge-admin merged commit 5307b00 into conda-forge:main Oct 9, 2026
31 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@hmaarrfk

hmaarrfk commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Sorry what happened here?

how did the admin merge this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@xhochy

xhochy commented Oct 10, 2026

Copy link
Copy Markdown
Member

@isuruf based his PR #947 on these commits.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hmaarrfk

hmaarrfk commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Understood

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hmaarrfk hmaarrfk mentioned this pull request Oct 11, 2026
libedit for older pythons? #948
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@h-vetinari h-vetinari h-vetinari left review comments
@chrisburr chrisburr Awaiting requested review from chrisburr chrisburr is a code owner
@isuruf isuruf Awaiting requested review from isuruf isuruf is a code owner
@jakirkham jakirkham Awaiting requested review from jakirkham jakirkham is a code owner
@katietz katietz Awaiting requested review from katietz katietz is a code owner
@mbargull mbargull Awaiting requested review from mbargull mbargull is a code owner
@msarahan msarahan Awaiting requested review from msarahan msarahan is a code owner
@ocefpaf ocefpaf Awaiting requested review from ocefpaf ocefpaf is a code owner
@pelson pelson Awaiting requested review from pelson pelson is a code owner
@scopatz scopatz Awaiting requested review from scopatz scopatz is a code owner
@xhochy xhochy Awaiting requested review from xhochy xhochy is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@hmaarrfk @conda-forge-admin @isuruf @xhochy @h-vetinari
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.