This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Simplify readline / editline detection
Type: enhancement Stage:
Components: Build Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, erlendaasland, gregory.p.smith
Priority: normal Keywords:

Created on 2021-12-16 12:37 by christian.heimes, last changed 2022-04-11 14:59 by admin.

Messages (3)
msg408700 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-12-16 12:37
The configure.ac code for editline/readline detection is complicated. Especially the code for linking with extra termcap libraries makes it complicated to port the check to pkg-config. The termcap checks were added by Greg in bpo-3645 and commit 188209465a966cf046ed7946589aa21767f95e68 .

I propose to simplify the checks and require a readline 4.2 compatible API. GNU readline was released in 2001 (20 years ago). NetBSD libedit editline/readline.h has RL_READLINE_VERSION 0x0402 for at least 10 years.

* drop the check for additional termcap libs
* remove the fallback to completion_matches
* replace AC_CHECK_LIB($LIBREADLINE, ...) checks with a check for RL_READLINE_VERSION >= 0x0402

What do you think?
msg408701 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-12-16 13:07
FWIW, the XCode SDKs for macOS 11 and 12 use the NetBSD editline library.


$ grep "NetBSD: readline" /Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include/readline/readline.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/readline/readline.h:/*	$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $	*/
$ grep RL_READLINE_VERSION /Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include/readline/readline.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/readline/readline.h:#define RL_READLINE_VERSION 	0x0402


This is what Homebrew provides:

$ PKG_CONFIG_PATH=$(brew --prefix readline)/lib/pkgconfig pkg-config readline --cflags --libs
-I/usr/local/Cellar/readline/8.1.1/include -L/usr/local/Cellar/readline/8.1.1/lib -lreadline
msg408934 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-12-19 22:56
> I propose to simplify the checks and require a readline 4.2 compatible API.
+1


BTW:
> GNU readline was released in 2001 (20 years ago).

FTR, GNU Readline _4.2_ was released in 2001  ;)
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90258
2021-12-19 22:56:12erlendaaslandsetmessages: + msg408934
2021-12-16 13:07:06erlendaaslandsetmessages: + msg408701
2021-12-16 12:37:48christian.heimescreate