Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to GNU Readline 8.2 #73

Merged
merged 5 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:
with:
platforms: arm64
if: matrix.arch != 'x86_64'
- uses: pypa/cibuildwheel@v2.17.0
- uses: pypa/cibuildwheel@v2.18.1
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.python }}-manylinux*
CIBW_TEST_REQUIRES: ""
CIBW_TEST_COMMAND: python -c "import gnureadline"
- uses: actions/upload-artifact@v4
with:
name: wheel_linux-${{ matrix.arch }}-${{ matrix.python }}
Expand All @@ -59,9 +61,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.17.0
- uses: pypa/cibuildwheel@v2.18.1
env:
CIBW_BUILD: ${{ matrix.python }}-macos*
CIBW_TEST_REQUIRES: ""
CIBW_TEST_COMMAND: python -c "import gnureadline"
- uses: actions/upload-artifact@v4
with:
name: wheel_${{ matrix.os }}-${{ matrix.python }}
Expand Down
9 changes: 4 additions & 5 deletions HACKING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ Release HOWTO

5. Securely upload artifacts to the test PyPI and check that all is well::

$ export IDENTITY=<identity>
$ twine upload -r testpypi wheelhouse/*.tar.gz --sign -i $IDENTITY
$ twine upload -r testpypi wheelhouse/*.whl --sign -i $IDENTITY
$ twine check wheelhouse/*.tar.gz
$ twine upload -r testpypi wheelhouse/*.tar.gz

6. Now upload artifacts to the real PyPI (release!)::

$ twine upload wheelhouse/*.tar.gz --sign -i $IDENTITY
$ twine upload wheelhouse/*.whl --sign -i $IDENTITY
$ twine upload wheelhouse/*.tar.gz
$ twine upload wheelhouse/*.whl

7. Tag the git revision that was released::

Expand Down
10 changes: 10 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
History
=======

8.2.10 (2024-06-10)
-------------------
* #61, #62, #65, #69: Supports Python 3.11 and 3.12, but not yet 3.13
* New readline override mechanism via site customization
* Overhaul documentation and tests to reflect this
* Upgrade GitHub Actions to use macos-13 and macos-14 native builds
* Uses Python 3.12.1 readline.c (commit 7225a01, 2023-11-28), also OK for 3.11
* Uses Python 3.10.9 readline.c (commit 5074c35, 2022-10-27), also OK for 3.9
* Updated to build against readline 8.2 (patch-level 10)

8.1.2 (2022-06-14)
------------------
* #57, #58: Now supports arm64 architecture (Apple M1, Raspberry Pi)
Expand Down
16 changes: 12 additions & 4 deletions rl/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,19 @@ if [ `uname` == "Darwin" ]; then
fi

rm -rf readline-lib
tar xzvf readline-8.1.tar.gz
mv readline-8.1 readline-lib
tar xzvf readline-8.2.tar.gz
mv readline-8.2 readline-lib
cd readline-lib
patch -p0 < ../readline81-001
patch -p0 < ../readline81-002
patch -p0 < ../readline82-001
patch -p0 < ../readline82-002
patch -p0 < ../readline82-003
patch -p0 < ../readline82-004
patch -p0 < ../readline82-005
patch -p0 < ../readline82-006
patch -p0 < ../readline82-007
patch -p0 < ../readline82-008
patch -p0 < ../readline82-009
patch -p0 < ../readline82-010
# Force compiler to CC/cc in the case of Darwin
./configure CPPFLAGS='-DNEED_EXTERN_PC -fPIC' $cc_override
# Only the static libraries are required
Expand Down
Binary file removed rl/readline-8.1.tar.gz
Binary file not shown.
Binary file added rl/readline-8.2.tar.gz
Binary file not shown.
92 changes: 0 additions & 92 deletions rl/readline81-001

This file was deleted.

45 changes: 0 additions & 45 deletions rl/readline81-002

This file was deleted.

42 changes: 42 additions & 0 deletions rl/readline82-001
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
READLINE PATCH REPORT
=====================

Readline-Release: 8.2
Patch-ID: readline82-001

Bug-Reported-by: Kan-Ru Chen <[email protected]>
Bug-Reference-ID:
Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109

Bug-Description:

Starting a readline application with an invalid locale specification for
LC_ALL/LANG/LC_CTYPE can cause it crash on the first call to readline.

Patch (apply with `patch -p0'):

*** ../readline-8.2-patched/nls.c 2022-08-15 09:38:51.000000000 -0400
--- nls.c 2022-10-05 09:23:22.000000000 -0400
***************
*** 142,145 ****
--- 142,149 ----
lspec = "";
ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */
+ if (ret == 0 || *ret == 0)
+ ret = setlocale (LC_CTYPE, (char *)NULL);
+ if (ret == 0 || *ret == 0)
+ ret = RL_DEFAULT_LOCALE;
#else
ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;

*** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500
--- patchlevel 2014-03-21 08:28:40.000000000 -0400
***************
*** 1,3 ****
# Do not edit -- exists only for use by patch

! 0
--- 1,3 ----
# Do not edit -- exists only for use by patch

! 1
48 changes: 48 additions & 0 deletions rl/readline82-002
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
READLINE PATCH REPORT
=====================

Readline-Release: 8.2
Patch-ID: readline82-002

Bug-Reported-by: [email protected]
Bug-Reference-ID:
Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-09/msg00049.html

Bug-Description:

It's possible for readline to try to zero out a line that's not null-
terminated, leading to a memory fault.

Patch (apply with `patch -p0'):

*** ../readline-8.2-patched/display.c 2022-04-05 10:47:31.000000000 -0400
--- display.c 2022-12-13 13:11:22.000000000 -0500
***************
*** 2684,2692 ****

if (visible_line)
! {
! temp = visible_line;
! while (*temp)
! *temp++ = '\0';
! }
rl_on_new_line ();
forced_display++;
--- 2735,2740 ----

if (visible_line)
! memset (visible_line, 0, line_size);
!
rl_on_new_line ();
forced_display++;
*** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500
--- patchlevel 2014-03-21 08:28:40.000000000 -0400
***************
*** 1,3 ****
# Do not edit -- exists only for use by patch

! 1
--- 1,3 ----
# Do not edit -- exists only for use by patch

! 2
43 changes: 43 additions & 0 deletions rl/readline82-003
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
READLINE PATCH REPORT
=====================

Readline-Release: 8.2
Patch-ID: readline82-003

Bug-Reported-by: Stefan Klinger <[email protected]>
Bug-Reference-ID:
Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2023-08/msg00018.html

Bug-Description:

Patch (apply with `patch -p0'):

The custom color prefix that readline uses to color possible completions
must have a leading `.'.

*** ../readline-8.2-patched/colors.c 2021-12-08 11:38:25.000000000 -0500
--- colors.c 2023-08-28 16:40:04.000000000 -0400
***************
*** 74,78 ****
static void restore_default_color (void);

! #define RL_COLOR_PREFIX_EXTENSION "readline-colored-completion-prefix"

COLOR_EXT_TYPE *_rl_color_ext_list = 0;
--- 74,78 ----
static void restore_default_color (void);

! #define RL_COLOR_PREFIX_EXTENSION ".readline-colored-completion-prefix"

COLOR_EXT_TYPE *_rl_color_ext_list = 0;
*** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500
--- patchlevel 2014-03-21 08:28:40.000000000 -0400
***************
*** 1,3 ****
# Do not edit -- exists only for use by patch

! 2
--- 1,3 ----
# Do not edit -- exists only for use by patch

! 3
Loading