|
| 1 | +name: probe-kabi-macos |
| 2 | + |
| 3 | +# A temporary probe on a macOS runner: e2e 299's output under this branch, and |
| 4 | +# whether x86_64-macos builds on Apple silicon and runs there through Rosetta. |
| 5 | +# Every step continues on error: the value of a probe is the complete set of |
| 6 | +# readings. |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: ['probe/kabi-macos'] |
| 11 | + |
| 12 | +jobs: |
| 13 | + probe: |
| 14 | + runs-on: macos-15 |
| 15 | + timeout-minutes: 60 |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + - uses: ./.github/actions/setup-macos-llvm |
| 19 | + |
| 20 | + - name: Build this branch's mcpp |
| 21 | + run: | |
| 22 | + set -euo pipefail |
| 23 | + export MCPP_VENDORED_XLINGS="$XLINGS_BIN" |
| 24 | + "$MCPP" build |
| 25 | + built=$(find target -type f -name mcpp -path '*/bin/*' | grep -v /dist/ | head -1) |
| 26 | + echo "FRESH=$PWD/$built" >> "$GITHUB_ENV" |
| 27 | + "$PWD/$built" --version |
| 28 | +
|
| 29 | + - name: "299: output" |
| 30 | + continue-on-error: true |
| 31 | + run: | |
| 32 | + export MCPP_VENDORED_XLINGS="$XLINGS_BIN" |
| 33 | + "$FRESH" toolchain default "llvm@${MCPP_LLVM_VER}" || true |
| 34 | + MCPP="$FRESH" bash tests/e2e/299_a_request_that_named_no_c_library_resolves_to_a_row_that_exists.sh 2>&1 | tail -60 |
| 35 | + for t in aarch64-linux x86_64-linux aarch64-linux-gnu; do |
| 36 | + echo "=== why toolchain --target $t" |
| 37 | + "$FRESH" why toolchain --target "$t" --format json 2>&1 | head -c 4000; echo |
| 38 | + done |
| 39 | +
|
| 40 | + - name: "x86_64-macos: Rosetta, build, run" |
| 41 | + continue-on-error: true |
| 42 | + run: | |
| 43 | + set -x |
| 44 | + arch -x86_64 /usr/bin/true && echo "READING rosetta=yes" || echo "READING rosetta=no" |
| 45 | + mkdir -p /tmp/xm/src && cd /tmp/xm |
| 46 | + printf '[package]\nname = "xm"\nversion = "0.1.0"\n\n[targets.xm]\nkind = "bin"\nmain = "src/main.cpp"\n' > mcpp.toml |
| 47 | + printf 'import std;\nint main() { std::println("xm {}", sizeof(void*)); return 5; }\n' > src/main.cpp |
| 48 | + "$FRESH" build --target x86_64-macos --toolchain "llvm@${MCPP_LLVM_VER}" 2>&1 | tail -25 |
| 49 | + f=$(find target -type f -name xm -perm -u+x | head -1) |
| 50 | + file "$f" |
| 51 | + "$f"; echo "READING direct rc=$?" |
| 52 | + "$FRESH" run --target x86_64-macos --toolchain "llvm@${MCPP_LLVM_VER}" 2>&1 | tail -8; echo "READING run rc=${PIPESTATUS[0]}" |
| 53 | + printf '#include <stdio.h>\nint main(void) { printf("c %%d\\n", (int)sizeof(long)); return 6; }\n' > src/main.c |
| 54 | + printf '[package]\nname = "xm"\nversion = "0.1.0"\n\n[targets.xm]\nkind = "bin"\nmain = "src/main.c"\n' > mcpp.toml |
| 55 | + rm -f src/main.cpp |
| 56 | + "$FRESH" run --target x86_64-macos --toolchain "llvm@${MCPP_LLVM_VER}" 2>&1 | tail -8; echo "READING c run rc=${PIPESTATUS[0]}" |
| 57 | + "$FRESH" test --target x86_64-macos --toolchain "llvm@${MCPP_LLVM_VER}" 2>&1 | tail -5 || true |
0 commit comments