Skip to content

Commit f2b1885

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 f2b1885

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,42 @@ 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+
# No brew install or PATH setup: opam pulls the LLVM toolchain and target
59+
# runtime through solo5-cross-aarch64's depexts, and configure resolves the
60+
# keg-only tools to absolute paths.
61+
- uses: ocaml/setup-ocaml@v3
62+
with:
63+
ocaml-compiler: 5.4.1
64+
opam-pin: false
65+
- name: Pin the stack and build the cross-compiler
66+
run: |
67+
opam pin add -n solo5 git+https://github.com/samoht/solo5.git#macos
68+
opam pin add -n solo5-cross-aarch64 git+https://github.com/samoht/solo5.git#macos
69+
opam pin add -n gmp git+https://github.com/samoht/ocaml-gmp.git#ship-gmp-pc
70+
opam pin add -n zarith git+https://github.com/samoht/zarith.git#honor-ocaml-env
71+
opam pin add -n ocaml-solo5-cross-aarch64 .
72+
opam install ocaml-solo5-cross-aarch64
73+
- name: Cross-build zarith against ocaml-gmp's pkg-config (Zarith#173)
74+
run: |
75+
set -euo pipefail
76+
opam remove -y zarith gmp conf-gmp || true
77+
opam install gmp # ocaml-gmp fork: relocatable gmp.pc under lib/pkgconfig
78+
OCAMLC="ocamlfind -toolchain solo5 ocamlc" \
79+
OCAMLOPT="ocamlfind -toolchain solo5 ocamlopt" \
80+
OCAMLDEP="ocamlfind -toolchain solo5 ocamldep" \
81+
OCAMLMKLIB="ocamlfind -toolchain solo5 ocamlmklib" \
82+
PKG_CONFIG_PATH="$(opam var lib)/pkgconfig:${PKG_CONFIG_PATH:-}" \
83+
opam install zarith --verbose 2>&1 | tee zarith-build.log
84+
# fail unless zarith was actually built through the solo5 cross toolchain
85+
grep -qE 'aarch64-solo5-ocaml|toolchain solo5' zarith-build.log

0 commit comments

Comments
 (0)