Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into fix-pty-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnoKing committed Mar 9, 2024
2 parents 596650e + 9a48c61 commit fa0891a
Show file tree
Hide file tree
Showing 230 changed files with 3,270 additions and 4,062 deletions.
36 changes: 36 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@ This documents significant changes in the dev branch of ksh 93u+m.
For full details, see the git log at: https://github.com/ksh93/ksh
Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library.

2024-03-07:

- Fixed a bug that caused some systems to corrupt the display of multibyte
characters in the command prompt.

2024-03-05:

- Fixed a regression, introduced on 2021-02-07, that made the common AST
options '--???ESC' and '--???noESC' ineffective for enabling/disabling
ANSI escape codes for emphasis in the output of --man or --help.
(Type, e.g., print '--???' for more information about common options.)

- Fixed a rare crash in the 'print' built-in due to the use of uninitialised
memory while parsing options. Bug introduced in ksh 93u+ 2012-05-31.

- Fixed a 2021-04-14 regression: the 'exec' command (which runs a command
that replaces the shell process and therefore should only run external
commands) would run a path-bound built-in if /opt/ast/bin is in PATH.

- Fixed a corner case bug: a ${ shared-state command substitution;} failed to
capture the standard output of a command that replces the shell via 'exec'.

2024-02-29:

- Improved the robustness of the routines handling the execution by ksh of a
script without an initial #! path. More memory is freed up after ksh forks.

- Fixed a crash that could occur after 'typeset +x var' when var was imported
from the environment and then a discipline function was set for it.

2024-02-23:

- [v1.1] The commands ':', 'true', 'false', 'break' and 'continue' have been
optimised to run faster in loops in certain common cases. For example, the
'true' in 'while true; do some_stuff || break; done' now runs faster.

2024-02-22:

- Fixed a crash that occurred when starting ksh with no TERM variable in the
Expand Down
26 changes: 7 additions & 19 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ command=${0##*/}
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$'
[-?
@(#)$Id: '$command$' (ksh 93u+m) 2024-02-22 $
@(#)$Id: '$command$' (ksh 93u+m) 2024-03-07 $
]
[-author?Glenn Fowler <gsf@research.att.com>]
[-author?Contributors to https://github.com/ksh93/ksh]
Expand Down Expand Up @@ -579,7 +579,7 @@ SEE ALSO
pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3)

IMPLEMENTATION
version package (ksh 93u+m) 2024-02-22
version package (ksh 93u+m) 2024-03-07
author Glenn Fowler <gsf@research.att.com>
author Contributors to https://github.com/ksh93/ksh
copyright (c) 1994-2012 AT&T Intellectual Property
Expand Down Expand Up @@ -2113,10 +2113,7 @@ case $x in

case $KEEP_SHELL in
0) save_PATH=$PATH
if PATH=$(getconf PATH 2>/dev/null)
then PATH=$PATH:$path
else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path
fi
PATH=$DEFPATH:$path
for i in ksh ksh93 mksh yash bash sh
do if onpath "$i" && checksh "$_onpath_"
then SHELL=$_onpath_
Expand All @@ -2138,7 +2135,7 @@ case $x in

# tame the environment

unset ERROR_OPTIONS ENV
unset ERROR_OPTIONS ENV _KSHRC_WELCOMED_

# finalize the views

Expand Down Expand Up @@ -3066,18 +3063,9 @@ make|view)
case $EXECROOT in
$INSTALLROOT)
$make cd $INSTALLROOT/bin
if executable /bin/cp
then cp=/bin/cp
else cp=cp
fi
if executable /bin/mv
then mv=/bin/mv
else mv=mv
fi
if executable /bin/rm
then rm=/bin/rm
else rm=rm
fi
cp=$(PATH=$DEFPATH; command -v cp) || cp=cp
mv=$(PATH=$DEFPATH; command -v mv) || mv=mv
rm=$(PATH=$DEFPATH; command -v rm) || rm=rm
for i in \
ksh tee cp ln mv rm \
*ast*.dll *cmd*.dll *dll*.dll *shell*.dll
Expand Down
7 changes: 6 additions & 1 deletion src/Mamfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ note * This build script is in an extended Make Abstract Machine (MAM)
note * language. Documentation is at: src/cmd/INIT/README-mamake.md
note *

setv MAMAKE_STRICT 2
setv MAMAKE_STRICT 3

make test virtual
make test_announce virtual
Expand All @@ -13,5 +13,10 @@ make test virtual
make all virtual
exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS}
done
make announce_build_done virtual notrace
prev cmd/ksh93/ksh
exec - ${<} -c 'print "# KornShell $KSH_VERSION"'
exec - echo "# Type 'bin/package use' to try it out"
done
done
done
2 changes: 1 addition & 1 deletion src/cmd/INIT/Mamfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ note * This build script is in an extended Make Abstract Machine (MAM)
note * language. Documentation is at: src/cmd/INIT/README-mamake.md
note *

