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
76 changes: 75 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ name: CI
# and self-contained), one target alone, a single file and an okb
# hosted the machine's own triple takes the platform's hosted arrangement
# host-graph a build program is compiled as an ok image and run by okrun
# 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
#
# The platform is read by mcpp 2026.10.30.1 and later (SPEC-013, SPEC-015). CI
# measures with 2026.10.31.3: from 2026.10.31.2 a set's Windows launcher is built
Expand All @@ -34,7 +36,7 @@ on:

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

Expand Down Expand Up @@ -216,3 +218,75 @@ jobs:
run: |
mcpp run | tee run.log
grep -q "host graph ok: 1" run.log || { echo "::error::the build program's definition did not arrive"; exit 1; }

# FREEBSD (0.26.0): the hosted arrangement's musl rows, openkal-musl over
# openkal-freebsd standalone, built here for both architectures as static
# programs; the x86_64 one runs in a FreeBSD virtual machine, beside okrun
# built for the same row from the openkal-image release this group names,
# which runs an ok image there.
freebsd:
name: freebsd (built for x86_64 and aarch64, run in a VM)
runs-on: ubuntu-24.04
timeout-minutes: 90
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: The musl rows, built for FreeBSD
working-directory: checks/hosted
run: |
mkdir -p ../../.fb
for a in x86_64 aarch64; do
mcpp build --target "$a-freebsd-musl"
p=$(find "target/$a-freebsd-musl" -path '*bin/hosted' -type f | head -1)
file "$p"
file "$p" | grep -q 'FreeBSD' && file "$p" | grep -q 'statically linked' \
|| { echo "::error::$a-freebsd-musl is not a static FreeBSD program"; exit 1; }
done
cp "$(find target/x86_64-freebsd-musl -path '*bin/hosted' -type f | head -1)" ../../.fb/hosted

- name: okrun for FreeBSD, and an ok image
run: |
(cd checks/image && mcpp build --target x86_64-openkal)
cp "$(find checks/image/target -path '*x86_64-openkal*' -path '*bin*' -name image.oke -type f | head -1)" .fb/image.oke
tag=$(sed -n 's/^openkal-tools *= *"\(.*\)"/\1/p' mcpp.toml | head -1)
git clone --quiet --depth 1 --branch "$tag" https://github.com/mcpplibs/openkal-image.git "$RUNNER_TEMP/oi"
printf '\n[target.x86_64-freebsd-musl]\nplatform = { path = "%s" }\ntoolchain = "llvm@23.1.3"\n' "$GITHUB_WORKSPACE" >> "$RUNNER_TEMP/oi/tools/mcpp.toml"
(cd "$RUNNER_TEMP/oi/tools" && mcpp build --release --target x86_64-freebsd-musl)
cp "$(find "$RUNNER_TEMP/oi/target/x86_64-freebsd-musl" -path '*bin/openkal-tools/okrun' -type f | head -1)" .fb/okrun
file .fb/okrun

- name: Run in FreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
run: |
set -e
uname -a
./.fb/hosted one two > .fb/hosted.log 2>&1 || echo "status $?" >> .fb/hosted.log
./.fb/okrun ./.fb/image.oke one two > .fb/image.log 2>&1 || echo "status $?" >> .fb/image.log
cat .fb/hosted.log .fb/image.log

- name: The verdict
run: |
grep -q "hosted ok: hosted" .fb/hosted.log && grep -q "hosted args: 3 two" .fb/hosted.log \
|| { echo "::error::the FreeBSD musl program's output"; cat .fb/hosted.log; exit 1; }
grep -q "image ok: 3 args" .fb/image.log \
|| { echo "::error::the ok image under okrun on FreeBSD"; cat .fb/image.log; exit 1; }
2 changes: 1 addition & 1 deletion .github/workflows/family-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defaults:
shell: bash

