Skip to content

Commit 277470b

Browse files
TimmmmAlasdair
authored andcommitted
Enable Mac binary release
The requirements for signing can be ignored by setting your terminal/IDE as a "Developer Tool" in System Settings->Privacy & Security->Developer Tools. This also fixed a minor bug when I added Windows support, in that the bundled Z3 executable won't have its executable bit set (which doesn't matter for Windows but it does for Linux/Mac). Finally disable the 'Setup Z3' action on Linux since we already build it from source anyway.
1 parent 7b949c4 commit 277470b

File tree

2 files changed

+29
-20
lines changed

2 files changed

+29
-20
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ jobs:
2424
container: rockylinux:8
2525
ocaml_version: 5.2.1
2626
tarball_filename: sail-Linux-aarch64.tar.gz
27-
# MacOS disabled for now due to code signing and notarisation requirements
28-
# - name: mac-arm64
29-
# os: macos-26
30-
# container: ""
31-
# ocaml_version: 5.2.1
32-
# tarball_filename: sail-Mac-arm64.tar.gz
27+
- name: mac-arm64
28+
os: macos-26
29+
container: ""
30+
ocaml_version: 5.2.1
31+
tarball_filename: sail-Darwin-arm64.tar.gz
3332
- name: Windows-x86_64
3433
os: windows-2025
3534
container: ""
@@ -91,12 +90,25 @@ jobs:
9190
git config --global --add safe.directory '*'
9291
git fetch --unshallow
9392
94-
- name: Setup Z3
93+
- name: Setup Z3 (Windows, Mac)
9594
id: z3
95+
if: runner.os != 'Linux'
9696
uses: cda-tum/setup-z3@v1
9797
with:
9898
version: 4.15.3
9999

100+
# Build Z3 from source since the binary releases only support glibc 2.31
101+
# and old distros like RHEL 8 have 2.28.
102+
- name: Build Z3 (Linux)
103+
if: runner.os == 'Linux'
104+
run: |
105+
git clone --depth 1 --branch z3-4.13.0 https://github.com/Z3Prover/z3.git
106+
mkdir z3/build
107+
cd z3/build
108+
cmake -DCMAKE_BUILD_TYPE=Release ..
109+
make -j4
110+
make install
111+
100112
# Note this must be after checkout otherwise it doesn't pin local packages
101113
# and create the default switch or something.
102114
- name: Set-up OCaml
@@ -126,18 +138,6 @@ jobs:
126138
opam pin --yes --no-action add .
127139
opam install sail --yes
128140
129-
# Build Z3 from source since the binary releases only support glibc 2.31
130-
# and old distros like RHEL 8 have 2.28.
131-
- name: Build Z3
132-
if: runner.os == 'Linux'
133-
run: |
134-
git clone --depth 1 --branch z3-4.13.0 https://github.com/Z3Prover/z3.git
135-
mkdir z3/build
136-
cd z3/build
137-
cmake -DCMAKE_BUILD_TYPE=Release ..
138-
make -j4
139-
make install
140-
141141
- name: Make release tarball (Linux)
142142
if: runner.os == 'Linux'
143143
run: |
@@ -148,6 +148,11 @@ jobs:
148148
run: |
149149
opam exec -- make tarball "Z3_EXE=$($(Get-Command z3).Source)" "GMP_DLL=$($(Get-Command libgmp-10.dll).Source)"
150150
151+
- name: Make release tarball (Mac)
152+
if: runner.os == 'macOS'
153+
run: |
154+
opam exec -- make tarball "Z3_EXE=$(which z3)"
155+
151156
- uses: actions/attest-build-provenance@v1
152157
with:
153158
subject-path: _build/${{ matrix.tarball_filename }}

src/sail_maker/sail_maker.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ let copy_file (input_path : string) (output_path : string) =
7676
in
7777
copy_loop ();
7878
close_in ic;
79-
close_out oc
79+
close_out oc;
80+
81+
(* Copy permission bits; needed for copying in Z3 on Unix platforms. *)
82+
let in_stat = Unix.stat input_path in
83+
Unix.chmod output_path in_stat.Unix.st_perm
8084
with e ->
8185
close_in_noerr ic;
8286
close_out_noerr oc;

0 commit comments

Comments
 (0)