Skip to content

Commit 80575dd

Browse files
authored
The rows on macOS and Windows hosts: the build matrix, the Hosts section (#3)
* The rows build on macOS and Windows hosts: the build matrix, the Hosts section * The FreeBSD rows are not linked on a Windows host: its lld reads no zlib-compressed section
1 parent 044db27 commit 80575dd

3 files changed

Lines changed: 41 additions & 18 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# The rows of mcpp.platforms (docs/adding-a-system.md, "A check"):
22
#
33
# build every row's check (checks/hello: the std module, an exception, its
4-
# arguments) is built on the Linux hosts, x86_64 and aarch64, and the
5-
# artifact is an ELF executable of the row's system and machine
6-
# (docs/adding-a-system.md, "Hosts": a macOS or Windows host does not
7-
# build these rows yet);
4+
# arguments) is built on each host (Linux x86_64 and aarch64, macOS
5+
# arm64, Windows x86_64), and the artifact is an ELF executable of
6+
# the row's system and machine (docs/adding-a-system.md, "Hosts").
7+
# The FreeBSD rows are not built on Windows: its lld reads no
8+
# zlib-compressed section, and FreeBSD's crt objects hold some;
89
# run on Linux x86_64, every row with a runner runs the check through
910
# `mcpp run`: dirun boots the system's disk image under QEMU, and the
1011
# program's output and status (7) come back.
@@ -21,16 +22,19 @@ concurrency:
2122
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2223

2324
env:
24-
MCPP_VERSION: "2026.11.17.1"
25+
MCPP_VERSION: "2026.11.17.2"
2526

2627
jobs:
2728
build:
2829
name: build ${{ matrix.row }} on ${{ matrix.os }}
2930
strategy:
3031
fail-fast: false
3132
matrix:
32-
os: [ubuntu-24.04, ubuntu-24.04-arm]
33+
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-15, windows-2025]
3334
row: [x86_64-freebsd, aarch64-freebsd, x86_64-netbsd, aarch64-netbsd, x86_64-openbsd, aarch64-openbsd]
35+
exclude:
36+
- { os: windows-2025, row: x86_64-freebsd }
37+
- { os: windows-2025, row: aarch64-freebsd }
3438
runs-on: ${{ matrix.os }}
3539
timeout-minutes: 60
3640
defaults:
@@ -46,8 +50,9 @@ jobs:
4650
run: |
4751
mcpp build --target "${{ matrix.row }}"
4852
exe=$(find "target/${{ matrix.row }}" -path '*/bin/hello' -type f | head -1)
53+
py=$(command -v python3 || command -v python)
4954
[ -n "$exe" ] || { echo "::error::no executable for ${{ matrix.row }}"; exit 1; }
50-
python3 - "$exe" "${{ matrix.row }}" <<'PY'
55+
"$py" - "$exe" "${{ matrix.row }}" <<'PY'
5156
import sys
5257
data = open(sys.argv[1], "rb").read(64)
5358
row = sys.argv[2]

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ mcpp run --target x86_64-netbsd # once the row's runner is enabled
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 |
2222

23-
The rows build on a Linux host, x86_64 or aarch64; a macOS or Windows host does
24-
not build them yet ([docs/adding-a-system.md](docs/adding-a-system.md#hosts)).
23+
The rows build on Linux x86_64 and aarch64 and on macOS arm64; on Windows x86_64
24+
the NetBSD and OpenBSD rows build and the FreeBSD rows do not link yet, from mcpp
25+
2026.11.17.2 ([docs/adding-a-system.md](docs/adding-a-system.md#hosts)).
2526

2627
Every row compiles `import std`. NetBSD's own C++ library is GCC 10's
2728
libstdc++, which ships no module sources; its rows take the C++ layer from

‎docs/adding-a-system.md‎

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,34 @@ links with, or clang's Solaris driver gives lld the GNU options.
2525

2626
## Hosts
2727

28-
The rows build on a Linux host, x86_64 or aarch64, which this repository's CI
29-
checks. A macOS or Windows host does not build them yet. Measured in the CI of
30-
0.1.0 with mcpp 2026.11.17.1, the host's own conventions reach the row:
28+
The rows build on the hosts mcpp runs on, each checked by this repository's CI:
3129

32-
| Host | What reaches the row |
33-
|---|---|
34-
| macOS | the Apple SDK's headers in the std module's compile (FreeBSD); libc++ compiled against the host's ctype definitions (NetBSD, `_CTYPE_BL`); the Mach-O linker given ELF options (OpenBSD, `ld64.lld: unknown argument '--disable-new-dtags'`) |
35-
| Windows | the sysroot's headers not opened (NetBSD, `sys/cdefs.h`); the crt objects not found and the program named `.exe` (FreeBSD) |
30+
| Host | NetBSD, OpenBSD | FreeBSD |
31+
|---|---|---|
32+
| Linux x86_64, aarch64 | built | built |
33+
| macOS arm64 | built | built |
34+
| Windows x86_64 | built | not linked |
35+
36+
The row, not the host, decides a cross build: the artifact is an ELF executable
37+
of the row's system, and the sysroot package is the only source of headers, crt
38+
objects and libraries. This holds from mcpp 2026.11.17.2 and xlings
39+
2026.11.17.1. Measured in the CI of 0.1.0 with mcpp 2026.11.17.1, two defects
40+
let the host's conventions reach the row, and both are corrected there:
3641

37-
These are mcpp's to correct (the row, not the host, decides a cross build); the
38-
rows enter the build matrix of a host when it builds them.
42+
| Defect | Seen as | Corrected in |
43+
|---|---|---|
44+
| The object format of a row with no format word in its triple was taken from the host | macOS: the Apple SDK's headers in the std module's compile, the Mach-O linker given ELF options; Windows: the link line without the row's sysroot | mcpp 2026.11.17.2 |
45+
| A link to a directory extracted on Windows was a file link | Windows: the sysroot's headers not opened (`sys/cdefs.h`) | xlings 2026.11.17.1 |
46+
47+
One case remains. On a Windows host the FreeBSD rows compile and do not link:
48+
FreeBSD's `crtend.o` and `libgcc.a` hold debug sections compressed with zlib,
49+
and the lld of the Windows LLVM payload is built without zlib (`ld.lld: error:
50+
... is compressed with ELFCOMPRESS_ZLIB, but lld is not built with zlib
51+
support`). The correction belongs to that payload; until then those two rows
52+
are not in the Windows build matrix.
53+
54+
A row runs where its runner does: the disk images boot under QEMU on Linux
55+
x86_64, which is where the CI runs them.
3956

4057
## What a system brings
4158

0 commit comments

Comments
 (0)