env:
MCPP_PREVIOUS: 2026.11.9.1
MCPP_PREVIOUS: 2026.11.10.1
MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF || '' }}
XLINGS_VERSION: v2026.10.26.1
XLINGS_NON_INTERACTIVE: '1'
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ program by the search rules of the system `kal_env_system` names and implements
openkal-image 0.5.5, built against the same family. The platform requires mcpp
2026.11.9.1, as 0.24.5 does.

Platform 0.26.0 adds FreeBSD and the interface-bound runner. Its hosted
arrangement serves `x86_64-freebsd-musl` and `aarch64-freebsd-musl`: openkal-musl
0.29.2 over openkal-freebsd 0.1.0 in its standalone arrangement, with
openkal-llvm-runtime 0.20.1 above it, as one static program with no C library of
the system beneath. openkal-image 0.6.1 binds only the interfaces its
implementation provides, and its okrun is built for FreeBSD as well, so
`freebsd-x86_64` and `freebsd-aarch64` are hosts of the runner. The platform
requires mcpp 2026.11.10.1; mcpp 2026.11.10.2 and later select it for the
FreeBSD musl rows by default.

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
10 changes: 9 additions & 1 deletion checks/hosted/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
name = "hosted"
version = "0.1.0"

[target.'cfg(any(linux, macos, windows))']
[target.'cfg(any(linux, macos, windows, os = "freebsd"))']
platform = { path = "../.." }

# FreeBSD's musl rows are served from mcpp 2026.11.10.2; an earlier mcpp lists
# them as planned and takes them when the toolchain is named.
[target.x86_64-freebsd-musl]
toolchain = "llvm@23.1.3"

[target.aarch64-freebsd-musl]
toolchain = "llvm@23.1.3"
58 changes: 34 additions & 24 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,28 @@
[package]
namespace = "mcpplibs"
name = "openkal-platform"
version = "0.25.0"
version = "0.26.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"]
repo = "https://github.com/mcpplibs/openkal-platform"
# 2026.11.9.1: openkal-run (from 0.5.4) states its openkal implementation as a
# 2026.11.10.1: openkal-run (from 0.6.0) binds the interfaces its
# implementation provides (MCPP_KERNEL_ABI_INTERFACES), and FreeBSD's rows are
# built-in. 2026.11.9.1: openkal-run (from 0.5.4) states its openkal implementation as a
# capability with a default per system (`[defaults]`).
mcpp = ">=2026.11.9.1"
mcpp = ">=2026.11.10.1"