setv MAMAKE_STRICT 2
setv MAMAKE_STRICT 3
setv INSTALLROOT ../../..
setv CC cc

Expand Down
35 changes: 26 additions & 9 deletions src/cmd/INIT/README-mamake.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ higher than the previous highest one; details of those changes are documented
throughout this file and listed in the appendix below.
This makes it possible to test or backport old code using the current build
system. Current Mamfiles should use the highest strict level available.
The current highest available strict level is **2**.
The current highest available strict level is **3**.

## MAM variables ##

Expand Down Expand Up @@ -184,6 +184,9 @@ dependencies of its own, it may even be empty; this has the effect of merely
declaring a dependency on a prerequisite file, such as a source code file that
comes with the distribution or a file generated by a previously run Mamfile.

Making a prerequisite that is currently being made, or one that has already
been made, produces a warning; at strict level 3 and up, this is an error.

One or more *attribute*s may be specified by appending them to the `make` command.
(At strict levels \< 2, they may also be appended to the `done` command; the effect
is the same either way. At strict level 1, this produces a deprecation warning.)
Expand Down Expand Up @@ -238,6 +241,9 @@ The `prev` command is used in two ways:
in a manner equivalent to an empty `make`...`done` block,
with the optional *attribute*s applied to the new rule, and
a nonexistent prerequisite is an error unless a `virtual` or `dontcare` attribute is given.
Declaring a dependency on a prerequisite that is currently being made
(i.e.: directly or indirectly within that prerequisite's block) produces
a warning; at strict level 3 and up, this is an error.

### Setting MAM variables ###

Expand Down Expand Up @@ -363,7 +369,7 @@ building, and executed as normal commands while building the current directory.

#### …while scanning and sorting leaf directories ####

If there is a leaf directory named `INIT`, it will always be built before
Any leaf directories with names that start with `INIT` will always be built before
all others. For all other leaf directories, the presence of any `bind`
command of the form `bind -lfoo` anywhere in a leaf
directory's Mamfile causes the leaf directory named `libfoo` (if it exists)
Expand All @@ -379,12 +385,17 @@ causes a MAM variable `mam_lib`*libraryname* to be defined (see **MAM variables*
The variable will contain either the compiler argument for linking to the library *libraryname*
(either the `-l`*libraryname* flag, or the full path in case of a static library)
or, if the `dontcare` attribute is specified, possibly the empty string.
Any library dependencies are also included (see below).
This can be used both for AST libraries shipped with the distribution and for system libraries.
If the library file is found in the distribution,
its time stamp is checked and the current target is marked as outdated if it is newer.
For each corresponding *.a library archive dependency built previously,
its time stamp is checked and the current target is marked as outdated if it is
newer, as if a `prev` had been executed for it.

The effect of `bind` is global, not scoped; it takes effect for all commands
physically following it, regardless of `make``done` nesting level.
The variable set by `bind` is global, but the marking of the target as
outdated applies to the current rule only, so it may be necessary to
repeat a `bind` command when statically linking executables that depend
on a library, otherwise they may not be relinked when the library changes.
The `mam_lib`*libraryname* variable will not be regenerated when repeating a `bind`.

There is also a mechanism to communicate library dependency information across Mamfiles and `mamake` invocations.
If a file named *libraryname*`.req` in the current directory
Expand Down Expand Up @@ -415,9 +426,10 @@ The *variable* is restored to its previous state after the loop completes.
Note that `loop` causes repeated reading and processing of Mamfile lines,
*not* necessarily repeated execution. For instance, a loop can be used to
consolidate repetitive `make``done` rules. However, each rule is only made
once and subsequent rules by the same name are skipped over. So it only
makes sense to do this if the contained make target names are modified by
the expansion of the iteration *variable*.
once and subsequent rules by the same name are an error at strict level 3
and up, or skipped over at strict \< 3. So it only makes sense to do this
if the contained make target names are modified by the expansion of the
iteration *variable*.

`loop` requires a seekable input file (i.e.: not a pipe).

Expand All @@ -437,6 +449,8 @@ maintain Mamfiles by hand. The following lists the important changes.
* The automatic variables `${@}`, `${<}`, `${^}` and `${?}` have been added.
* An iteration block command, `loop``done`, has been added.
* A command to set common code for shell actions, `shim`, has been added.
* Attempting to make a rule that has already been made produces a warning.
* Attempting to declare a dependency on a rule currently being made produces a warning.
* **At strict level 1 and up:**
* Appending attributes to `done` instead of `make` is deprecated
and produces a warning.
Expand All @@ -456,3 +470,6 @@ maintain Mamfiles by hand. The following lists the important changes.
without scanning the values for recursive variable references.
* `setv` does not remove leading and trailing `"` from the value.
* Shell actions have pathname expansion (globbing) disabled by default.
* **At strict level 3 and up:**
* Attempting to make a rule that has already been made is an error.
* Attempting to declare a dependency on a rule currently being made is an error.
Loading

0 comments on commit fa0891a

Please sign in to comment.