Skip to content

Commit b8be574

Browse files
committed
TEMP: macOS e2e CI pinning the unreleased stack
Build the aarch64 cross-compiler (pinning Solo5/solo5#641) and cross-build zarith with it: install ocaml-gmp (mirage/ocaml-gmp#29) for its relocatable gmp.pc, then point OCAMLC/OCAMLOPT/... at `ocamlfind -toolchain solo5` and PKG_CONFIG_PATH at that gmp.pc so zarith's configure (ocaml/Zarith#173) compiles caml_z.c with the cross cc against ocaml-gmp. Drop this commit, or the pins, once the forks are in opam.
1 parent b8d3717 commit b8be574

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,44 @@ jobs:
4444
run: MODE=muen opam exec -- dune build --root example
4545
- name: Compile examples with xen
4646
run: MODE=xen opam exec -- dune build --root example
47+
48+
# TEMP: end-to-end macOS check that pins the not-yet-released stack
49+
# (Solo5/solo5#641, mirage/ocaml-gmp#29, ocaml/Zarith#173). Drop the pins and
50+
# the fork clones once those land in opam.
51+
macos-e2e:
52+
name: macOS aarch64 e2e (zarith)
53+
runs-on: macos-latest
54+
env:
55+
OPAMYES: 1
56+
steps:
57+
- uses: actions/checkout@v6
58+
- name: Install the LLVM toolchain and target runtime
59+
run: |
60+
brew install llvm lld aarch64-elf-gcc pkg-config
61+
echo "$(brew --prefix llvm)/bin" >> "$GITHUB_PATH"
62+
echo "$(brew --prefix lld)/bin" >> "$GITHUB_PATH"
63+
- uses: ocaml/setup-ocaml@v3
64+
with:
65+
ocaml-compiler: 5.4.1
66+
opam-pin: false
67+
- name: Pin the stack and build the cross-compiler
68+
run: |
69+
opam pin add -n solo5 git+https://github.com/samoht/solo5.git#macos
70+
opam pin add -n solo5-cross-aarch64 git+https://github.com/samoht/solo5.git#macos
71+
opam pin add -n gmp git+https://github.com/samoht/ocaml-gmp.git#ship-gmp-pc
72+
opam pin add -n zarith git+https://github.com/samoht/zarith.git#honor-ocaml-env
73+
opam pin add -n ocaml-solo5-cross-aarch64 .
74+
opam install ocaml-solo5-cross-aarch64
75+
- name: Cross-build zarith against ocaml-gmp's pkg-config (Zarith#173)
76+
run: |
77+
set -euo pipefail
78+
opam remove -y zarith gmp conf-gmp || true
79+
opam install gmp # ocaml-gmp fork: relocatable gmp.pc under lib/pkgconfig
80+
OCAMLC="ocamlfind -toolchain solo5 ocamlc" \
81+
OCAMLOPT="ocamlfind -toolchain solo5 ocamlopt" \
82+
OCAMLDEP="ocamlfind -toolchain solo5 ocamldep" \
83+
OCAMLMKLIB="ocamlfind -toolchain solo5 ocamlmklib" \
84+
PKG_CONFIG_PATH="$(opam var lib)/pkgconfig:${PKG_CONFIG_PATH:-}" \
85+
opam install zarith --verbose 2>&1 | tee zarith-build.log
86+
# fail unless zarith was actually built through the solo5 cross toolchain
87+
grep -qE 'aarch64-solo5-ocaml|toolchain solo5' zarith-build.log

0 commit comments

Comments
 (0)