Skip to content

Commit 96c67c9

Browse files
authored
0.2.0: GNU/Hurd and Haiku (x86_64-hurd, x86_64-haiku), with import std and a runner each (#5)
* 0.2.0: GNU/Hurd and Haiku (x86_64-hurd, x86_64-haiku), with import std and a runner each Two systems move here from the external validation project's own platforms (ChenPi11/cmd fork, mcpp/platforms/), as docs/adding-a-system.md states a system: the system, a row, a provider over a sysroot package of xim and a dirun runner over the system's disk image, enabled on request. - GNU/Hurd: Debian's hurd-amd64 base at the package versions of Debian's pre-installed image of 2026-03-14 (xim x86_64-hurd-sysroot@20260314), run in that image (hurd-disk-image@20260314). The compiler's run-time is the base's libgcc (cfg(os = "hurd") ldflags). - Haiku: hrev60431's base with GCC's run-time from HaikuPorts (x86_64-haiku-sysroot@hrev60431, revision 1), run in an image of the same revision (haiku-disk-image@hrev60431). Both bases state GCC 15's std module sources, so both rows compile import std (openxlings/xim-pkgindex#1194). Measured on Linux x86_64: the check (import std, an exception, its arguments) built for each row and run in the system's image returned 7. CI builds both rows on the four hosts and runs them on Linux x86_64. * The hosts GNU/Hurd and Haiku do not build on, each with its cause Measured in this PR's CI: on Windows the std module's precompile of a libstdc++ base gets neither its include directories nor -nostdinc++ (mcpp-community/mcpp#965); on macOS, whose default file system is case-insensitive, Haiku's <string.h> is its BeAPI String.h, since clang's Haiku driver searches os/support before posix. CI does not build those three pairs; docs/adding-a-system.md and the README state them. * ci: the comment on the Windows exception says what happens
1 parent 156fa61 commit 96c67c9

5 files changed

Lines changed: 108 additions & 8 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ jobs:
2929
fail-fast: false
3030
matrix:
3131
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-15, windows-2025]
32-
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, aarch64-netbsd, x86_64-openbsd, aarch64-openbsd]
32+
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, aarch64-netbsd, x86_64-openbsd, aarch64-openbsd, x86_64-hurd, x86_64-haiku]
33+
# Hosts a row does not build on, each with its cause (docs/adding-a-system.md, "Hosts"):
34+
# on Windows, the std module's precompile of a libstdc++ base gets none of its include
35+
# directories (mcpp-community/mcpp#965); Haiku's headers hold posix/string.h and
36+
# os/support/String.h, which a case-insensitive file system (macOS's default) does not
37+
# tell apart.
38+
exclude:
39+
- { os: windows-2025, row: x86_64-hurd }
40+
- { os: windows-2025, row: x86_64-haiku }
41+
- { os: macos-15, row: x86_64-haiku }
3342
runs-on: ${{ matrix.os }}
3443
timeout-minutes: 60
3544
defaults:
@@ -64,7 +73,7 @@ jobs:
6473
strategy:
6574
fail-fast: false
6675
matrix:
67-
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, x86_64-openbsd]
76+
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, x86_64-openbsd, x86_64-hurd, x86_64-haiku]
6877
runs-on: ubuntu-24.04
6978
timeout-minutes: 60
7079
defaults:

‎README.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@ mcpp run --target x86_64-netbsd # once the row's runner is enabled
1919
| `aarch64-netbsd` | `xim:aarch64-netbsd-sysroot@10.2` | libc++ from source (`llvm.libcxx`) | none |
2020
| `x86_64-openbsd` | `xim:x86_64-openbsd-sysroot@8.0` | the base's libc++ | OpenBSD 8.0 in QEMU (dirun) |
2121
| `aarch64-openbsd` | `xim:aarch64-openbsd-sysroot@8.0` | the base's libc++ | none |
22+
| `x86_64-hurd` | `xim:x86_64-hurd-sysroot@20260314` | the base's libstdc++ | Debian GNU/Hurd in QEMU (dirun) |
23+
| `x86_64-haiku` | `xim:x86_64-haiku-sysroot@hrev60431` | the base's libstdc++ | Haiku hrev60431 in QEMU (dirun) |
2224

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

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

