Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: CI

# What this workflow asserts about openkal-platform.
#
# resolves every member the platform names, and every xim package a
# runner requires, is listed in the indexes mcpp reads (the
# published artifacts, not the index repositories' main); the
# other jobs need it, so a package not yet indexed is one
# failure that names it rather than one per job
# tests `mcpp test` on the platform package: the test image runs on the
# machine's architecture and is built for the other one
# image a project that declares nothing builds, runs and packs an ok
Expand Down Expand Up @@ -41,12 +46,48 @@ on:

env:
MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF || '' }}
MCPP_VERSION: 2026.11.14.1
MCPP_VERSION: 2026.11.16.1
XLINGS_VERSION: v2026.10.26.1
XLINGS_NON_INTERACTIVE: '1'

jobs:
resolves:
name: every member is in the index mcpp reads
runs-on: ubuntu-24.04
timeout-minutes: 30
defaults:
run:
shell: bash
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

- name: Every member and runner package is in the indexes mcpp reads
run: |
mcpp index update
mcpp index status | tee status.log
synced=$(awk '$1 == "mcpplibs" { print $NF }' status.log)
xim=$(awk '$1 == "xim" { print $NF }' status.log)
[ -d "$synced" ] || { echo "::error::mcpp names no synced copy of the mcpplibs index"; exit 1; }
[ -d "$xim" ] || { echo "::error::mcpp names no synced copy of the xim index"; exit 1; }
python3 tools/family_release.py visible "$synced" --xim "$xim" | tee -a "$GITHUB_STEP_SUMMARY"

platform:
needs: resolves
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
Expand Down Expand Up @@ -233,6 +274,7 @@ jobs:
# itself: the hosted program, and the specification's conformance suite through
# the platform, over the implementation at the group's version.
i686:
needs: resolves
name: i686-linux-musl (built and run on Linux x86_64)
runs-on: ubuntu-24.04
timeout-minutes: 90
Expand Down Expand Up @@ -282,6 +324,7 @@ jobs:
|| { echo "::error::an observation did not hold on i686-linux-musl"; exit 1; }

uefi:
needs: resolves
name: x86_64-uefi (built on Linux x86_64, run under OVMF)
runs-on: ubuntu-24.04
timeout-minutes: 90
Expand Down Expand Up @@ -312,10 +355,10 @@ jobs:
working-directory: checks/uefi
run: |
set +e
mcpp run --release --target x86_64-uefi | tee run.log
mcpp run --release --target x86_64-uefi -- one "two three" | tee run.log
status=${PIPESTATUS[0]}
set -e
grep -q "uefi ok: \[1, 2, 3\] 1" run.log || { echo "::error::the application's output"; exit 1; }
grep -q 'uefi ok: \[1, 2, 3\] \["one", "two three"\]' run.log || { echo "::error::the application's output or arguments"; exit 1; }
[ "$status" -eq 42 ] || { echo "::error::the application returned $status, not 42"; exit 1; }
p=$(find target/x86_64-uefi -path '*bin/uefi.efi' -type f | head -1)
file "$p"
Expand All @@ -326,6 +369,7 @@ jobs:
# checks/i386 in both modes, checked by okld, and run by okrun built for
# i686-linux-musl from the openkal-image release this group names.
i686-openkal:
needs: resolves
name: i686-openkal (an ok image of i386, run on Linux x86_64)
runs-on: ubuntu-24.04
timeout-minutes: 90
Expand Down Expand Up @@ -387,6 +431,7 @@ jobs:
# run by the provider's runner, dirun with DOSBox Staging; and the i386 ok
# image packed as one DOS program, the core runner carrying it, and run there.
dos:
needs: resolves
name: i686-dos-musl (built on Linux x86_64, run under DOSBox Staging)
runs-on: ubuntu-24.04
timeout-minutes: 90
Expand Down Expand Up @@ -449,6 +494,7 @@ jobs:
[ "$status" -eq 7 ] || { echo "::error::the carried image returned $status, not 7"; exit 1; }

