Commit 7883f0b
committed
osh: interactive line editing/history/completion via GNU readline
osh built --without-readline, which disables ALL interactive features (line
editing, history, completion) -- and Oils has no fallback editor: every path is
gated behind HAVE_READLINE, and libedit's readline-compat layer is missing
functions Oils calls (rl_list_funmap_names, rl_callback_sigcleanup, ...). So
readline is the only way to give osh interactivity.
LICENSING: GNU readline is GPLv3, so the osh binary is now a GPLv3 combined work
(Oils itself is Apache-2.0). This is the only GPL artifact in the set; it was a
deliberate choice to enable osh's interactive features.
Add common/readline.sh: static GNU readline 8.3 built with musl-cross against the
in-tree static ncurses, mirroring common/ncurses.sh (idempotent, fetch +
checksums/sources/readline/). Because Oils probes and links a bare `-lreadline`
with no `-lncurses`, the installed libreadline.a is merged with the in-tree
ncurses (and libhistory.a) via `ar -M` into one self-contained archive, so the
bare `-lreadline` resolves readline + history + termcap. Like ncurses/libedit the
tarball is fetched fresh and checksum-verified; it is not committed (/build is
gitignored).
Wire it into osh: build readline, replace --without-readline with
--readline <prefix> (the option exists since 0.25.0). Also add a musl `cc`
wrapper alongside the existing `c++` one: Oils' configure feature probes
(cc_quiet) default to the host `cc`, which cannot link the musl libreadline.a, so
readline detection was silently failing and osh fell back to --without-readline;
the wrapper makes the probes match the actual musl build (and keeps feature
detection musl-accurate).
Verified across the full range (0.25.0..0.37.0) on both arches: osh now links
readline (the `history` builtin lists commands instead of erroring "Oils wasn't
compiled with readline"), and core features are intact ($((6*7))=42, pattern
matching). Regenerated checksums/build/{amd64,arm64}/osh_*;
verify_build_checksums passes on both arches.1 parent 40609f3 commit 7883f0b
29 files changed
Lines changed: 145 additions & 27 deletions
File tree
- checksums
- build
- amd64
- osh_0.25.0/bin
- osh_0.26.0/bin
- osh_0.27.0/bin
- osh_0.28.0/bin
- osh_0.29.0/bin
- osh_0.30.0/bin
- osh_0.31.0/bin
- osh_0.32.0/bin
- osh_0.33.0/bin
- osh_0.34.0/bin
- osh_0.35.0/bin
- osh_0.36.0/bin
- osh_0.37.0/bin
- arm64
- osh_0.25.0/bin
- osh_0.26.0/bin
- osh_0.27.0/bin
- osh_0.28.0/bin
- osh_0.29.0/bin
- osh_0.30.0/bin
- osh_0.31.0/bin
- osh_0.32.0/bin
- osh_0.33.0/bin
- osh_0.34.0/bin
- osh_0.35.0/bin
- osh_0.36.0/bin
- osh_0.37.0/bin
- sources/readline
- common
- variants
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments