@@ -15,36 +15,33 @@ jobs:
1515 matrix :
1616 include :
1717 - name : Linux-x86_64
18- os : ubuntu-latest
18+ os : ubuntu-24.04
1919 container : rockylinux:8
2020 ocaml_version : 5.2.1
21- opam_arch : i686
22- opam_cache_key : rocky8-5.2.1
21+ tarball_filename : sail-Linux-x86_64.tar.gz
2322 - name : Linux-aarch64
2423 os : ubuntu-24.04-arm
2524 container : rockylinux:8
2625 ocaml_version : 5.2.1
27- opam_arch : arm64
28- opam_cache_key : rocky8-5.2.1-arm
26+ tarball_filename : sail-Linux-aarch64.tar.gz
2927 # MacOS disabled for now due to code signing and notarisation requirements
30- # - name: mac-arm64 */
31- # os: macos-latest */
32- # container: "" */
33- # ocaml_version: 5.2.1 */
34- # opam_cache_key: macos-latest-5.2.1 */
28+ # - name: mac-arm64
29+ # os: macos-26
30+ # container: ""
31+ # ocaml_version: 5.2.1
32+ # tarball_filename: sail-Mac-arm64.tar.gz
33+ - name : Windows-x86_64
34+ os : windows-2025
35+ container : " "
36+ ocaml_version : 5.2.1
37+ tarball_filename : sail-Windows-AMD64.zip
3538
3639 runs-on : ${{ matrix.os }}
3740 container : ${{ matrix.container }}
3841
39- env :
40- # Disable opam warning about running as root.
41- OPAMROOTISOK : 1
42-
4342 steps :
44- # This must be before checkout otherwise Github will use a zip of the
45- # code instead of git clone.
4643 - name : System dependencies (Linux)
47- if : startsWith(matrix .os, 'ubuntu')
44+ if : runner .os == 'Linux'
4845 run : |
4946 dnf install --assumeyes \
5047 gmp-devel \
@@ -64,15 +61,20 @@ jobs:
6461 diffutils \
6562 rsync \
6663 which \
67- cargo
68- curl -L -o /usr/local/bin/opam https://github.com/ocaml/opam/releases/download/2.1.5/opam-2.1.5-${{ matrix.opam_arch }}-linux
69- chmod +x /usr/local/bin/opam
64+ cargo \
65+ bubblewrap
7066
71- - name : System dependencies (Mac )
72- if : startsWith(matrix .os, 'macos')
67+ - name : System dependencies (macOS )
68+ if : runner .os == 'macOS'
7369 run : |
74- brew install --force --overwrite gpatch gmp z3 pkgconf opam git rust
70+ brew install --force --overwrite gpatch gmp pkgconf git rust
71+
72+ - name : System dependencies (Windows)
73+ if : runner.os == 'Windows'
74+ run : vcpkg install gmp
7575
76+ # This must be after git has been installed otherwise Github will use a zip
77+ # of the code instead of git clone.
7678 - uses : actions/checkout@v4
7779
7880 # Retreive git history (but not files) so that `git describe` works. This is
@@ -89,39 +91,45 @@ jobs:
8991 git config --global --add safe.directory '*'
9092 git fetch --unshallow
9193
92- - name : Restore cached ~/.opam
93- id : cache-opam-restore
94- uses : actions/cache/restore@v4
94+ - name : Setup Z3
95+ id : z3
96+ uses : cda-tum/setup-z3@v1
9597 with :
96- path : ~/.opam
97- key : ${{ matrix.opam_cache_key }}
98+ version : 4.15.3
9899
99- - name : Init opam
100- if : steps.cache-opam-restore.outputs.cache-hit != 'true'
101- run : |
102- # Sandboxing doesn't work in Docker.
103- opam init --disable-sandboxing --yes --no-setup --shell=sh --compiler=${{ matrix.ocaml_version }} && \
104- eval "$(opam env)" && \
105- ocaml --version
106-
107- - name : Save cached opam
108- if : steps.cache-opam-restore.outputs.cache-hit != 'true'
109- id : cache-opam-save
110- uses : actions/cache/save@v4
100+ # Note this must be after checkout otherwise it doesn't pin local packages
101+ # and create the default switch or something.
102+ - name : Set-up OCaml
103+ uses : ocaml/setup-ocaml@v3
111104 with :
112- path : ~/.opam
113- key : ${{ steps.cache-opam-restore.outputs.cache-primary-key }}
105+ ocaml-compiler : ${{ matrix.ocaml_version }}
106+
107+ - name : Set LEMLIB env var
108+ if : runner.os == 'Windows'
109+ # Note we can't use `opam var lem:share` because lem hasn't been installed yet.
110+ run : echo "LEMLIB=$(opam var share)\lem\library" >> $env:GITHUB_ENV
111+
112+ # This contains a fix for paths on Windows but hasn't been released yet.
113+ - name : Pin latest linksem
114+ if : runner.os == 'Windows'
115+ run : opam pin add linksem https://github.com/rems-project/linksem.git
116+
117+ # Workaround for https://github.com/rems-project/lem/issues/38
118+ - name : Install and fix lem
119+ if : runner.os == 'Windows'
120+ run : |
121+ opam install lem
122+ Rename-Item -Path "$(opam var lem:bin)\lem" -NewName "lem.exe"
114123
115124 - name : Install Sail
116125 run : |
117- eval $(opam env)
118126 opam pin --yes --no-action add .
119127 opam install sail --yes
120128
121129 # Build Z3 from source since the binary releases only support glibc 2.31
122130 # and old distros like RHEL 8 have 2.28.
123131 - name : Build Z3
124- if : startsWith(matrix .os, 'ubuntu')
132+ if : runner .os == 'Linux'
125133 run : |
126134 git clone --depth 1 --branch z3-4.13.0 https://github.com/Z3Prover/z3.git
127135 mkdir z3/build
@@ -130,17 +138,22 @@ jobs:
130138 make -j4
131139 make install
132140
133- - name : Make release tarball
141+ - name : Make release tarball (Linux)
142+ if : runner.os == 'Linux'
143+ run : |
144+ opam exec -- make tarball Z3_EXE=z3/build/z3
145+
146+ - name : Make release tarball (Windows)
147+ if : runner.os == 'Windows'
134148 run : |
135- eval $(opam env)
136- make tarball TARBALL_EXTRA_BIN=z3/build/z3
149+ opam exec -- make tarball "Z3_EXE=$($(Get-Command z3).Source)" "GMP_DLL=$($(Get-Command libgmp-10.dll).Source)"
137150
138151 - uses : actions/attest-build-provenance@v1
139152 with :
140- subject-path : _build/sail- ${{ matrix.name }}.tar.gz
153+ subject-path : _build/${{ matrix.tarball_filename }}
141154
142155 - name : Upload tarball
143156 uses : actions/upload-artifact@v4
144157 with :
145158 name : sail-${{ matrix.name }}
146- path : _build/sail- ${{ matrix.name }}.tar.gz
159+ path : _build/${{ matrix.tarball_filename }}
0 commit comments