3237
A runner fetches a machine image on its first use, so it is off until a
3338
project or a machine enables it, for one row or for every row of this

‎checks/hello/mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ version = "0.1.0"
99
# the package index, with its runner enabled where it has one. Before the
1010
# platform defines a row, `cfg(os = ...)` is answered by the triple as written
1111
# (mcpp SPEC-013 §3.1).
12-
[target.'cfg(any(os = "freebsd", os = "netbsd", os = "openbsd"))']
12+
[target.'cfg(any(os = "freebsd", os = "netbsd", os = "openbsd", os = "hurd", os = "haiku"))']
1313
platform = { path = "../.." }
1414
runner = true

‎docs/adding-a-system.md‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ document states the procedure and what each part must hold.
1313
| FreeBSD 14.5 | `x86_64-freebsd`, `aarch64-freebsd` (mcpp's built-in rows) | the release's base set | both | `preview` |
1414
| 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` |
1515
| OpenBSD 8.0 | `x86_64-openbsd`, `aarch64-openbsd` | the release's base and comp sets | x86_64 | `preview` |
16+
| 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` |
17+
| 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` |
1618
| illumos (OmniOS r151054) | none | assembled, not published | measured | not included: see below |
1719

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

50+
Two rows of 0.2.0 do not build on every host, measured in its CI:
51+
52+
| Row | Host | Cause | Where it is corrected |
53+
|---|---|---|---|
54+
| `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)) |
55+
| `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 |
56+
57+
CI does not build those pairs; every other pair of a row and a host builds.
58+
4859
A row runs where its runner does: the disk images boot under QEMU on Linux
4960
x86_64, which is where the CI runs them.
5061

@@ -69,7 +80,18 @@ made it.
6980

7081
Every row compiles `import std`. A base whose C++ library ships module sources
7182
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
72-
their sysroots carry the module sources of its release. A system whose C++
83+
their sysroots carry the module sources of its release. GNU/Hurd and Haiku ship
84+
GCC 15's libstdc++, whose module sources (`bits/std.cc`) their sysroots state
85+
with libstdc++'s include directories. A C header that defines a function with
86+
internal linkage which the std module exports is the base's to correct: Haiku's
87+
x86_64 `<fenv.h>` defines seven `static __inline`, and its sysroot gives them
88+
external linkage in C++ (stated in its `PROVENANCE.md`).
89+
90+
The base and the image are of one release: a program is built against the
91+
libraries it runs with. Measured on GNU/Hurd: a C++ program built against the
92+
libstdc++ of `sid` of 2026-11-18 did not start in the image of 2026-03-14
93+
(`GLIBCXX_3.4.36' not found`); the base is taken from the archive's snapshot of
94+
the image's day. A system whose C++
7395
library ships none (NetBSD: GCC 10's libstdc++) takes the C++ layer from a
7496
package instead, libc++ built from source over the system's C library:
7597

‎mcpp.toml‎

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
namespace = "mcpp"
33
name = "platforms"
4-
version = "0.1.0"
4+
version = "0.2.0"
55
description = "Rows for systems the engine does not carry: their definitions, bases and runners"
66
license = "Apache-2.0"
77
repo = "https://github.com/mcpp-community/mcpp-platforms"
@@ -17,7 +17,8 @@ mcpp = ">=2026.11.17.1"
1717
# machine enables it (`[target.<row>] runner = { enabled = true }`).
1818

1919
[platform]
20-
targets = ["x86_64-freebsd", "aarch64-freebsd", "x86_64-netbsd", "aarch64-netbsd", "x86_64-openbsd", "aarch64-openbsd"]
20+
targets = ["x86_64-freebsd", "aarch64-freebsd", "x86_64-netbsd", "aarch64-netbsd", "x86_64-openbsd", "aarch64-openbsd",
21+
"x86_64-hurd", "x86_64-haiku"]
2122
toolchain = "llvm@23.1.3"
2223

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

35+
# The compiler's run-time is not built for the Hurd: its rows link the base's
36+
# libgcc, as the system's own programs do.
37+
[platform.build.'cfg(os = "hurd")']
38+
ldflags = ["-rtlib=libgcc", "--unwindlib=libgcc"]
39+
3440
# ── FreeBSD ─────────────────────────────────────────────────────────────────
3541
# The rows are mcpp's own (its built-in table defines `<arch>-freebsd`); the
3642
# table names no provider for them, so the system's base and runner are here.
@@ -133,3 +139,61 @@ runner = { cmd = ["dirun", "--profile", "{pkg:openbsd-disk-image}/dirun.toml",
133139
serves = ["aarch64-openbsd"]
134140
sysroot = "xim:aarch64-openbsd-sysroot@8.0"
135141
hosted = true
142+
143+
# ── GNU/Hurd ────────────────────────────────────────────────────────────────
144+
# Debian GNU/Hurd's amd64 port: glibc on the Hurd, with GCC's run-time and
145+
# libstdc++, whose std module sources the base states (xim's
146+
# x86_64-hurd-sysroot@20260314: the package versions of the image of the same
147+
# day, so a program is built against the libraries it runs with), run in
148+
# Debian's pre-installed image (xim's hurd-disk-image), whose disks are behind
149+
# the machine's IDE controller and whose files disk is a tar archive (dirun
150+
# 0.7.0).
151+
152+
[[platform.system]]
153+
name = "hurd"
154+
uname = "GNU"
155+
156+
[[platform.define]]
157+
triple = "x86_64-hurd"
158+
clang-triple = "x86_64-pc-hurd-gnu"
159+
loader = "/lib/ld-x86-64.so.1"
160+
object-format = "elf"
161+
family = "unix"
162+
execution = "hurd"
163+
tier = "preview"
164+
standard = true
165+
166+
[[platform.provider]]
167+
serves = ["x86_64-hurd"]
168+
sysroot = "xim:x86_64-hurd-sysroot@20260314"
169+
hosted = true
170+
runner = { cmd = ["dirun", "--profile", "{pkg:hurd-disk-image}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--", "{}"],
171+
host = "any", hosts = ["linux-x86_64"],
172+
requires = ["xim:dirun@0.7.0", "xim:hurd-disk-image@20260314", "xim:qemu-x86@9.2.4-1"], enabled = false }
173+
174+
# ── Haiku ───────────────────────────────────────────────────────────────────
175+
# Haiku's x86_64 nightly: libroot with GCC's run-time and libstdc++ from
176+
# HaikuPorts, whose std module sources the base states (xim's
177+
# x86_64-haiku-sysroot hrev60431, revision 1; laid out as a running system,
178+
# boot/system), run in an image of the same revision (xim's haiku-disk-image).
179+
180+
[[platform.system]]
181+
name = "haiku"
182+
uname = "Haiku"
183+
184+
[[platform.define]]
185+
triple = "x86_64-haiku"
186+
clang-triple = "x86_64-unknown-haiku"
187+
object-format = "elf"
188+
family = "unix"
189+
execution = "haiku"
190+
tier = "preview"
191+
standard = true
192+
193+
[[platform.provider]]
194+
serves = ["x86_64-haiku"]
195+
sysroot = "xim:x86_64-haiku-sysroot@hrev60431"
196+
hosted = true
197+
runner = { cmd = ["dirun", "--profile", "{pkg:haiku-disk-image}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--", "{}"],
198+
host = "any", hosts = ["linux-x86_64"],
199+
requires = ["xim:dirun@0.7.0", "xim:haiku-disk-image@hrev60431", "xim:qemu-x86@9.2.4-1"], enabled = false }

0 commit comments

Comments
 (0)