freebsd:
needs: resolves
name: freebsd (built for x86_64 and aarch64, run in a VM)
runs-on: ubuntu-24.04
timeout-minutes: 90
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ mcpp.lock
checks/*/*.log
checks/*/*.err
checks/*/*.json
__pycache__/
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,29 @@ 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.29.0 requires mcpp 2026.11.16.1. Every runner here that boots a
machine is enabled on request: the UEFI row's (QEMU and OVMF), the DOS row's
(DOSBox Staging), and, new, the hosted rows' runners on another system. FreeBSD
programs run in the FreeBSD virtual machine of xim's disk image packages, and
an `x86_64-windows-musl` program runs through Wine on an x86_64 Linux machine.
Each fetches a machine image or an emulator, or makes a prefix in the home
directory, on its first use, so `mcpp run` names the runner and how to enable it
until a project or this machine does:

```toml
[target.x86_64-freebsd-musl]
platform = "openkal-platform@0.29.0"
runner = { enabled = true }
```

The UEFI runner passes the program's arguments (`--`, with ovmf 9.2.4-3's Shell
profile, whose arguments dirun 0.5.0 quotes for the Shell, so one with a blank
arrives whole), and openkal-uefi 0.11.0 implements `openkal.fs` over the firmware's
file system and `openkal.random` over its RNG protocol, beneath openkal-musl
0.29.8. okrun is a host for `macos-x86_64` (the release build of openkal-macos
0.23.4 links) and `linux-i686` (built as `i686-linux-musl`), so `--systems all`
carries both.

A project overrides any group under `[target.<selector>]`, for example
`[target.'cfg(platform = "openkal")'.layers] "c++-abi" = false`, and selects
another platform, or none, with `platform = "..."` or `--platform`.
Expand Down Expand Up @@ -263,7 +286,8 @@ with `import std`:

```toml
[target.x86_64-uefi]
platform = "openkal-platform@0.28.0"
platform = "openkal-platform@0.29.0"
runner = { enabled = true }
```

The row is PE. mcpp 2026.11.13.1 realises the C environment by the container, as
Expand Down
2 changes: 2 additions & 0 deletions checks/dos/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ main = "src/main.cpp"

[target.i686-dos-musl]
platform = { path = "../.." }
# The runner boots a machine on its first use and is enabled by the project (0.29.0).
runner = { enabled = true }
2 changes: 2 additions & 0 deletions checks/uefi/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ main = "src/main.cpp"

[target.x86_64-uefi]
platform = { path = "../.." }
# The runner boots a machine on its first use and is enabled by the project (0.29.0).
runner = { enabled = true }
6 changes: 4 additions & 2 deletions checks/uefi/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// The C++ a UEFI application is written in: the standard library's text, ranges and containers
// over openkal-musl and openkal-llvm-runtime, and its status returned to the machine that ran it.
// over openkal-musl and openkal-llvm-runtime, its arguments as the runner passed them (0.29.0: the
// Shell's, an argument with a space whole), and its status returned to the machine that ran it.
import std;

int main(int argc, char** argv) {
std::vector<int> v{3, 1, 2};
std::ranges::sort(v);
std::println("uefi ok: {} {}", v, argc);
std::vector<std::string_view> args(argv + 1, argv + argc);
std::println("uefi ok: {} {}", v, args);
return 42;
}
76 changes: 61 additions & 15 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[package]
namespace = "mcpplibs"
name = "openkal-platform"
version = "0.28.1"
version = "0.29.0"
description = "The platform of ok images (<arch>-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"]
Expand All @@ -25,8 +25,9 @@ repo = "https://github.com/mcpplibs/openkal-platform"
# provider's link and runner over `base = "none"', a row's link emulation
# without its machine). 2026.11.14.1: a planned row is served by the 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.
mcpp = ">=2026.11.14.1"
# 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"

[platform]
# `i686-openkal` (0.28.0): the image of the thirty-two bit class, i386 (openkal
Expand All @@ -49,8 +50,11 @@ toolchain = "llvm@23.1.3"
# core runner, which carries what it runs), so an ok image packs for firmware.
# `dos-i686` (0.28.0; technical experiment only): the core runner as a program
# of the DOS row below, so an i386 image packs for DOS (mcpp 2026.11.13.1 builds
# a system's runner as the row the platform defines for it).
runner = { cmd = ["okrun", "{}"], host = "same-arch", hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64", "freebsd-x86_64", "freebsd-aarch64", "uefi-x86_64", "dos-i686"], built-as = { "freebsd-x86_64" = "x86_64-freebsd-musl", "freebsd-aarch64" = "aarch64-freebsd-musl" } }
# a system's runner as the row the platform defines for it). `macos-x86_64`
# (0.29.0): openkal-macos 0.23.4 links the x86_64 release build (N28);
# `linux-i686` (0.29.0): the runner for an i386 image on a 32-bit Linux
# machine, built as the platform's `i686-linux-musl`.
runner = { cmd = ["okrun", "{}"], host = "same-arch", hosts = ["linux-x86_64", "linux-aarch64", "linux-i686", "macos-aarch64", "macos-x86_64", "windows-x86_64", "freebsd-x86_64", "freebsd-aarch64", "uefi-x86_64", "dos-i686"], built-as = { "freebsd-x86_64" = "x86_64-freebsd-musl", "freebsd-aarch64" = "aarch64-freebsd-musl", "linux-i686" = "i686-linux-musl" } }
# `mcpp pack --mode self-contained`: a program of the packing machine that
# carries the image in a section and runs it through libokrun (M3).
carrier = { package = "openkal-run@0.6.4", section = ".oke", main = "carrier/main.cpp" }
Expand All @@ -67,7 +71,7 @@ debuggee = ["okrun", "--debugger", "{}"]
[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.7", default-features = false, features = ["posix", "malloc-mimalloc"] }
c-abi = { name = "openkal-musl", version = "0.29.8", 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
Expand Down Expand Up @@ -216,8 +220,48 @@ 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.7", default-features = false, features = ["posix", "malloc-mimalloc"] }
c-abi = { name = "openkal-musl", version = "0.29.8", 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
# xim's disk image packages, booted by dirun (the x86_64 guest under the host's
# acceleration, the aarch64 guest in QEMU's translator); a Windows program of
# the musl identity runs through Wine on an x86_64 Linux machine. Each fetches
# a machine image or an emulator, or makes a prefix in the home directory, on
# its first use, so none runs until a project or this machine enables it (mcpp
# SPEC-016 §6). An entry is the row's hosted arrangement as `[platform.hosted]`
# states it (`base = "none"`: none of the ok images' conventions; the same
# toolchain and layers, the same build graph, measured), with the runner.
[[platform.provider]]
name = "freebsd-vm"
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.8", 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.5.0", "xim:freebsd-disk-image@14.5", "xim:qemu-x86@9.2.4-1"], enabled = false }

[[platform.provider]]
name = "freebsd-vm"
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.8", 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.5.0", "xim:aarch64-freebsd-disk-image@14.5", "xim:ovmf@9.2.4-3", "xim:qemu-system@9.2.4"], enabled = false }

[[platform.provider]]
name = "wine"
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.8", 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
# Shell's quoting (`[payload] quote = "uefi-shell"'), so an argument with a blank reaches
# the application whole.
# UEFI (0.28.0): applications the firmware loads, on the same C library and C++
# run-time over openkal-uefi (openkal-musl names it, `standalone', on
# `cfg(os = "uefi")'). The row is PE: the C environment is the PE rows'
Expand Down Expand Up @@ -247,9 +291,9 @@ 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.7", default-features = false, features = ["posix", "malloc-mimalloc"] } }
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.8", 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.3.2", "xim:qemu-x86@9.2.4-1", "xim:ovmf@9.2.4-1"] }
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.5.0", "xim:qemu-x86@9.2.4-1", "xim:ovmf@9.2.4-3"], enabled = false }

# DOS (0.28.0; TECHNICAL EXPERIMENT ONLY, openkal-dos's README): programs a DPMI
# host runs, on the same C library and C++ run-time over openkal-dos
Expand Down Expand Up @@ -283,9 +327,9 @@ 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.7", default-features = false, features = ["posix", "malloc-mallocng"] } }
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.8", default-features = false, features = ["posix", "malloc-mallocng"] } }
link = { driver = "lld", start = "okdos_entry", flags = ["-static", "--image-base=0x1000", "-z", "norelro", "--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.3.2", "xim:dosbox-staging@0.83.0"] }
runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:dosbox-staging}/dirun.toml", "--"], hosts = ["linux-x86_64", "macos-aarch64", "windows-x86_64"], requires = ["xim:dirun@0.5.0", "xim:dosbox-staging@0.83.0-2"], 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:
Expand Down Expand Up @@ -343,8 +387,10 @@ runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:dosbox-staging}
# or threads); 0.28.1, openkal-image 0.6.4 (the runner folds the path it is
# given, `//', `.' and `..', before it looks for the image), openkal-macos 0.23.4
# (`___bzero' in the stub of a link without an SDK, x86_64) and openkal-musl
# 0.29.7 (`uname' names the system a hosted program runs on): one version of
# each in a build. From 0.24.1 the members name one another by
# 0.29.7 (`uname' names the system a hosted program runs on); 0.29.0, openkal-uefi
# 0.11.0 (openkal.fs over the firmware's file system, openkal.random over its RNG
# protocol, the Shell's arguments) beneath openkal-musl 0.29.8, which admits it:
# one version of each in a build. 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
Expand All @@ -355,10 +401,10 @@ openkal-linux = "0.26.3"
openkal-macos = "0.23.4"
openkal-windows = "0.21.2"
openkal-freebsd = "0.1.2"
openkal-uefi = "0.10.0"
openkal-uefi = "0.11.0"
openkal-dos = "0.1.0"
openkal-dos-tools = "0.1.0"
openkal-musl = "0.29.7"
openkal-musl = "0.29.8"
openkal-llvm-runtime = "0.20.3"
openkal-ld = "0.6.4"
openkal-run = "0.6.4"
Expand Down
Loading
Loading