|
51 | 51 | mcpp run 2>&1 | tee run.log |
52 | 52 | grep -q "hello from openkal over SBI" run.log |
53 | 53 | grep -q "heap ok" run.log |
| 54 | +
|
| 55 | + # --------------------------------------------------------------------------- |
| 56 | + # The cross-compilation is performed FROM three systems, not only from Linux. |
| 57 | + # |
| 58 | + # Every target in this repository is a cross target, which makes the host a |
| 59 | + # separate axis from the target: the compiler, the target C library and the |
| 60 | + # emulator are payloads mcpp resolves for whichever system it is running on. |
| 61 | + # A package that has only ever been built from Linux is a package whose |
| 62 | + # consumers must use Linux, and nothing in these sources says so. |
| 63 | + # |
| 64 | + # ⚠️ A TOOLCHAIN AXIS IS ABSENT HERE, AND THAT IS MEASURED RATHER THAN |
| 65 | + # ASSUMED. The row for a bare-metal triple names its compiler, and the |
| 66 | + # command-line override does not displace it: `--toolchain gcc@16.1.0` on a |
| 67 | + # `riscv64-none-elf` build resolves llvm@22.1.8 regardless. A matrix over |
| 68 | + # compiler families would therefore run the same compiler on every row and |
| 69 | + # report coverage it does not have. The toolchain axis belongs where the |
| 70 | + # choice is real — openkal, whose declarations are compiled by three families |
| 71 | + # on three systems. |
| 72 | + # |
| 73 | + # ⚠️ BUILD ONLY, AND DELIBERATELY. Behaviour is asserted once, above, under an |
| 74 | + # emulator. Booting the same image from three systems would be a statement |
| 75 | + # about the emulator rather than about this package, and "the image does what |
| 76 | + # the README says" does not become more true for having been observed from |
| 77 | + # macOS. |
| 78 | + portability: |
| 79 | + name: cross-builds from ${{ matrix.os }} |
| 80 | + runs-on: ${{ matrix.os }} |
| 81 | + timeout-minutes: 45 |
| 82 | + strategy: |
| 83 | + fail-fast: false |
| 84 | + matrix: |
| 85 | + os: [macos-14, windows-2022] |
| 86 | + defaults: |
| 87 | + run: |
| 88 | + shell: bash |
| 89 | + env: |
| 90 | + MCPP_VERSION: 2026.8.20.2 |
| 91 | + XLINGS_VERSION: v2026.8.17.2 |
| 92 | + XLINGS_NON_INTERACTIVE: '1' |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v4 |
| 95 | + |
| 96 | + - name: Install xlings (Unix) |
| 97 | + if: runner.os != 'Windows' |
| 98 | + run: | |
| 99 | + curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \ |
| 100 | + | bash -s "$XLINGS_VERSION" |
| 101 | + echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH" |
| 102 | +
|
| 103 | + - name: Install xlings (Windows) |
| 104 | + if: runner.os == 'Windows' |
| 105 | + shell: pwsh |
| 106 | + run: | |
| 107 | + irm https://d2learn.org/xlings-install.ps1.txt | iex |
| 108 | + # The installer amends the user's environment; no later step in this |
| 109 | + # job reads it back, so the directory is named here. |
| 110 | + "$env:USERPROFILE\.xlings\subos\current\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 111 | +
|
| 112 | + - name: Install mcpp |
| 113 | + run: | |
| 114 | + xlings update |
| 115 | + xlings install "mcpp@$MCPP_VERSION" -y -g |
| 116 | + mcpp --version |
| 117 | + mcpp self config --mirror GLOBAL |
| 118 | +
|
| 119 | + - name: The backend cross-builds |
| 120 | + run: | |
| 121 | + mcpp build --target riscv64-none-elf |
0 commit comments