# Contributing to whoson Small tool, small rules. ## Building whoson is a single C23 file with no external library, so it builds on z/OS and nowhere else: ```sh make # -> ./whoson make check # under the CEE heap checker and storage report make format # clang-format -i whoson.c make tidy # clang-tidy, which needs the z/OS headers make install # -> ~/.local/bin/whoson ``` Needs IBM Open XL C/C++ 2.2 (`ibm-clang`, pinned by absolute path in the `Makefile`) and z/OS 2.5 or later, the oldest target that compiler accepts. `buildenv` is the zopen port. From a checkout or a release tree: ```sh zopen build # stable: the release tarball zopen build -b DEV # the git tree on main ``` It builds with the compiler zopen detects, runs `make check`, and installs `whoson` under `$ZOPEN_INSTALL_DIR`; on a system where `/usr/local/zopen` is read-only, `export ZOPEN_INSTALL_DIR=~/.local/zopen` first. Bump `WHOSON_VERSION` there with `VERSION` in the `Makefile`; CI checks they agree. GNU make and IBM's make both have to parse the Makefile: keep it to POSIX make syntax (`?=` is out), and let `make -n` stay free of side effects. ## Style `C-PROGRAMMING-STANDARDS.md` is the authority for language level, types, comments and the Makefile targets; this list is only what a change here has to remember. - Warnings are bugs. The tree builds with `-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wstrict-prototypes -Wmissing-prototypes`; a warning from any of them, or from `clang-tidy` with `.clang-tidy`, gets fixed rather than silenced. `.clang-tidy` needs the z/OS headers (``), so only a z/OS build environment can run it, and IBM Open XL ships no clang-tidy: the only one on the host is zopen's LLVM, which cannot compile z/OS `va_list` (`__builtin_zos_va_start`). `make tidy` therefore reports those compiler errors and nothing else; the Ubuntu CI job enforces clang-format. - C23: `nullptr` rather than `NULL`, `static_assert`, and `constexpr` for the buffer and column widths. Compiler-only attributes go through a macro (`PRINTFLIKE`). - Types are `typedef struct name { ... } name;`, and no variable, function or field reuses a type name. - `make format` before committing; `.clang-format` is the authority, and CI checks the result against clang-format 23.1.5. - Comments say why, not what, and the file header says what the control-block walk and the process table give and what they do not. Functions, types and globals carry a Doxygen `@brief`; struct members carry `/**< */`. ## Changes - One PR per change, branched from `main`, merged through the PR. - Touching how a control block or a `ps` row is parsed means saying which field was wrong and what the probe or `ps` showed. Do not adjust an example to make a claim true. - No binaries in the tree, and nothing generated (`.clangd` indexes, `whoson.json`) gets committed. ## Releasing 1. Bump `VERSION` in the `Makefile`, `WHOSON_VERSION` in `buildenv`, and add the entry to `CHANGELOG.md`. 2. Merge, then tag `main` with `v` and push the tag. 3. `.github/workflows/release.yml` refuses a tag that disagrees with `VERSION`, takes the release notes from that `CHANGELOG.md` section, and attaches the source archive with its sha256. `buildenv` fetches that same archive for the zopen stable build. There is no binary in a release: whoson only builds on z/OS, so a release ships the sources and the build instructions.