summaryrefslogtreecommitdiffhomepage
path: root/web/content/docs
diff options
context:
space:
mode:
Diffstat (limited to 'web/content/docs')
-rw-r--r--web/content/docs/_index.md7
-rw-r--r--web/content/docs/develop.md46
-rw-r--r--web/content/docs/install.md62
-rw-r--r--web/content/docs/status.md40
4 files changed, 155 insertions, 0 deletions
diff --git a/web/content/docs/_index.md b/web/content/docs/_index.md
new file mode 100644
index 0000000..8893fad
--- /dev/null
+++ b/web/content/docs/_index.md
@@ -0,0 +1,7 @@
+---
+title: Docs
+---
+
+Everything about building, testing and the current state of zash. The
+authoritative documents are in the source tree: `README.md`, `DESIGN.md` and
+`formal/zash-spec.pdf`.
diff --git a/web/content/docs/develop.md b/web/content/docs/develop.md
new file mode 100644
index 0000000..392987e
--- /dev/null
+++ b/web/content/docs/develop.md
@@ -0,0 +1,46 @@
+---
+weight: 20
+title: Development
+description: How zash is tested, benchmarked and kept warning-free.
+---
+
+
+zash is one C23 source directory with a flat `.POSIX` makefile, and the tests
+are shell scripts compared against expected output.
+
+## The suite
+
+```sh
+make check # behavioural tests against ./zash
+make asan # ASan + UBSan build, whole suite
+make valgrind # whole suite under Valgrind, leaks included
+make bench # CPU time against dash, bash, ksh, zsh, oksh
+make format tidy # clang-format, clang-tidy
+```
+
+The tests are at several levels:
+
+- Behavioural tests for every feature. Portable ones also run under dash, and
+ the outputs are compared, so a disagreement with an existing ash-family
+ shell is always visible - either a bug or a deliberate difference.
+- Sanitizer and Valgrind runs of the whole suite on Linux.
+- Process accounting tests that assert the exact process count of a construct,
+ so `$(echo x)` creating a process fails the suite instead of quietly costing
+ a `fork()`.
+- Security tests for what a shell must never do: create a file more permissive
+ than the umask allows, find a command in the current directory, or run what
+ an expansion or a file name produced.
+- Interactive tests that drive the shell through a pseudo-terminal: editor keys
+ in emacs and vi modes, completion, history, prompts, job control. They need
+ python3 and are skipped without it.
+
+On z/OS the same behavioural and process-accounting tests run in either
+character mode, plus a z/OS-only group. There is no ASan or Valgrind there;
+Language Environment's heap checker does that job instead.
+
+## Benchmarks as tests
+
+`bench/run.sh` compares each shell's output with the reference shell's, so a
+wrong answer fails the run instead of being timed and forgotten. `bench/
+report.sh` and `bench/deploy.sh` are the two scripts that look most like what
+the shell is for.
diff --git a/web/content/docs/install.md b/web/content/docs/install.md
new file mode 100644
index 0000000..3b6d670
--- /dev/null
+++ b/web/content/docs/install.md
@@ -0,0 +1,62 @@
+---
+weight: 10
+title: Building zash
+description: How to build zash on Linux and on z/OS, and what it links against.
+---
+
+
+Two toolchains, one source tree: Clang on Linux, IBM Open XL C/C++ on z/OS.
+The code is plain C23 and does not use library additions newer than the C
+libraries on either platform.
+
+| Platform | Compiler | Standard |
+| --- | --- | --- |
+| Linux | Clang | `-std=c23` |
+| z/OS | IBM Open XL C/C++ (`ibm-clang`) | `-std=c23` |
+
+## Linux
+
+```sh
+git clone https://github.com/skurtz97/zash
+cd zash
+make # -> ./zash
+make check # run the test suite against it
+make install # copy it into $(DESTDIR)$(BINDIR)
+```
+
+`EDIT=libedit LDLIBS=-ledit` builds against libedit instead of the built-in
+line editor. The default editor is compiled in and initialised only for an
+interactive shell.
+
+## z/OS
+
+```sh
+make # the ASCII build, ./zash
+make zos-ebcdic # the EBCDIC (IBM-1047) build, ./zash-ebcdic
+make zos-check # the functional tests, then the EBCDIC ones
+```
+
+Both builds are 64-bit XPLINK. There is a zopen `buildenv` in the tree, so
+`zopen build -gp` builds both test passes and installs into
+`$ZOPEN_INSTALL_DIR`.
+
+`make zos-heapcheck` runs the suite with Language Environment check zones
+after every heap element, `make zos-debug` and `make zos-dbx` open a debug
+build under `dbx`, and `make zos-amblist` maps the CSECTs of the program
+object.
+
+## Choosing an address mode
+
+Both builds are 64-bit. A 64-bit `fork()` used to cost 4.2 ms against 0.10 ms
+for 31-bit, and a trivial program started in 29.5 ms against 1.1 ms, because
+the 64-bit C run-time was loaded out of the linklist on every start. With that
+run-time in the LPA the two widths cost the same, so the shell takes the wider
+one. `bench/README.md` in the source tree has the measurements.
+
+## Documentation targets
+
+`make doc` builds the source reference with Doxygen into `docs/html`, and a
+PDF when `pdflatex` is present. `make docs` adds HTML and PDF of `README.md`
+and `DESIGN.md`, `make spec` typesets `formal/zash-spec.pdf` with typst, and
+`make other-docs` runs the last two together. On z/OS those tools are usually
+missing; the targets say so rather than failing silently.
diff --git a/web/content/docs/status.md b/web/content/docs/status.md
new file mode 100644
index 0000000..2c3b247
--- /dev/null
+++ b/web/content/docs/status.md
@@ -0,0 +1,40 @@
+---
+weight: 30
+title: Status
+description: What works on Linux and on z/OS today, and what is still from documentation.
+---
+
+
+## Linux
+
+Feature-complete for a first release: the scripting core, the FreeBSD and Korn
+extensions, job control, and the interactive layer (built-in editor with emacs
+and vi modes, completion, history, `fc`, libedit optional). It builds
+warning-free with Clang as C23 and passes its suite plain, under ASan/UBSan and
+under Valgrind.
+
+## z/OS
+
+Builds in both character modes with Open XL, 64-bit, passes its suite including
+the `zos/` group, and debugs with `dbx`. The Language Environment heap-checker
+run is the one exception: two signal tests fail there and pass in `zos-check`.
+
+Data set redirection and `tso` are the parts still written from documentation.
+
+## Language level
+
+Plain C23, and the project draws the line at the language itself: no
+`<stdbit.h>`, `<stdckdint.h>` or other library additions newer than the
+platforms' C libraries. A system whose libc is older still builds it.
+
+## Not planned
+
+- bash or ksh93 extensions: arrays, process substitution, `${var//a/b}`, brace
+ expansion, coprocesses.
+- The legacy z/OS XL C/C++ compiler (`xlc`).
+- Portability to every UNIX. Linux is supported and most development and all
+ sanitizer testing happens there; other POSIX systems will probably work but
+ are not a target.
+
+The roadmap and the reasoning behind each decision are in `DESIGN.md` in the
+source tree.