[platform]
targets = ["x86_64-openkal", "aarch64-openkal"]
toolchain = "llvm@23.1.3"
# The loader runs an image of its own architecture on Linux, macOS and Windows;
# `hosts` are the systems and architectures openkal-tools builds it for, which is
# where a package that needs it can run (mcpp's `runs_on`).
runner = { cmd = ["okrun", "{}"], host = "same-arch", hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64"] }
# where a package that needs it can run (mcpp's `runs_on`). FreeBSD (0.26.0):
# okrun over openkal-freebsd, beneath openkal-musl or beside the system's libc.
runner = { cmd = ["okrun", "{}"], host = "same-arch", hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64", "freebsd-x86_64", "freebsd-aarch64"] }
# `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.5.5", section = ".oke", main = "carrier/main.cpp" }
carrier = { package = "openkal-run@0.6.1", section = ".oke", main = "carrier/main.cpp" }
# The `okb` package format (`mcpp pack --pkg-format okb`): the images of every
# architecture as one file okrun runs (openkal-image docs/okb.md).
plugin = "build.mcpp"
Expand All @@ -42,18 +45,18 @@ 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.0"
"c++-abi" = "openkal-llvm-runtime@0.20.0"
c-abi = { name = "openkal-musl", version = "0.29.0", default-features = false, features = ["posix", "malloc-mimalloc"] }
compiler-runtime = "openkal-llvm-runtime@0.20.1"
"c++-abi" = "openkal-llvm-runtime@0.20.1"
c-abi = { name = "openkal-musl", version = "0.29.2", 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
# order of a start's first executions, which a producer lays its code out by
# and writes as the touch note).
[platform.tools]
okld = "openkal-tools@0.5.5"
okrun = "openkal-tools@0.5.5"
okprof = "openkal-tools@0.5.5"
okld = "openkal-tools@0.6.1"
okrun = "openkal-tools@0.6.1"
okprof = "openkal-tools@0.6.1"

# Every unit of an image (SPEC 12.2):
# -fPIC the image is ET_DYN and has no text relocation;
Expand Down Expand Up @@ -159,14 +162,18 @@ seal = [["okld", "note", "{}"], ["okld", "place", "{}"], ["okld", "check", "{}
[platform.hosted]
# On Windows the arrangement is the GNU ABI's (or musl's) row: a C library of the
# graph and libc++ above it are not the MSVC runtime's.
# On FreeBSD (0.26.0) the C library's implementation is openkal-freebsd in its
# standalone arrangement, which openkal-musl names for that system: the rows
# `<arch>-freebsd-musl` are the system with no C library of its own beneath.
targets = ["x86_64-linux-gnu", "aarch64-linux-gnu", "x86_64-linux-musl", "aarch64-linux-musl",
"x86_64-macos", "aarch64-macos", "x86_64-windows-gnu", "x86_64-windows-musl"]
"x86_64-macos", "aarch64-macos", "x86_64-windows-gnu", "x86_64-windows-musl",
"x86_64-freebsd-musl", "aarch64-freebsd-musl"]
toolchain = "llvm@23.1.3"

[platform.hosted.layers]
compiler-runtime = "openkal-llvm-runtime@0.20.0"
"c++-abi" = "openkal-llvm-runtime@0.20.0"
c-abi = { name = "openkal-musl", version = "0.29.0", default-features = false, features = ["posix", "malloc-mimalloc"] }
compiler-runtime = "openkal-llvm-runtime@0.20.1"
"c++-abi" = "openkal-llvm-runtime@0.20.1"
c-abi = { name = "openkal-musl", version = "0.29.2", default-features = false, features = ["posix", "malloc-mimalloc"] }

# 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 @@ -206,8 +213,10 @@ c-abi = { name = "openkal-musl", version = "0.29.0", default-features
# 0.25: a second name for a file and the requests to end counted, with
# openkal-linux 0.26.0, openkal-macos 0.23.0, openkal-windows 0.21.0,
# openkal-musl 0.29.0 (a program found by the system's own search rules, link
# over kal_fs_hard_link), openkal-llvm-runtime 0.20.0 and openkal-image 0.5.5):
# one version of each in a build. From 0.24.1 the members name one another by
# over kal_fs_hard_link), openkal-llvm-runtime 0.20.0 and openkal-image 0.5.5;
# 0.26.0, openkal-image 0.6.1 (the runner binds the interfaces its
# implementation provides), openkal-freebsd 0.1.0 beneath openkal-musl 0.29.2 and
# openkal-llvm-runtime 0.20.1 on FreeBSD): 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 @@ -217,16 +226,17 @@ openkal = "0.25.0"
openkal-linux = "0.26.0"
openkal-macos = "0.23.0"
openkal-windows = "0.21.0"
openkal-musl = "0.29.0"
openkal-llvm-runtime = "0.20.0"
openkal-ld = "0.5.5"
openkal-run = "0.5.5"
openkal-tools = "0.5.5"
openkal-freebsd = "0.1.0"
openkal-musl = "0.29.2"
openkal-llvm-runtime = "0.20.1"
openkal-ld = "0.6.1"
openkal-run = "0.6.1"
openkal-tools = "0.6.1"

# The plugin's tool, `okld bundle`, which writes the okb, and its library, the
# provider of a package format (mcpp.plugins.platform).
[build-dependencies]
openkal-tools = { version = "0.5.5", tools = ["okld"] }
openkal-tools = { version = "0.6.1", tools = ["okld"] }

[build-dependencies.mcpp]
plugins = { version = "0.20.0", features = ["plugins-platform"], host-module = true }
Loading