diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d377f8a..b0eead1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,8 @@ name: CI # i686-openkal the ok image of i386, run by okrun built for i686-linux-musl # dos a DOS program, and the i386 image carried as one (technical # experiment only), run under DOSBox Staging through dirun +# svr4 a System V Release 4 program (i386), run under ibcs-us, an +# emulation of the kernel's interface, as each of its three interfaces # freebsd the musl rows of FreeBSD are built here and run in a FreeBSD VM, # with okrun built for them running an ok image there # @@ -46,7 +48,7 @@ on: env: MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF || '' }} - MCPP_VERSION: 2026.11.16.1 + MCPP_VERSION: 2026.11.18.1 XLINGS_VERSION: v2026.10.26.1 XLINGS_NON_INTERACTIVE: '1' @@ -61,20 +63,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install xlings and mcpp - run: | - curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ - | bash -s "$XLINGS_VERSION" - export PATH="$HOME/.xlings/subos/current/bin:$PATH" - echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" - for attempt in 1 2 3 4 5 6; do - xlings update > /dev/null 2>&1 || true - if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi - [ "$attempt" = 6 ] && { echo "::error::mcpp could not be installed"; exit 1; } - sleep 60 - done - mcpp --version - mcpp self config --mirror GLOBAL + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} - name: Every member and runner package is in the indexes mcpp reads run: | @@ -284,20 +276,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install xlings and mcpp - run: | - curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ - | bash -s "$XLINGS_VERSION" - export PATH="$HOME/.xlings/subos/current/bin:$PATH" - echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" - for attempt in 1 2 3 4 5 6; do - xlings update > /dev/null 2>&1 || true - if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi - [ "$attempt" = 6 ] && { echo "::error::mcpp could not be installed"; exit 1; } - sleep 60 - done - mcpp --version - mcpp self config --mirror GLOBAL + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} - name: The hosted program, thirty-two bit working-directory: checks/hosted @@ -334,20 +316,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install xlings and mcpp - run: | - curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ - | bash -s "$XLINGS_VERSION" - export PATH="$HOME/.xlings/subos/current/bin:$PATH" - echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" - for attempt in 1 2 3 4 5 6; do - xlings update > /dev/null 2>&1 || true - if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi - [ "$attempt" = 6 ] && { echo "::error::mcpp could not be installed"; exit 1; } - sleep 60 - done - mcpp --version - mcpp self config --mirror GLOBAL + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} # The provider's runner: dirun, xim's OVMF with its profile, and QEMU, installed by the # first run; the status returns through the board's exit. @@ -380,20 +352,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install xlings and mcpp - run: | - curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ - | bash -s "$XLINGS_VERSION" - export PATH="$HOME/.xlings/subos/current/bin:$PATH" - echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" - for attempt in 1 2 3 4 5 6; do - xlings update > /dev/null 2>&1 || true - if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi - [ "$attempt" = 6 ] && { echo "::error::mcpp could not be installed"; exit 1; } - sleep 60 - done - mcpp --version - mcpp self config --mirror GLOBAL + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} - name: okrun for i686-linux-musl run: | @@ -427,6 +389,72 @@ jobs: [ "$status" -eq 7 ] || { echo "::error::the image returned $status, not 7 ($mode)"; exit 1; } done + # System V Release 4 on i386 (0.30.0): a program of i686-svr4-musl (openkal-musl + # over openkal-svr4) built in both modes and run by the provider's runner, + # ibcs-us in a user namespace; then the same executable under the two other + # interfaces the emulation has. The runs are under an emulation of the + # interface on Linux x86_64, none on a System V kernel. + svr4: + needs: resolves + name: i686-svr4-musl (built on Linux x86_64, run under ibcs-us) + runs-on: ubuntu-24.04 + timeout-minutes: 60 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} + + # ibcs-us asks for the root identity and has it in a user namespace; a + # runner image whose AppArmor refuses an unprivileged one is told to allow it. + - name: The host lets an unprivileged user make a user namespace + run: | + if ! unshare -Ur true 2>/dev/null; then + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + fi + unshare -Ur true + + - name: The System V program (dev and release) + working-directory: checks/svr4 + run: | + for mode in "" --release; do + set +e + mcpp run --target i686-svr4-musl $mode -- two one | tee run.log + status=${PIPESTATUS[0]} + set -e + grep -q 'svr4 ok: \["one", "two"\]' run.log && grep -q 'caught: across a frame' run.log \ + && grep -q 'files: true' run.log && grep -q 'here: true' run.log \ + || { echo "::error::the System V program's output ($mode)"; exit 1; } + [ "$status" -eq 7 ] || { echo "::error::the System V program returned $status, not 7 ($mode)"; exit 1; } + done + p=$(find target/i686-svr4-musl -path '*bin/svr4' -type f | head -1) + file "$p" + file "$p" | grep -q 'ELF 32-bit LSB executable, Intel 80386.*statically linked' \ + || { echo "::error::the program is not a static ELF32 i386 executable"; exit 1; } + + # The same executable under the interfaces the emulation is told to answer + # as: the part of the interface the program issues is the one they share. + - name: The same executable as Solaris and as OpenServer 5 + working-directory: checks/svr4 + run: | + # The emulator the runner installed, among the packages mcpp holds. + ibcs=$(find "$HOME/.mcpp" "$HOME/.xlings" -path '*xim-x-ibcs-us/*/bin/ibcs-us' -type f 2>/dev/null | sort | tail -1 || true) + [ -n "$ibcs" ] || { echo "::error::ibcs-us is not installed"; exit 1; } + p=$(find "$PWD/target/i686-svr4-musl" -path '*bin/svr4' -type f | head -1) + for interface in per_solaris per_osr5; do + set +e + unshare -Ur "$ibcs" -p "$interface" "$p" two one | tee "$interface.log" + status=${PIPESTATUS[0]} + set -e + grep -q 'files: true' "$interface.log" || { echo "::error::the program's output under $interface"; exit 1; } + [ "$status" -eq 7 ] || { echo "::error::the program returned $status under $interface, not 7"; exit 1; } + done + # DOS (0.28.0; technical experiment only): a program of i686-dos-musl # (openkal-musl over openkal-dos, run under CWSDPMI) built in both modes and # run by the provider's runner, dirun with DOSBox Staging; and the i386 ok @@ -442,20 +470,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install xlings and mcpp - run: | - curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ - | bash -s "$XLINGS_VERSION" - export PATH="$HOME/.xlings/subos/current/bin:$PATH" - echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" - for attempt in 1 2 3 4 5 6; do - xlings update > /dev/null 2>&1 || true - if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi - [ "$attempt" = 6 ] && { echo "::error::mcpp could not be installed"; exit 1; } - sleep 60 - done - mcpp --version - mcpp self config --mirror GLOBAL + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} - name: The DOS program (dev and release) working-directory: checks/dos @@ -519,20 +537,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install xlings and mcpp - run: | - curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ - | bash -s "$XLINGS_VERSION" - export PATH="$HOME/.xlings/subos/current/bin:$PATH" - echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" - for attempt in 1 2 3 4 5 6; do - xlings update > /dev/null 2>&1 || true - if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi - [ "$attempt" = 6 ] && { echo "::error::mcpp could not be installed"; exit 1; } - sleep 60 - done - mcpp --version - mcpp self config --mirror GLOBAL + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} - name: The musl rows, built for FreeBSD working-directory: checks/hosted diff --git a/.github/workflows/family-release.yml b/.github/workflows/family-release.yml index 07039d8..a97bbfa 100644 --- a/.github/workflows/family-release.yml +++ b/.github/workflows/family-release.yml @@ -3,13 +3,16 @@ name: Family release # The release of the version group this repository states (mcpp design # 2026-11-07, ยง4.2.2, A5 and A6), run on every change of the group and on demand: # -# group every member's tag and its GitCode mirror (the same bytes); the +# group every member's tag and its GitCode mirror (the same bytes; on a +# pull request the platform itself is the tree under review, and +# its tag follows the merge); the # open issues of the members' repositories, for the release notes; # the group's one index change, written into mcpp-index's main and # kept as an artifact (`index-change.patch`), from which the # maintainer opens the one index PR -# resolve over that candidate index, the released mcpp and the one under -# review resolve an image of the group and build it; and for a +# resolve over that candidate index, the engine the platform states as +# its floor and the newest one resolve an image of the group and +# build it (on a pull request, with this tree as the platform); and for a # patch group, the C library and the C++ run-time objects the image # links keep every global symbol of the previous patch's # @@ -40,7 +43,6 @@ defaults: shell: bash env: - MCPP_PREVIOUS: 2026.11.13.1 MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF || '' }} XLINGS_VERSION: v2026.10.26.1 XLINGS_NON_INTERACTIVE: '1' @@ -55,6 +57,8 @@ jobs: - name: Tags and mirrors run: | also=(); for spec in ${{ github.event.inputs.also }}; do also+=(--also "$spec"); done + # On a pull request the platform is the tree under review: its tag follows the merge. + [ "$GITHUB_EVENT_NAME" = pull_request ] && also+=(--review) echo "ALSO=${also[*]}" >> "$GITHUB_ENV" python3 tools/family_release.py "${also[@]}" check | tee -a "$GITHUB_STEP_SUMMARY" - name: Open issues of the members @@ -85,9 +89,11 @@ jobs: curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash -s "$XLINGS_VERSION" export PATH="$HOME/.xlings/subos/current/bin:$PATH" echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" + # The older engine is the one the platform states as its floor. + floor=$(python3 -c 'import tomllib; print(tomllib.load(open("mcpp.toml","rb"))["package"]["mcpp"].lstrip(">= "))') for attempt in 1 2 3 4 5; do xlings update > /dev/null 2>&1 || true - if xlings install "mcpp@$MCPP_PREVIOUS" -y -g; then break; fi + if xlings install "mcpp@$floor" -y -g; then break; fi [ "$attempt" = 5 ] && exit 1 sleep 60 done @@ -120,18 +126,24 @@ jobs: - name: Both mcpp releases resolve and build an image of the group run: | version=$(python3 -c 'import tomllib; print(tomllib.load(open("mcpp.toml","rb"))["package"]["version"])') - echo "PLATFORM=openkal-platform@$version" >> "$GITHUB_ENV" + # Released, the platform is named; on a pull request it is this tree. + if [ "$GITHUB_EVENT_NAME" = pull_request ]; then + platform="{ path = \"$GITHUB_WORKSPACE\" }"; echo "PLATFORM=$GITHUB_WORKSPACE" >> "$GITHUB_ENV" + else + platform="\"openkal-platform@$version\""; echo "PLATFORM=openkal-platform@$version" >> "$GITHUB_ENV" + fi + echo "PLATFORM_VERSION=$version" >> "$GITHUB_ENV" for mcpp in "$MCPP_OLD" "$MCPP_NEW"; do dir="$RUNNER_TEMP/probe-$(basename "$(dirname "$(dirname "$mcpp")")")" mkdir -p "$dir/src" - printf '[package]\nname = "probe"\nversion = "0.1.0"\n' > "$dir/mcpp.toml" + printf '[package]\nname = "probe"\nversion = "0.1.0"\n\n[target.x86_64-openkal]\nplatform = %s\n' "$platform" > "$dir/mcpp.toml" printf 'import std;\nint main() { std::println("group ok"); }\n' > "$dir/src/main.cpp" - ( cd "$dir" && "$mcpp" build --target x86_64-openkal --platform "openkal-platform@$version" ) \ + ( cd "$dir" && "$mcpp" build --target x86_64-openkal ) \ || { echo "::error::$("$mcpp" --version) did not build an image of the group"; exit 1; } done - name: A patch keeps every global symbol of the previous patch run: | - version=${PLATFORM#*@} + version=$PLATFORM_VERSION patch=${version##*.} if [ "$patch" = 0 ]; then echo "a minor version: no previous patch to compare"; exit 0; fi previous="openkal-platform@${version%.*}.$((patch - 1))" diff --git a/README.md b/README.md index b0b3f1b..2f289b2 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,13 @@ builds openkal-run's core runner as a program of the DOS row below, with the image in its `.oke` section. Measured under DOSBox Staging: the image sorted its arguments, caught its exception, read DOS's `PATH` and returned 7. +Platform 0.30.0 adds a row and a member: `i686-svr4-musl`, programs of UNIX +System V Release 4 and its descendants on i386, over openkal-svr4 0.1.0 (below). +In openkal-musl 0.29.10 and openkal-llvm-runtime 0.20.4 a system they do not know +takes the general selections, where the selections named systems; the rows served +before select what they selected. It requires mcpp 2026.11.17.1, from which a +platform package states a system. + Platform 0.29.2 is 0.29.1 with two members corrected, found by running a shell's whole script on the UEFI and DOS rows: openkal-uefi 0.11.2 (on the release profile a directory listing gave `f2.` for `f2.txt` and a rename was refused) and @@ -184,7 +191,7 @@ until a project or this machine does: ```toml [target.x86_64-freebsd-musl] -platform = "openkal-platform@0.29.2" +platform = "openkal-platform@0.30.0" runner = { enabled = true } ``` @@ -296,7 +303,7 @@ with `import std`: ```toml [target.x86_64-uefi] -platform = "openkal-platform@0.29.2" +platform = "openkal-platform@0.30.0" runner = { enabled = true } ``` @@ -323,6 +330,43 @@ allocator reserves it, and the carrier's allocator and the image's each place a Measured: an image that prints, writes to standard error, throws and catches, carried by a 2.4 MB application, returned its status 7 under OVMF in 0.4 s. +## System V programs (0.30.0) + +`i686-svr4-musl` is a row this platform defines and serves (`[[platform.provider]] +name = "svr4"`): a program of the i386 kernel interface of UNIX System V Release 4 +and its descendants (UnixWare, Solaris x86, OpenServer), on the same C library +and C++ run-time over openkal-svr4, so it is written in C++23 with `import std`: + +```toml +[target.i686-svr4-musl] +platform = "openkal-platform@0.30.0" +runner = { enabled = true } +``` + +Nothing of a system is linked or read. A program is one static ELF32 executable +that enters the kernel through the call gate; openkal-svr4 issues the part of the +interface the systems share, and takes an older call or reports `not supported` +where one lacks a call. The system is this platform's statement +(`[[platform.system]] name = "svr4"`), and the implementation is the provider's +`kernel-abi` layer: openkal-musl names no implementation for the system. The +row's flags are the DOS row's (`-march=i486`, emulated thread-local storage, +unwind tables, the stack aligned to sixteen bytes), and the allocator is musl's +own. + +The row has no threads (the kernel of Release 4.0 has none), no random source, +no network, and starts no other program (openkal-svr4 0.1 claims no +`openkal.process`). Its tier is `preview`. + +`mcpp run` runs the program under xim's `ibcs-us`, on a Linux x86_64 host that +lets an unprivileged user make a user namespace. **That is an emulation of the +interface and not a System V kernel**: it shows that the program issues the calls +as the interface states them. Measured under it, as UnixWare 7, Solaris and +OpenServer 5: the specification's suite conforms in every observation made (111 +held), and a C++23 program with `import std` sorted its arguments, caught an +exception, made, renamed, listed (301 names) and removed files, and returned 7, +unoptimised and optimised. No run on a System V kernel has been made; it needs the +system's own media in a machine emulator. + ## DOS programs (0.28.0; technical experiment only) `i686-dos-musl` is a row this platform defines and serves (`[[platform.provider]] @@ -331,7 +375,7 @@ run-time over openkal-dos, so it is written in C++23 with `import std`: ```toml [target.i686-dos-musl] -platform = "openkal-platform@0.29.2" +platform = "openkal-platform@0.30.0" ``` The row is TECHNICAL EXPERIMENT ONLY (openkal-dos's README). A program is the @@ -398,6 +442,7 @@ previous patch's. | `checks/snapshot` | a C++ program starts from a snapshot of its initialisers, and a start whose named value differs does not | | `checks/i386` | an ok image of i386 is built in both modes, checked by okld and run by okrun built for i686-linux-musl; packed with `--systems dos-i686`, it runs as a DOS program | | `checks/dos` | a program of i686-dos-musl runs in both modes under DOSBox Staging, with a 512 KiB recursion, and states a 1 MiB stack (technical experiment only) | +| `checks/svr4` | a program of i686-svr4-musl runs in both modes under ibcs-us (an emulation of the System V i386 interface), then as Solaris and as OpenServer 5: files made, renamed, listed in parts and removed (0.30.0) | | family release | the group's members are tagged and mirrored, both mcpp releases resolve an image of it, and a patch removes no symbol | ## License diff --git a/checks/svr4/mcpp.toml b/checks/svr4/mcpp.toml new file mode 100644 index 0000000..a0c822e --- /dev/null +++ b/checks/svr4/mcpp.toml @@ -0,0 +1,15 @@ +# A program of UNIX System V Release 4 on i386 (0.30.0): C++23 over the family's C library and +# C++ run-time over openkal-svr4, run under ibcs-us, an emulation of the kernel's interface on +# Linux x86_64. The platform is the directory above. +[package] +name = "svr4" +version = "0.1.0" + +[targets.svr4] +kind = "bin" +main = "src/main.cpp" + +[target.i686-svr4-musl] +platform = { path = "../.." } +# The runner installs an emulator on its first use and is enabled by the project. +runner = { enabled = true } diff --git a/checks/svr4/src/main.cpp b/checks/svr4/src/main.cpp new file mode 100644 index 0000000..7916647 --- /dev/null +++ b/checks/svr4/src/main.cpp @@ -0,0 +1,40 @@ +// A System V program: its arguments sorted, an exception across a frame, the environment, a +// directory made, a file written, renamed, listed by its whole name and removed, a status. The +// directory holds more names than one reading of it returns (a listing in parts), and the +// working directory is changed and restored, as on the UEFI and DOS rows. +import std; + +bool files() { + namespace fs = std::filesystem; + std::error_code ec; + fs::remove_all("okp", ec); + if (!fs::create_directory("okp", ec)) return false; + { std::ofstream f("okp/f1.txt"); f << "x\n"; } + fs::rename("okp/f1.txt", "okp/g1.txt", ec); + if (ec) return false; + const auto here = fs::current_path(ec); + for (int i = 0; i < 48 && !ec; ++i) { fs::current_path("okp", ec); if (!ec) fs::current_path(here, ec); } + if (ec) return false; + for (int i = 0; i < 300; ++i) { std::ofstream f(std::format("okp/a-file-with-a-long-name-{:03}.txt", i)); f << i; } + std::size_t count = 0; + bool renamed = false; + for (const auto& e : fs::directory_iterator("okp", ec)) { + ++count; + renamed = renamed || e.path().filename() == "g1.txt"; + } + const auto size = fs::file_size("okp/g1.txt", ec); + const auto removed = fs::remove_all("okp", ec); + return !ec && renamed && count == 301 && size == 2 && removed == 302; +} + +int main(int argc, char** argv) { + std::vector v(argv + 1, argv + argc); + std::ranges::sort(v); + std::println("svr4 ok: {}", v); + try { throw std::runtime_error("across a frame"); } + catch (const std::exception& e) { std::println("caught: {}", e.what()); } + std::println("PATH set: {}", std::getenv("PATH") != nullptr); + std::println("here: {}", std::filesystem::current_path().is_absolute()); + std::println("files: {}", files()); + return 7; +} diff --git a/mcpp.toml b/mcpp.toml index 8c586bb..6d2923d 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -12,7 +12,7 @@ [package] namespace = "mcpplibs" name = "openkal-platform" -version = "0.29.2" +version = "0.30.0" description = "The platform of ok images (-openkal): their toolchain, C library and C++ run-time, tools, compile and link conventions, seal, runner and carrier, as one versioned statement mcpp reads." license = "Apache-2.0" authors = ["mcpplibs"] @@ -27,7 +27,9 @@ repo = "https://github.com/mcpplibs/openkal-platform" # chosen for it when the platform lists the row with a toolchain, so the i686 # rows below need no toolchain named by the project. 2026.11.16.1 (0.29.0): a # runner's `enabled', which every runner here that boots a machine states. -mcpp = ">=2026.11.16.1" +# 2026.11.17.1 (0.30.0): a platform package states a system (`[[platform.system]]'), +# which the System V row's is. +mcpp = ">=2026.11.17.1" [platform] # `i686-openkal` (0.28.0): the image of the thirty-two bit class, i386 (openkal @@ -69,9 +71,9 @@ debuggee = ["okrun", "--debugger", "{}"] # The C library and the C++ run-time inside an image. A package of the graph # that provides a layer takes its place (`provides`), and `false` leaves it out. [platform.layers] -compiler-runtime = "openkal-llvm-runtime@0.20.3" -"c++-abi" = "openkal-llvm-runtime@0.20.3" -c-abi = { name = "openkal-musl", version = "0.29.9", default-features = false, features = ["posix", "malloc-mimalloc"] } +compiler-runtime = "openkal-llvm-runtime@0.20.4" +"c++-abi" = "openkal-llvm-runtime@0.20.4" +c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mimalloc"] } # Built for the building machine: `okld` writes and checks the notes, `okrun` # runs an image, `okprof` reads what a measured run recorded (0.23.0: the @@ -218,9 +220,9 @@ targets = ["x86_64-linux-gnu", "aarch64-linux-gnu", "x86_64-linux-musl", "aarc toolchain = "llvm@23.1.3" [platform.hosted.layers] -compiler-runtime = "openkal-llvm-runtime@0.20.3" -"c++-abi" = "openkal-llvm-runtime@0.20.3" -c-abi = { name = "openkal-musl", version = "0.29.9", default-features = false, features = ["posix", "malloc-mimalloc"] } +compiler-runtime = "openkal-llvm-runtime@0.20.4" +"c++-abi" = "openkal-llvm-runtime@0.20.4" +c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mimalloc"] } # THE HOSTED ROWS' RUNNERS ON ANOTHER SYSTEM (0.29.0; mcpp 2026.11.16.1 reads a # runner's `enabled`). A FreeBSD program runs in the FreeBSD virtual machine of @@ -238,7 +240,7 @@ serves = ["x86_64-freebsd-musl"] hosted = true base = "none" toolchain = "llvm@23.1.3" -layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.9", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.20.4", "c++-abi" = "openkal-llvm-runtime@0.20.4", c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mimalloc"] } } runner = { cmd = ["dirun", "--profile", "{pkg:freebsd-disk-image}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--", "{}"], host = "any", hosts = ["linux-x86_64"], requires = ["xim:dirun@0.6.0", "xim:freebsd-disk-image@14.5-1", "xim:qemu-x86@9.2.4-1"], enabled = false } [[platform.provider]] @@ -247,7 +249,7 @@ serves = ["aarch64-freebsd-musl"] hosted = true base = "none" toolchain = "llvm@23.1.3" -layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.9", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.20.4", "c++-abi" = "openkal-llvm-runtime@0.20.4", c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mimalloc"] } } runner = { cmd = ["dirun", "--profile", "{pkg:aarch64-freebsd-disk-image}/dirun.toml", "--var", "firmware={pkg:ovmf}/share/edk2/edk2-aarch64-code.fd", "--emulator", "{pkg:qemu-system}/bin/qemu-system-aarch64", "--", "{}"], host = "any", hosts = ["linux-x86_64"], requires = ["xim:dirun@0.6.0", "xim:aarch64-freebsd-disk-image@14.5-1", "xim:ovmf@9.2.4-4", "xim:qemu-system@9.2.4"], enabled = false } [[platform.provider]] @@ -256,7 +258,7 @@ serves = ["x86_64-windows-musl"] hosted = true base = "none" toolchain = "llvm@23.1.3" -layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.9", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.20.4", "c++-abi" = "openkal-llvm-runtime@0.20.4", c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mimalloc"] } } runner = { cmd = ["wine", "{}"], host = "same-arch", hosts = ["linux-x86_64"], requires = ["xim:wine@11.0"], enabled = false } # The runners require dirun 0.5.0 and ovmf 9.2.4-3 (0.29.0): ovmf's profile states the UEFI @@ -291,7 +293,7 @@ serves = ["x86_64-uefi"] base = "none" hosted = true -layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.9", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.20.4", "c++-abi" = "openkal-llvm-runtime@0.20.4", c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mimalloc"] } } link = { driver = "lld", start = "efi_main", flags = ["--subsystem", "efi_application", "--gc-sections"], exe = "{name}.efi", inputs = [{ file = "board/qemu-exit.S" }], seal = [] } runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:ovmf}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--memory", "2048", "--"], hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64"], requires = ["xim:dirun@0.6.0", "xim:qemu-x86@9.2.4-1", "xim:ovmf@9.2.4-4"], enabled = false } @@ -330,10 +332,57 @@ serves = ["i686-dos-musl"] base = "none" hosted = true -layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.9", default-features = false, features = ["posix", "malloc-mallocng"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.20.4", "c++-abi" = "openkal-llvm-runtime@0.20.4", c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mallocng"] } } link = { driver = "lld", start = "okdos_entry", flags = ["-static", "--image-base=0x1000", "-z", "norelro", "-z", "stack-size=1048576", "--gc-sections", "--eh-frame-hdr"], seal = [["okdos", "seal", "{}"]] } runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:dosbox-staging}/dirun.toml", "--"], hosts = ["linux-x86_64", "macos-aarch64", "windows-x86_64"], requires = ["xim:dirun@0.6.0", "xim:dosbox-staging@0.83.0-2"], enabled = false } +# UNIX SYSTEM V RELEASE 4 AND ITS DESCENDANTS ON i386 (0.30.0): programs of the +# kernel's own system-call interface, on the same C library and C++ run-time over +# openkal-svr4. Nothing of a system is linked or read: the program is one static +# ELF32 executable that enters the kernel through the call gate, and the part of +# the interface it issues is the one the systems share, so one executable is each +# system's. The system is this platform's statement (`[[platform.system]]'), and +# the implementation is the provider's `kernel-abi' layer: the C library names no +# implementation for a system it does not know and takes the one the graph +# provides, so a further system of this kind is a statement here and no line in +# the C library. The flags are the i386 conventions of the DOS row above: +# emulated thread-local storage (the kernel of Release 4.0 has no threads and the +# row has none, so the thread pointer is no register), unwind tables for every +# unit, the stack aligned to sixteen bytes at a call, and the 486. The allocator +# is musl's own: the implementation states no random source. +# +# THE RUNNER IS AN EMULATION OF THE INTERFACE, NOT A SYSTEM: xim's `ibcs-us' +# (ibcs-us 4.3 built with corrections) on Linux x86_64, in a user namespace, where +# it has the identity it asks for. It answers as UnixWare 7 for these executables, +# and as Solaris or OpenServer 5 when told (`-p'). What a run under it shows is +# that the program issues the calls as the interface states them; a run on a +# System V kernel needs the system's own media and is not this runner's. A +# program that replaces its image leaves the emulation, so openkal-svr4 0.1 claims +# no `openkal.process' and the row starts no other program. The tier is `preview'. +[[platform.system]] +name = "svr4" + +[[platform.define]] +triple = "i686-svr4-musl" +clang-triple = "i386-unknown-none-elf" +object-format = "elf" +family = "unix" +data-model = "ilp32" +execution = "svr4" +tier = "preview" +march = "i486" +flags = ["-femulated-tls", "-fasynchronous-unwind-tables", "-mstack-alignment=16", "-ffunction-sections", "-fdata-sections"] + +[[platform.provider]] +name = "svr4" +serves = ["i686-svr4-musl"] +base = "none" +hosted = true + +layers = { "kernel-abi" = { name = "openkal-svr4", version = "0.1.0", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.20.4", "c++-abi" = "openkal-llvm-runtime@0.20.4", c-abi = { name = "openkal-musl", version = "0.29.10", default-features = false, features = ["posix", "malloc-mallocng"] } } +link = { driver = "lld", flags = ["-static", "-z", "norelro", "--gc-sections", "--eh-frame-hdr"] } +runner = { cmd = ["unshare", "-Ur", "{pkg:ibcs-us}/bin/ibcs-us", "{}"], hosts = ["linux-x86_64"], requires = ["xim:ibcs-us@4.3-1"], enabled = false } + # The family released together for openkal 0.17 (the 0.17.2 round: okb, the # runner's bundle and library interfaces, musl's renameat2; the 0.17.3 round: # musl takes a program's arguments when it is entered; the 0.18.0 round: a @@ -399,7 +448,10 @@ runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:dosbox-staging} # openkal-uefi 0.11.2 (compiled with `-fno-builtin': on the release profile a # listing shortened names and a rename was refused) and openkal-musl 0.29.9 # (`chdir' releases the handle before it; `/name' beneath a volume is that -# volume's root). From 0.24.1 the members name one another by +# volume's root); 0.30.0, openkal-svr4 0.1.0 (System V Release 4 on i386, the +# `kernel-abi' layer of its row) with openkal-musl 0.29.10 and openkal-llvm-runtime +# 0.20.4, in which a system they do not know takes the general selections, where +# the selections named systems. From 0.24.1 the members name one another by # compatible ranges (`^0.28.0`) and this group chooses the versions: mcpp # 2026.11.7.1 resolves within it, and a fix of one member is that member's # release and a patch of this group, released together through one index change @@ -413,8 +465,9 @@ openkal-freebsd = "0.1.2" openkal-uefi = "0.11.2" openkal-dos = "0.1.1" openkal-dos-tools = "0.1.1" -openkal-musl = "0.29.9" -openkal-llvm-runtime = "0.20.3" +openkal-svr4 = "0.1.0" +openkal-musl = "0.29.10" +openkal-llvm-runtime = "0.20.4" openkal-ld = "0.6.4" openkal-run = "0.6.4" openkal-tools = "0.6.4" diff --git a/tools/family_release.py b/tools/family_release.py index db77387..f523825 100644 --- a/tools/family_release.py +++ b/tools/family_release.py @@ -30,6 +30,11 @@ every object that calls it holds its own copy, and it is not compared +`--review` states that the platform is the working tree under review: its tag +follows the merge, so `check` reports it as `under review` and `index` leaves +its entry to the release. A platform is given to `exports` as +`openkal-platform@` or as a directory, the working tree. + Network reads use GITHUB_TOKEN when it is set. """ import argparse @@ -93,7 +98,10 @@ def listed(descriptor, version): return m.group(1) if m else None -def check(members): +PLATFORM = "openkal-platform" + + +def check(members, review=False): rows, problems = [], 0 digests = {} for name, version in members.items(): @@ -111,6 +119,8 @@ def check(members): indexed = listed(descriptor, version) state = ("no tag" if a is None else "no mirror" if b is None else "mirror differs" if a != b else "indexed" if indexed == a else "index differs" if indexed else "not indexed") + if review and name == PLATFORM and state == "no tag": + state = "under review" problems += state in ("no tag", "no mirror", "mirror differs", "index differs") rows.append((name, version, state, a or "-")) print("| member | version | state | sha256 |\n|---|---|---|---|") @@ -129,7 +139,7 @@ def entry(version, github, gitcode, sha): f' }},\n') -def index(members, checkout): +def index(members, checkout, review=False): added = [] for name, version in members.items(): path = checkout / "pkgs/o" / f"{name}.lua" @@ -138,6 +148,9 @@ def index(members, checkout): continue github, gitcode = urls(name, version) data, mirror = fetch(github), fetch(gitcode) + if review and name == PLATFORM and not data: + print(f"left to the release: {name} {version}, whose tag follows the merge") + continue if not data or not mirror or hashlib.sha256(data).digest() != hashlib.sha256(mirror).digest(): sys.exit(f"{name} {version}: the tag or its mirror is missing, or they differ; run `check`") sha = hashlib.sha256(data).hexdigest() @@ -225,13 +238,17 @@ def defects(members): def symbols(mcpp, platform, target, work, nm): - project = work / platform.replace("@", "-") + # A released platform is named; the one under review is its working tree. + tree = Path(platform) + named = f'"{platform}"' if "@" in platform and not tree.is_dir() else f'{{ path = "{tree.resolve().as_posix()}" }}' + project = work / ("released" if named.startswith('"') else "review") (project / "src").mkdir(parents=True, exist_ok=True) - (project / "mcpp.toml").write_text('[package]\nname = "exports"\nversion = "0.1.0"\n', encoding="utf-8") + (project / "mcpp.toml").write_text( + f'[package]\nname = "exports"\nversion = "0.1.0"\n\n[target.{target}]\nplatform = {named}\n', encoding="utf-8") (project / "src/main.cpp").write_text( 'import std;\nint main() { std::vector v{"a"}; std::println("{}", v.size()); }\n', encoding="utf-8") - subprocess.run([mcpp, "build", "--target", target, "--platform", platform], cwd=project, check=True) + subprocess.run([mcpp, "build", "--target", target], cwd=project, check=True) found = {} for layer in LAYERS: objects = [p for p in (project / "target").rglob("*.o") if layer in p.parts] @@ -263,6 +280,8 @@ def exports(old, new, mcpp, target, nm): def main(): parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument("--also", action="append", default=[], metavar="NAME@VERSION") + parser.add_argument("--review", action="store_true", + help="the platform is the working tree under review; its tag follows the merge") sub = parser.add_subparsers(dest="command", required=True) sub.add_parser("check") p = sub.add_parser("index") @@ -273,16 +292,16 @@ def main(): sub.add_parser("defects") p = sub.add_parser("exports") p.add_argument("old", help="openkal-platform@ released before") - p.add_argument("new", help="openkal-platform@ of this group") + p.add_argument("new", help="openkal-platform@ of this group, or the working tree under review") p.add_argument("--mcpp", default="mcpp") p.add_argument("--target", default="x86_64-openkal") p.add_argument("--nm", default=shutil.which("llvm-nm") or "llvm-nm") args = parser.parse_args() members = group(args.also) if args.command == "check": - return check(members) + return check(members, args.review) if args.command == "index": - return index(members, args.checkout.resolve()) + return index(members, args.checkout.resolve(), args.review) if args.command == "visible": return visible(members, args.synced.resolve(), args.xim.resolve() if args.xim else None) if args.command == "defects":