From 6f09cd2470b4efa5d15ba03d1ccaba05fffe2776 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Thu, 19 Nov 2026 12:34:18 +0900 Subject: [PATCH 1/3] 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. --- .github/workflows/ci.yml | 4 +-- README.md | 5 ++- checks/hello/mcpp.toml | 2 +- docs/adding-a-system.md | 15 ++++++++- mcpp.toml | 68 ++++++++++++++++++++++++++++++++++++++-- 5 files changed, 87 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0513803..95660bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ 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] runs-on: ${{ matrix.os }} timeout-minutes: 60 defaults: @@ -64,7 +64,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: diff --git a/README.md b/README.md index 82ae9d7..e7e8e04 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ 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 @@ -27,7 +29,8 @@ arm64, Windows x86_64) from mcpp 2026.11.18.1 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 diff --git a/checks/hello/mcpp.toml b/checks/hello/mcpp.toml index ac509b5..03f9830 100644 --- a/checks/hello/mcpp.toml +++ b/checks/hello/mcpp.toml @@ -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 diff --git a/docs/adding-a-system.md b/docs/adding-a-system.md index c426182..a223599 100644 --- a/docs/adding-a-system.md +++ b/docs/adding-a-system.md @@ -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 @@ -69,7 +71,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 `` 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: diff --git a/mcpp.toml b/mcpp.toml index b5457bb..c4f623e 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -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" @@ -17,7 +17,8 @@ mcpp = ">=2026.11.17.1" # machine enables it (`[target.] 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] @@ -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 `-freebsd`); the # 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", 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 } From 51bbc214fa626134e1bc7f37ef2bd65130500964 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Thu, 19 Nov 2026 12:50:20 +0900 Subject: [PATCH 2/3] 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 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. --- .github/workflows/ci.yml | 9 +++++++++ README.md | 4 +++- docs/adding-a-system.md | 9 +++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95660bd..d00ad2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,15 @@ jobs: 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, 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, mcpp gives a libstdc++ base's include directories to the std module's + # precompile on no host but Linux and macOS (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: diff --git a/README.md b/README.md index e7e8e04..f102e05 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,9 @@ mcpp run --target x86_64-netbsd # once the row's runner is enabled | `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 diff --git a/docs/adding-a-system.md b/docs/adding-a-system.md index a223599..c6305b1 100644 --- a/docs/adding-a-system.md +++ b/docs/adding-a-system.md @@ -47,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) `` 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. From 28822fb827335c4b31b5b2aefc06d8b909dff8db Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Thu, 19 Nov 2026 12:50:32 +0900 Subject: [PATCH 3/3] ci: the comment on the Windows exception says what happens --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d00ad2e..02334b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,10 +31,10 @@ jobs: 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, 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, mcpp gives a libstdc++ base's include directories to the std module's - # precompile on no host but Linux and macOS (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. + # 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 }