FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Build the readline module against libedit instead of GNU readline by hmaarrfk · Pull Request #936 · conda-forge/python-feedstock · GitHub

Build the readline module against libedit instead of GNU readline - #936

Draft
hmaarrfk wants to merge 2 commits into
conda-forge:mainfrom
hmaarrfk:libedit
Draft

hmaarrfk wants to merge 2 commits into
conda-forge:mainfrom
hmaarrfk:libedit

Conversation

hmaarrfk commented Sep 22, 2026
edited
Loading

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 python@3.11+ 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.

TODO before leaving draft

<details><summary>Claude's draft</summary>

Replace the GPL-licensed GNU readline host/build dependency with the
BSD-licensed NetBSD libedit (conda-forge `libedit`) on unix, and pass
`--with-readline=editline` to configure so CPython's readline module
uses its libedit backend (editline/readline.h, -ledit).

The test now asserts `readline.backend == "editline"` so a silent
configure fallback (to GNU readline or to no readline module) fails the
build instead of passing unnoticed.

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

Other tools:
- conda-build 26.7.1
- rattler-build 0.75.0
- rattler-build-conda-compat 1.4.18

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/35782722216. Examine the logs at this URL for more detail.

conda-forge-admin pushed a commit to conda-forge/conda-forge-pinning-feedstock that referenced this pull request Sep 22, 2026
<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>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL