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
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-15, windows-2025]
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, aarch64-netbsd, x86_64-openbsd, aarch64-openbsd]
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, aarch64-netbsd, x86_64-openbsd, aarch64-openbsd, x86_64-hurd, x86_64-haiku]
# Hosts a row does not build on, each with its cause (docs/adding-a-system.md, "Hosts"):
# on Windows, the std module's precompile of a libstdc++ base gets none of its include
# directories (mcpp-community/mcpp#965); Haiku's headers hold posix/string.h and
# os/support/String.h, which a case-insensitive file system (macOS's default) does not
# tell apart.
exclude:
- { os: windows-2025, row: x86_64-hurd }
- { os: windows-2025, row: x86_64-haiku }
- { os: macos-15, row: x86_64-haiku }
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
Expand Down Expand Up @@ -64,7 +73,7 @@ jobs:
strategy:
fail-fast: false
matrix:
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, x86_64-openbsd]
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, x86_64-openbsd, x86_64-hurd, x86_64-haiku]
runs-on: ubuntu-24.04
timeout-minutes: 60
defaults:
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ mcpp run --target x86_64-netbsd # once the row's runner is enabled
| `aarch64-netbsd` | `xim:aarch64-netbsd-sysroot@10.2` | libc++ from source (`llvm.libcxx`) | none |
| `x86_64-openbsd` | `xim:x86_64-openbsd-sysroot@8.0` | the base's libc++ | OpenBSD 8.0 in QEMU (dirun) |
| `aarch64-openbsd` | `xim:aarch64-openbsd-sysroot@8.0` | the base's libc++ | none |
| `x86_64-hurd` | `xim:x86_64-hurd-sysroot@20260314` | the base's libstdc++ | Debian GNU/Hurd in QEMU (dirun) |
| `x86_64-haiku` | `xim:x86_64-haiku-sysroot@hrev60431` | the base's libstdc++ | Haiku hrev60431 in QEMU (dirun) |

The rows build on every host mcpp runs on (Linux x86_64 and aarch64, macOS
arm64, Windows x86_64) from mcpp 2026.11.18.1
arm64, Windows x86_64) from mcpp 2026.11.18.1, but for three pairs: GNU/Hurd and
Haiku on Windows (mcpp#965), and Haiku on macOS, whose default file system does
not tell `string.h` from Haiku's `String.h`
([docs/adding-a-system.md](docs/adding-a-system.md#hosts)).

Every row compiles `import std`. NetBSD's own C++ library is GCC 10's
libstdc++, which ships no module sources; its rows take the C++ layer from
libc++ built over NetBSD's C library (the providers' `layers`), and the
compiler runtime, libgcc_s, stays the system's.
compiler runtime, libgcc_s, stays the system's. GNU/Hurd's and Haiku's is
GCC 15's libstdc++, whose module sources their bases state.

A runner fetches a machine image on its first use, so it is off until a
project or a machine enables it, for one row or for every row of this
Expand Down
2 changes: 1 addition & 1 deletion checks/hello/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ version = "0.1.0"
# the package index, with its runner enabled where it has one. Before the
# platform defines a row, `cfg(os = ...)` is answered by the triple as written
# (mcpp SPEC-013 §3.1).
[target.'cfg(any(os = "freebsd", os = "netbsd", os = "openbsd"))']
[target.'cfg(any(os = "freebsd", os = "netbsd", os = "openbsd", os = "hurd", os = "haiku"))']
platform = { path = "../.." }
runner = true
24 changes: 23 additions & 1 deletion docs/adding-a-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ document states the procedure and what each part must hold.
| FreeBSD 14.5 | `x86_64-freebsd`, `aarch64-freebsd` (mcpp's built-in rows) | the release's base set | both | `preview` |
| NetBSD 10.2 | `x86_64-netbsd`, `aarch64-netbsd` | the release's base and comp sets; the C++ layer is libc++ from source (`llvm.libcxx`) | x86_64 | `preview` |
| OpenBSD 8.0 | `x86_64-openbsd`, `aarch64-openbsd` | the release's base and comp sets | x86_64 | `preview` |
| GNU/Hurd (Debian, hurd-amd64) | `x86_64-hurd` | the packages of Debian's pre-installed image of 2026-03-14, from the archive's snapshot of that day; the C++ layer is GCC 15's libstdc++ | x86_64 | `preview` |
| Haiku hrev60431 | `x86_64-haiku` | the revision's system and development packages, with GCC's run-time from HaikuPorts; the C++ layer is GCC's libstdc++ | x86_64 | `preview` |
| illumos (OmniOS r151054) | none | assembled, not published | measured | not included: see below |

illumos is not included. Its sysroot and disk image were assembled, and C and
Expand Down Expand Up @@ -45,6 +47,15 @@ is corrected where it was:
A base whose link inputs a linker cannot read is the base's to correct: a
sysroot package states in its `PROVENANCE.md` what it changed of the release.

Two rows of 0.2.0 do not build on every host, measured in its CI:

| Row | Host | Cause | Where it is corrected |
|---|---|---|---|
| `x86_64-hurd`, `x86_64-haiku` | Windows | the std module's precompile is given neither the base's include directories nor `-nostdinc++`, for a base whose C++ library is libstdc++ (`'bits/stdc++.h' file not found`) | mcpp ([mcpp#965](https://github.com/mcpp-community/mcpp/issues/965)) |
| `x86_64-haiku` | macOS | Haiku's headers hold `posix/string.h` and `os/support/String.h`, and clang's Haiku driver searches `os/support` first: on a case-insensitive file system (macOS's default) `<string.h>` is BeAPI's `String.h` | not by a package: Haiku's own build asks for a case-sensitive file system on macOS |

CI does not build those pairs; every other pair of a row and a host builds.

A row runs where its runner does: the disk images boot under QEMU on Linux
x86_64, which is where the CI runs them.

Expand All @@ -69,7 +80,18 @@ made it.

Every row compiles `import std`. A base whose C++ library ships module sources
states them (`std-module`, [mcpp docs/22](https://github.com/mcpp-community/mcpp/blob/main/docs/22-target-side.md)); FreeBSD and OpenBSD ship libc++, and
their sysroots carry the module sources of its release. A system whose C++
their sysroots carry the module sources of its release. GNU/Hurd and Haiku ship
GCC 15's libstdc++, whose module sources (`bits/std.cc`) their sysroots state
with libstdc++'s include directories. A C header that defines a function with
internal linkage which the std module exports is the base's to correct: Haiku's
x86_64 `<fenv.h>` defines seven `static __inline`, and its sysroot gives them
external linkage in C++ (stated in its `PROVENANCE.md`).

The base and the image are of one release: a program is built against the
libraries it runs with. Measured on GNU/Hurd: a C++ program built against the
libstdc++ of `sid` of 2026-11-18 did not start in the image of 2026-03-14
(`GLIBCXX_3.4.36' not found`); the base is taken from the archive's snapshot of
the image's day. A system whose C++
library ships none (NetBSD: GCC 10's libstdc++) takes the C++ layer from a
package instead, libc++ built from source over the system's C library:

Expand Down
68 changes: 66 additions & 2 deletions mcpp.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
namespace = "mcpp"
name = "platforms"
version = "0.1.0"
version = "0.2.0"
description = "Rows for systems the engine does not carry: their definitions, bases and runners"
license = "Apache-2.0"
repo = "https://github.com/mcpp-community/mcpp-platforms"
Expand All @@ -17,7 +17,8 @@ mcpp = ">=2026.11.17.1"
# machine enables it (`[target.<row>] runner = { enabled = true }`).

[platform]
targets = ["x86_64-freebsd", "aarch64-freebsd", "x86_64-netbsd", "aarch64-netbsd", "x86_64-openbsd", "aarch64-openbsd"]
targets = ["x86_64-freebsd", "aarch64-freebsd", "x86_64-netbsd", "aarch64-netbsd", "x86_64-openbsd", "aarch64-openbsd",
"x86_64-hurd", "x86_64-haiku"]
toolchain = "llvm@23.1.3"

[platform.link]
Expand All @@ -31,6 +32,11 @@ driver = "compiler"
[platform.build.'cfg(os = "netbsd")']
ldflags = ["-Wl,--as-needed", "-lgcc_s", "-Wl,--no-as-needed"]

# The compiler's run-time is not built for the Hurd: its rows link the base's
# libgcc, as the system's own programs do.
[platform.build.'cfg(os = "hurd")']
ldflags = ["-rtlib=libgcc", "--unwindlib=libgcc"]

# ── FreeBSD ─────────────────────────────────────────────────────────────────
# The rows are mcpp's own (its built-in table defines `<arch>-freebsd`); the
# table names no provider for them, so the system's base and runner are here.
Expand Down Expand Up @@ -133,3 +139,61 @@ runner = { cmd = ["dirun", "--profile", "{pkg:openbsd-disk-image}/dirun.toml",
serves = ["aarch64-openbsd"]
sysroot = "xim:aarch64-openbsd-sysroot@8.0"
hosted = true

# ── GNU/Hurd ────────────────────────────────────────────────────────────────
# Debian GNU/Hurd's amd64 port: glibc on the Hurd, with GCC's run-time and
# libstdc++, whose std module sources the base states (xim's
# x86_64-hurd-sysroot@20260314: the package versions of the image of the same
# day, so a program is built against the libraries it runs with), run in
# Debian's pre-installed image (xim's hurd-disk-image), whose disks are behind
# the machine's IDE controller and whose files disk is a tar archive (dirun
# 0.7.0).

[[platform.system]]
name = "hurd"
uname = "GNU"

[[platform.define]]
triple = "x86_64-hurd"
clang-triple = "x86_64-pc-hurd-gnu"
loader = "/lib/ld-x86-64.so.1"
object-format = "elf"
family = "unix"
execution = "hurd"
tier = "preview"
standard = true

[[platform.provider]]
serves = ["x86_64-hurd"]
sysroot = "xim:x86_64-hurd-sysroot@20260314"
hosted = true
runner = { cmd = ["dirun", "--profile", "{pkg:hurd-disk-image}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--", "{}"],
host = "any", hosts = ["linux-x86_64"],
requires = ["xim:dirun@0.7.0", "xim:hurd-disk-image@20260314", "xim:qemu-x86@9.2.4-1"], enabled = false }

# ── Haiku ───────────────────────────────────────────────────────────────────
# Haiku's x86_64 nightly: libroot with GCC's run-time and libstdc++ from
# HaikuPorts, whose std module sources the base states (xim's
# x86_64-haiku-sysroot hrev60431, revision 1; laid out as a running system,
# boot/system), run in an image of the same revision (xim's haiku-disk-image).

[[platform.system]]
name = "haiku"
uname = "Haiku"

[[platform.define]]
triple = "x86_64-haiku"
clang-triple = "x86_64-unknown-haiku"
object-format = "elf"
family = "unix"
execution = "haiku"
tier = "preview"
standard = true

[[platform.provider]]
serves = ["x86_64-haiku"]
sysroot = "xim:x86_64-haiku-sysroot@hrev60431"
hosted = true
runner = { cmd = ["dirun", "--profile", "{pkg:haiku-disk-image}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--", "{}"],
host = "any", hosts = ["linux-x86_64"],
requires = ["xim:dirun@0.7.0", "xim:haiku-disk-image@hrev60431", "xim:qemu-x86@9.2.4-1"], enabled = false }
Loading