From b7817c3750a6e1ea54b44cbb1a2b23b86f05e854 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Mon, 25 Jul 2022 03:38:23 +0200 Subject: [PATCH] Release 93u+m/1.0.0-rc.1 We're nearly there! I intend to release ksh 93u+m/1.0.0 on 2022-08-01, precisely ten years after the last canonical 93u+ release. We have a week until then, so here's a release candidate. Please try as hard as you can to break it, and to help fix known bugs. As of this commit, the 1.0 branch is feature-frozen and will only get bugfixes. src/cmd/ksh93/fun/man: - Last-minute fix: .man.try_os_man(): do not look for arguments with / in section 1 and 8; this can cause false positives. --- ANNOUNCE | 58 +++++++----- COPYRIGHT | 7 ++ NEWS | 6 +- README.md | 60 +++---------- TODO | 150 +++++++++++--------------------- src/cmd/ksh93/COMPATIBILITY | 2 +- src/cmd/ksh93/fun/man | 2 +- src/cmd/ksh93/include/version.h | 4 +- 8 files changed, 113 insertions(+), 176 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 6f9be1a11..e922f8166 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,32 +1,46 @@ -Announcing: KornShell 93u+m 1.0.0-beta.(unreleased) +Announcing: KornShell 93u+m/1.0.0-rc.1 https://github.com/ksh93/ksh -In May 2020, when every KornShell (ksh93) development project was -abandoned, development was rebooted in a new fork based on the last -stable AT&T version: ksh 93u+. This new fork is called ksh 93u+m as a -permanent nod to its origin. We're restarting it at version 1.0. Seven -months after the first beta, the second one is ready. Please test this -second beta and report any bugs you find, or help us fix known bugs. +[This is a release candidate. The announcement below is preliminary.] -We're now the default ksh93 in some OS distributions, at least Debian -and Slackware! Even though we don't think it's stable release quality -yet, the consensus seems to be that 93u+m is already much better than -the last AT&T release. +In May 2020, when every KornShell (ksh93) development project was abandoned, +Martijn Dekker reboted development in a new fork based on the last stable +AT&T version: ksh 93u+. He was soon joined by two main developers and a +number of other contributors. This new fork is called ksh 93u+m as a +permanent nod to its origin. + +Now, more than two years, two beta versions, a number of enhancements, and +rougly a thousand bugfixes later, *and* precisely ten years after the last +canonical 93u+ release, version 93u+m/1.0.0 of the KornShell is released! + +As an initial release, this still has known bugs; please do use this version, +but also continue to test it. See TODO to help us fix the known bugs. + +CONTRIBUTORS Main developers: Martijn Dekker, Johnothan King, hyenias -Contributors: Andy Fiddaman, Anuradha Weeraman, Chase, Gordon Woodhull, -Govind Kamat, Harald van Dijk, Lev Kujawski, Marc Wilson, Ryan Schmidt, -Sterling Jensen +Direct contributors: Andy Fiddaman, Anuradha Weeraman, atheik, Chase, +Finnbarr P. Murphy, George Lijo, Govind Kamat, Harald van Dijk, Lev +Kujawski, Marc Wilson, Ryan Schmidt, Sterling Jensen, Trey Valenta, vmihalko + +All applicable third-party OS distribution patches from OpenSUSE, Red Hat +and Solaris have been merged. These are detailed and acknowledged here: +https://github.com/ksh93/ksh/wiki#upstreamed-third-party-ksh-93u-patches + +Many fixes have also been backported from the AT&T 93v- beta as well as the +former ksh2020 project lead by Kurtis Rader and Siteshwar Vashisht; we +appreciate and benefit from their work. Many thanks also to Siteshwar for +graciously donating his 'ksh93' GitHub organisation account! HOW TO GET IT Please download the source code tarball from our GitHub releases page: - https://github.com/ksh93/ksh/releases - To build, follow the instructions in README.md or src/cmd/ksh93/README. +Or ask your distribution package manager to upgrade ksh93 to this version. + HOW TO GET INVOLVED To report a bug, please open an issue at our GitHub page (see above). @@ -35,7 +49,7 @@ To get involved in development, read the brief policy information in README.md and then jump right in with a pull request or email a patch. See the TODO file in the top-level directory for a to-do list. -### MAIN CHANGES between 1.0.0-beta.2 and 1.0.0-(unreleased) ### +### MAIN CHANGES between 1.0.0-beta.2 and 1.0.0 ### New features in built-in commands: @@ -83,6 +97,11 @@ New features in shell options: not immediately executed but instead loaded into the next prompt's edit buffer, allowing further changes. +- When the -b/--notify shell option is on and the vi or emacs/gmacs shell + line editor is in use, 'Done' and similar notifications from completed + background jobs are now inserted directly above the line you're typing, + without affecting your command line display. + ### MAIN CHANGES between 1.0.0-beta.1 and 1.0.0-beta.2 ### New features in built-in commands: @@ -199,11 +218,6 @@ New command line editor features: mode, 7 will now move the cursor seven positions to the left. In vi control mode, this would be entered as: 7 . -- When the -b/--notify shell option is on and the vi or emacs/gmacs shell - line editor is in use, 'Done' and similar notifications from completed - background jobs are now inserted directly above the line you're typing, - without affecting your command line display. - New shell language features: - The &>file redirection shorthand (for >file 2>&1) is now available for diff --git a/COPYRIGHT b/COPYRIGHT index 8b9de0f04..95b7de7db 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -17,6 +17,7 @@ ksh 93u+m general copyright notice # Martijn Dekker # # Johnothan King # # hyenias <58673227+hyenias@users.noreply.github.com> # +# Andy Fiddaman # # Anuradha Weeraman # # atheik # # Chase # @@ -24,8 +25,14 @@ ksh 93u+m general copyright notice # George Lijo # # Govind Kamat # # Harald van Dijk # +# Kurtis Rader # # Lev Kujawski # # Marc Wilson # +# Ryan Schmidt # +# Sterling Jensen <5555776+sterlingjensen@users.noreply.github.com> # +# Siteshwar Vashisht # +# Trey Valenta # +# vmihalko <35222576+vmihalko@users.noreply.github.com> # # # ######################################################################## diff --git a/NEWS b/NEWS index b4d6868c8..8233e785d 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,11 @@ For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0 Any uppercase BUG_* names are modernish shell bug IDs. -2022-07-24: +2022-07-25: + +- Release candidate: ksh 93u+m/1.0.0-rc.1. + +2722-07-24: - Add new 'man' function in src/cmd/ksh93/fun/man. This integrates the --man self-documentation of ksh built-in and external AST commands with your diff --git a/README.md b/README.md index 0591c5607..03413f246 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ # KornShell 93u+m -This repository is used to develop bugfixes +This is version 1.0.x of the 93u+m fork of the KornShell, including a +sizeable number of enhancements and roughly a thousand bugfixes compared to the last stable release (93u+ 2012-08-01) of [ksh93](http://www.kornshell.com/), formerly developed by AT&T Software Technology (AST). @@ -10,57 +11,13 @@ The sources in this repository were forked from the GitHub [AST repository](https://github.com/att/ast) which is no longer under active development. +For information on the shell, see +[`src/cmd/ksh93/README`](https://github.com/ksh93/ksh/tree/1.0/src/cmd/ksh93#readme) +and other files in the same directory. For user-visible fixes, see [NEWS](https://github.com/ksh93/ksh/blame/1.0/NEWS) and click on commit messages for full details. -For all fixes, see [the commit log](https://github.com/ksh93/ksh/commits/). -To see what's left to fix, see [the issue tracker](https://github.com/ksh93/ksh/issues). - -## Policy - -1. Fixing bugs is main focus of the 1.x series. - Major feature development is for future versions (2.x and up). -2. No major rewrites. No refactoring code that is not fully understood. -3. No changes in documented behaviour, except if required for compliance with the - [POSIX shell language standard](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html) - which David Korn [intended](http://www.kornshell.com/info/) for ksh to follow. -4. No 100% bug compatibility. Broken and undocumented behaviour gets fixed. -5. No bureaucracy, no formalities. Just fix it, or report it: create issues, - send pull requests. Every interested party is invited to contribute. -6. To help increase everyone's understanding of this code base, fixes and - significant changes should be fully documented in commit messages. -7. Code style varies somewhat in this historic code base. - Your changes should match the style of the code surrounding them. - Indent with tabs, assuming an 8-space tab width. - Opening braces are on a line of their own, at the same indentation level - as their corresponding closing brace. - Comments always use `/*`...`*/`. -8. Good judgment may override this policy. - -## Why? - -Between 2017 and 2020 there was an ultimately unsuccessful -[attempt](https://github.com/att/ast/tree/2020.0.1) -to breathe new life into the KornShell by extensively refactoring the last -unstable AST beta version (93v-). -While that ksh2020 effort is now abandoned and still has many critical bugs, -it also had a lot of bugs fixed. More importantly, the AST issue tracker -now contains a lot of documentation on how to fix those bugs, which made -it possible to backport many of them to the last stable release instead. -This ksh 93u+m reboot now incorporates many of these bugfixes, -plus patches from -[OpenSUSE](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-OpenSUSE), -[Red Hat](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-Red-Hat), -and -[Solaris](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-Solaris), -as well as many new fixes from the community -([1](https://github.com/ksh93/ksh/pulls?q=is%3Apr+is%3Amerged), -[2](https://github.com/ksh93/ksh/issues?q=is%3Aissue+is%3Aclosed+label%3Abug)). -Though there are many -[bugs left to fix](https://github.com/ksh93/ksh/issues), -we are confident at this point that 93u+m is already the least buggy version -of ksh93 ever released. -As of late 2021, distributions such as Debian and Slackware have begun -to package it as their default version of ksh93. +For all fixes, see [the commit log](https://github.com/ksh93/ksh/commits/1.0). +For known issues in the current release, see [TODO](https://github.com/ksh93/ksh/blob/1.0/TODO). ## Build @@ -104,6 +61,9 @@ bin/package help ``` Many other commands in this repo self-document via the `--help`, `--man` and `--html` options; those that do have no separate manual page. +The autoloadable `man` function in +[`src/cmd/ksh93/fun/man`](https://github.com/ksh93/ksh/blob/1.0/src/cmd/ksh93/fun/man) +integrates this self-documentation into your regular `man` command. ### Test diff --git a/TODO b/TODO index eba7aeca9..f35701819 100644 --- a/TODO +++ b/TODO @@ -1,124 +1,76 @@ -TODO for ksh 93u+m +The following bugs and issues are known for ksh 93u+m 1.0.0-rc1: -See the issue tracker for up-to-date information: -https://github.com/ksh93/ksh/issues +Memory leak when initialising associative array in subshell +https://github.com/ksh93/ksh/issues/94 -______ -Enhancements to do: +command substitution botches output of non-waited-for child processes +https://github.com/ksh93/ksh/issues/124 -* Add -T (-o functrace) option as in bash - https://github.com/ksh93/ksh/issues/162 +wrong typeset -p output after unsetting multidimensional array elements +https://github.com/ksh93/ksh/issues/148 -* History pattern search menu (SHOPT_EDPREDICT) needs work - https://github.com/ksh93/ksh/issues/233 +printf %T date parsing: GNU-style "ago" date spec completely broken +https://github.com/ksh93/ksh/issues/182 -* Use real pipes instead of sockets - https://github.com/ksh93/ksh/issues/327 +typeset -L/-R: string length breaks on multibyte characters +https://github.com/ksh93/ksh/issues/189 -______ -Known bugs in ksh 93u+m 1.0.0-beta.2 (HELP IS WANTED to fix these): +Unicode code points in $'...' strings should vary according to the locale +https://github.com/ksh93/ksh/issues/193 -* Memory leak when initialising associative array in subshell - https://github.com/ksh93/ksh/issues/94 +Variable expansion corruption in single-line function on 32-bit systems +https://github.com/ksh93/ksh/issues/203 -* command substitution botches output of non-waited-for child processes - https://github.com/ksh93/ksh/issues/124 +Segfault with very large extended glob patterns +https://github.com/ksh93/ksh/issues/207 -* Intermittent coprocess hang on Debian/Ubuntu and Solaris - https://github.com/ksh93/ksh/issues/132 +process substitution cannot be part of a larger argument +https://github.com/ksh93/ksh/issues/215 -* wrong typeset -p output after unsetting multidimensional array elements - https://github.com/ksh93/ksh/issues/148 +Nested compound assignment misparsed in $(...) command substitution +https://github.com/ksh93/ksh/issues/269 -* File descriptor is unexpectedly closed after exec in subshell - https://github.com/ksh93/ksh/issues/161 +Builtins don't handle I/O errors +https://github.com/ksh93/ksh/issues/313 -* printf %T date parsing: GNU-style "ago" date spec completely broken - https://github.com/ksh93/ksh/issues/182 +bug in printf when %b and %x$ are used in same format +https://github.com/ksh93/ksh/issues/324 -* typeset -L/-R: string length breaks on multibyte characters - https://github.com/ksh93/ksh/issues/189 +namespaces don't work properly when defined within functions +https://github.com/ksh93/ksh/issues/325 -* Linux i386: variable expansion corruption in single-line function - https://github.com/ksh93/ksh/issues/203 +Associative arrays of various types fail to be unset +https://github.com/ksh93/ksh/issues/345 -* Segfault with very large extended glob patterns - https://github.com/ksh93/ksh/issues/207 +Variable with discipline function in subshell causes memory leak +https://github.com/ksh93/ksh/issues/404 -* funcname.ksh crashes under standard malloc - https://github.com/ksh93/ksh/issues/212 +Memory leak(s) when modifying PATH in various contexts +https://github.com/ksh93/ksh/issues/405 -* process substitution cannot be part of a larger argument - https://github.com/ksh93/ksh/issues/215 +Discipline function .unset only called once for array subscripts +https://github.com/ksh93/ksh/issues/419 -* Compound array regression on OpenBSD with standard malloc - https://github.com/ksh93/ksh/issues/229 +Function autoload apparently broken on DragonFly BSD +https://github.com/ksh93/ksh/issues/432 -* 'typeset -m'-related crash on OpenBSD compiled with standard malloc - https://github.com/ksh93/ksh/issues/231 +confusing behaviour of backreferences with alternation +https://github.com/ksh93/ksh/issues/447 -* Freeze/crash on OpenBSD with -D_std_malloc involving typeset and command substitution - https://github.com/ksh93/ksh/issues/264 +Alias expansion loop not detected in command substitution +https://github.com/ksh93/ksh/issues/458 -* Nested compound assignment misparsed in $(...) command substitution - https://github.com/ksh93/ksh/issues/269 +Make KEYBD trap handling code multibyte-aware +https://github.com/ksh93/ksh/issues/460 -* Crash on bin/shtests -px heredoc - https://github.com/ksh93/ksh/issues/306 +$LINENO incorrect after compound assignment +https://github.com/ksh93/ksh/issues/484 -* Multibyte characters get corrupted when KEYBD trap is set - https://github.com/ksh93/ksh/issues/307 +Tab completion can cause vi mode to switch to "control" +https://github.com/ksh93/ksh/issues/485 -* .sh.match index array result issues, crash after unset - https://github.com/ksh93/ksh/issues/308 +Shell quoting within bracket patterns has no effect +https://github.com/ksh93/ksh/issues/488 -* Builtins don't handle I/O errors - https://github.com/ksh93/ksh/issues/313 - -* block devices not seekable when open on fd 0, 1 or 2 - https://github.com/ksh93/ksh/issues/318 - -* bug in printf when %b and %x$ are used in same format - https://github.com/ksh93/ksh/issues/324 - -* namespaces don't work properly when defined within functions - https://github.com/ksh93/ksh/issues/325 - -* Associative arrays of various types fail to be unset - https://github.com/ksh93/ksh/issues/345 - -* types survive exec of hashbangless script - https://github.com/ksh93/ksh/issues/350 - -* Backtick command substitutions can't nest double quotes - https://github.com/ksh93/ksh/issues/352 - -* Line continuation breakage within $(comsub) - https://github.com/ksh93/ksh/issues/367 - -______ -Fix regression test failures: - -- There are some serious regression test failures on OpenBSD when ksh - is compiled with AST vmalloc disabled, so the system standard malloc(3) - is used. These probably represent real ksh93 bugs exposed by OpenBSD's - security hardening mechanisms. - -- Several known memory leaks have their tests disabled in tests/leaks.sh - and are marked TODO. These need tracking down and fixing. - -______ -Fix currently known bugs affecting shell scripting. These are identified by -their modernish IDs. For exact details, see code/comments in: -https://github.com/modernish/modernish/tree/0.16/lib/modernish/cap/ - -- BUG_BRACQUOT: shell quoting within bracket patterns has no effect. This - bug means the '-' retains it special meaning of 'character range', and an - initial ! (and, on some shells, ^) retains the meaning of negation, even - in quoted strings within bracket patterns, including quoted variables. - -- BUG_IFSGLOBS: In glob pattern matching (as in case or parameter - substitution with # and %), if IFS starts with ? or * and the "$*" - parameter expansion inserts any IFS separator characters, those characters - are erroneously interpreted as wildcards when quoted "$*" is used as the - glob pattern. +"$*" does pattern matching if the first char of $IFS is a wildcard +https://github.com/ksh93/ksh/issues/489 diff --git a/src/cmd/ksh93/COMPATIBILITY b/src/cmd/ksh93/COMPATIBILITY index 23bb442c6..ff7751df3 100644 --- a/src/cmd/ksh93/COMPATIBILITY +++ b/src/cmd/ksh93/COMPATIBILITY @@ -1,4 +1,4 @@ - ksh 93u+m vs. ksh 93u+ + ksh 93u+m/1.0.0 vs. ksh 93u+ The following is a list of changes between ksh 93u+ 2012-08-01 and the new ksh 93u+m reboot that could cause incompatibilities in rare corner cases. diff --git a/src/cmd/ksh93/fun/man b/src/cmd/ksh93/fun/man index 4538e344e..3b552402d 100755 --- a/src/cmd/ksh93/fun/man +++ b/src/cmd/ksh93/fun/man @@ -111,7 +111,7 @@ namespace man try_os_man() { - [[ $(command man -s "$1" "$2" 2>/dev/null) == *$'\n'*$'\n'*$'\n'* ]] + [[ $2 != */* && $(command man -s "$1" "$2" 2>/dev/null) == *$'\n'*$'\n'*$'\n'* ]] } # The main function puts it all together. When given a single argument, diff --git a/src/cmd/ksh93/include/version.h b/src/cmd/ksh93/include/version.h index 8268165fd..23841717e 100644 --- a/src/cmd/ksh93/include/version.h +++ b/src/cmd/ksh93/include/version.h @@ -22,8 +22,8 @@ #include #define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */ -#define SH_RELEASE_SVER "1.0.0-beta.2" /* semantic version number: https://semver.org */ -#define SH_RELEASE_DATE "2022-07-24" /* must be in this format for $((.sh.version)) */ +#define SH_RELEASE_SVER "1.0.0-rc.1" /* semantic version number: https://semver.org */ +#define SH_RELEASE_DATE "2022-07-25" /* must be in this format for $((.sh.version)) */ #define SH_RELEASE_CPYR "(c) 2020-2022 Contributors to ksh " SH_RELEASE_FORK /* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */