bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?)


From: Testing Purposes
Subject: Re: Bash 5.1: rl_readline_version = 0x801 (shouldn't it be 0x0801 ?)
Date: Wed, 9 Dec 2020 15:55:56 -0500

On Tue, Dec 8, 2020 at 8:49 PM Chet Ramey <chet.ramey@case.edu> wrote:

> On 12/8/20 6:32 PM, Lawrence Velázquez wrote:
>
> > Such information could just be added to the output of bash --version
> > (or perhaps as a shell variable à la BASH_VERSION). There is no
> > need for a separate command-line option.
>
> Why, though? What is valuable about knowing which version of readline is
> linked with a particular bash binary? (Or, more accurately, knowing
> whether or not that bash binary is linked with an external version of
> readline, knowing that specific bash versions are always shipped with
> specific readline versions.)
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/


----------
BACKGROUND:
----------
In Appendix A of the official Bash manual, it says that "suggestions and
‘philosophical’ bug reports" are requested — so please bear with me while I
get a bit philosophical about the experience that led to this thread.

I'll begin with a bit of demographic perspective:

If we divide the entire Bash user base into three categories — beginner,
intermediate and advanced — I would arbitrarily guess that only 2% are
truly "advanced".

This elite demographic would certainly *NOT* include me — but it would
include many of the people on the bug-bash mailing list.  They live and
breathe this stuff — they have a deep understanding of Bash and its
configuration.  They also have a mastery of the C language and are
therefore able to properly interpret the implications of the Bash source
code.

The overwhelming majority of Bash users, however, do not fit this
description.


-------------
MY EXPERIENCE:
-------------
When Bash 5.1 came out two days ago, I was excited to build it and try it!

However, since I knew the latest version of Bash was dependent on the
latest version of Readline in order to work properly, it was reasonable for
a non-expert like me to assume that Readline also needed to be built.  This
is especially true since I could find no step-by-step building instructions
or clear-cut requirements in either the online or offline documentation.

Nonetheless, as an experiment, I went ahead and built Bash 5.1 anyway —
without first building its core dependency, Readline 8.1.

I was surprised to discover that everything worked perfectly!

And, when I pasted a script into LXTerminal, all the pasted text was
selected / highlighted by default — a brand-new behavior.  That was my
tip-off that my build of Bash 5.1 was somehow using Readline 8.1 — even
though I had not consciously done anything to build or install it.

So, on my Debian Buster-based Raspberry Pi OS system, I ran this command
line to search for all Readline-related packages:

sudo apt list --installed | grep readline

And this was the output:

libreadline-dev/stable,now 7.0-5 arm64 [installed]
libreadline7/stable,now 7.0-5 arm64 [installed]
readline-common/stable,stable,now 7.0-5 all [installed]

And indeed, 7.0 is the Readline version that currently comes with Debian:

https://packages.debian.org/source/buster/readline

Yet I also know that 5.0 is the Bash version that currently comes with
Debian — so I was a bit surprised that Debian's version of Bash wasn't
accompanied by its "sister" package — Readline 8.0:

https://packages.debian.org/buster/bash


----------
CONCLUSION:
----------
It was at this point that I realized the latest version of Readline must
have been included with the Bash source code — and that I didn't need to do
anything more.

Nonetheless, like any good "amateur scientist" that wasn't sure about his
theory, it was only natural to see if I could confirm my hypothesis.

Bash is a critical piece of software to me — so I wanted to make sure that
everything was proper.  I assumed it would be a simple task.

But I was surprised to discover that there was no easy way to determine
what version of Readline my copy of Bash was using — even though Bash is
intimately dependent on having the proper version of Readline.

Instead, on a third-party website, after a full hour of searching, I
finally discovered an obscure external method to confirm that my copy of
Bash was using the right version of Readline.

A further layer of complication, as this thread clearly illustrates, is
that the output of that external method is not intuitive to the 98% of
non-experts.

And there it is — the full story of the multi-hour rabbit hole I fell into
in my seemingly simple quest — to determine what version of Readline that
Bash is using!

I'm obviously biased by my personal experience — and how involved it turned
out to be.

Nonetheless, I think it would be very helpful if that fundamental
information could eventually be added to the output of:

bash --version


reply via email to

[Prev in Thread] Current Thread [Next in Thread]