Skip to content

Commit 2f282dd

Browse files
committed
ci: Support macOS ARM64
Part of diskuv/dkml-installer-ocaml#80
1 parent 6a4e079 commit 2f282dd

13 files changed

+2567
-15
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes
22

3+
## 2.1.0
4+
5+
- Support macOS ARM64
6+
- Bump GitLab SaaS hardware from `macos-11-xcode-12` (x86_64) to `macos-12-xcode-14` (arm64)
7+
38
## Pending (1.2.1)
49

510
> The minimum Dune language requirement is `(lang dune 3.0)`. Please update

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ Run one of:
198198
```bash
199199
# macOS/Intel (or macOS/ARM64 with Rosetta emulator)
200200
sh ci/setup-dkml/pc/setup-dkml-darwin_x86_64.sh
201+
# -or- macOS/ARM64
202+
sh ci/setup-dkml/pc/setup-dkml-darwin_arm64.sh
201203

202204
# Linux on 64-bit Intel/AMD. Docker is required.
203205
# - Running this from macOS/Intel with Docker or macOS/Silicon with Docker will also work

bump-packages.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ DkMLBumpPackagesParticipant_TestPromote(REL_FILENAMES
2525
test/gh-windows/pre/action.yml
2626
test/gl/setup-dkml.gitlab-ci.yml
2727
test/pc/setup-dkml-darwin_x86_64.sh
28+
test/pc/setup-dkml-darwin_arm64.sh
2829
test/pc/setup-dkml-linux_x86.sh
2930
test/pc/setup-dkml-linux_x86_64.sh
3031
test/pc/setup-dkml-windows_x86.ps1

src/logic/model.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@ let matrix =
311311
[
312312
("abi_pattern", Jg_types.Tstr {|macos-darwin_all|});
313313
("gh_os", Jg_types.Tstr "macos-latest");
314-
("gl_image", Jg_types.Tstr "macos-11-xcode-12");
314+
("gl_image", Jg_types.Tstr "macos-12-xcode-14");
315315
("gh_unix_shell", Jg_types.Tstr {|sh|});
316316
("bootstrap_opam_version", bootstrap_opam_version);
317-
("dkml_host_abi", Jg_types.Tstr {|darwin_x86_64|});
317+
("dkml_host_abi", Jg_types.Tstr {|darwin_arm64|});
318318
("gh_opam_root", Jg_types.Tstr {|/Users/runner/.opam|});
319319
("gl_opam_root", Jg_types.Tstr {|${CI_PROJECT_DIR}/.ci/o|});
320320
("pc_opam_root", Jg_types.Tstr {|${PC_PROJECT_DIR}/.ci/o|});

src/pc_setup_dkml.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let () =
4141
let usage =
4242
Printf.sprintf
4343
"%s [--output-windows_x86 OUTPUT_FILE.ps1] [--output-windows_x86_64 \
44-
OUTPUT_FILE.ps1] [--output-darwin_x86_64 OUTPUT_FILE.sh] \
44+
OUTPUT_FILE.ps1] [--output-darwin_x86_64 OUTPUT_FILE.sh] [--output-darwin_arm64 OUTPUT_FILE.sh] \
4545
[--output-linux_x86 OUTPUT_FILE.sh] [--output-linux_x86_64 \
4646
OUTPUT_FILE.sh]\n\
4747
At least one --output-<ABI> option must be selected." exe_name
@@ -74,6 +74,8 @@ let () =
7474
"Output Powershell script for Windows 64-bit" );
7575
output_unix_abi_arg ~dkml_host_abi:"darwin_x86_64"
7676
~descr:"macOS/Intel (or macOS/ARM64 with Rosetta emulator)";
77+
output_unix_abi_arg ~dkml_host_abi:"darwin_arm64"
78+
~descr:"macOS/ARM64";
7779
output_unix_abi_arg ~dkml_host_abi:"linux_x86"
7880
~descr:"Linux on 32-bit Intel/AMD";
7981
output_unix_abi_arg ~dkml_host_abi:"linux_x86_64"

src/setup_dkml_scaffold.ml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,23 @@ let scaffold_pc ~output_dir () =
165165
(action
166166
(diff setup-dkml-darwin_x86_64.sh setup-dkml-darwin_x86_64-gen.sh)))
167167

168+
; darwin_arm64
169+
170+
(rule
171+
(target setup-dkml-darwin_arm64-gen.sh)
172+
(enabled_if %%{bin-available:pc-setup-dkml})
173+
(action
174+
(setenv
175+
OCAMLRUNPARAM
176+
b
177+
(run pc-setup-dkml --output-darwin_arm64 %%{target}))))
178+
179+
(rule
180+
(alias gen-dkml)
181+
(enabled_if %%{bin-available:pc-setup-dkml})
182+
(action
183+
(diff setup-dkml-darwin_arm64.sh setup-dkml-darwin_arm64-gen.sh)))
184+
168185
; linux_x86
169186

170187
(rule

test/gh-darwin/post/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ runs:
2020
# Select correct Darwin matrix variables
2121
case "${{ matrix.dkml_host_abi }}" in
2222
23-
darwin_x86_64)
23+
darwin_arm64)
2424
dkml_host_os='darwin';
2525
opam_root_cacheable='/Users/runner/.opam';
2626
abi_pattern='macos-darwin_all';
2727
gh_os='macos-latest';
2828
gh_unix_shell='sh';
2929
bootstrap_opam_version='2.2.0-alpha-20221228';
30-
dkml_host_abi='darwin_x86_64';
30+
dkml_host_abi='darwin_arm64';
3131
opam_root='/Users/runner/.opam' ;;
3232
3333
*) echo "FATAL: Unsupported dkml_host_abi=$dkml_host_abi in Darwin action.yml"; exit 107 ;;

test/gh-darwin/pre/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ runs:
6161
# Select correct Darwin matrix variables
6262
case "${{ matrix.dkml_host_abi }}" in
6363
64-
darwin_x86_64)
64+
darwin_arm64)
6565
dkml_host_os='darwin';
6666
opam_root_cacheable='/Users/runner/.opam';
6767
abi_pattern='macos-darwin_all';
6868
gh_os='macos-latest';
6969
gh_unix_shell='sh';
7070
bootstrap_opam_version='2.2.0-alpha-20221228';
71-
dkml_host_abi='darwin_x86_64';
71+
dkml_host_abi='darwin_arm64';
7272
opam_root='/Users/runner/.opam' ;;
7373
7474
*) echo "FATAL: Unsupported dkml_host_abi=$dkml_host_abi in Darwin action.yml"; exit 107 ;;

test/gl/setup-dkml.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,9 +2370,9 @@ variables:
23702370
{ dkml_host_os: 'darwin',
23712371
opam_root_cacheable: '${CI_PROJECT_DIR}/.ci/o',
23722372
abi_pattern: 'macos-darwin_all',
2373-
gl_image: 'macos-11-xcode-12',
2373+
gl_image: 'macos-12-xcode-14',
23742374
bootstrap_opam_version: '2.2.0-alpha-20221228',
2375-
dkml_host_abi: 'darwin_x86_64',
2375+
dkml_host_abi: 'darwin_arm64',
23762376
opam_root: '${CI_PROJECT_DIR}/.ci/o' },
23772377

23782378
]

test/pc/dune

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@
4343
(action
4444
(diff setup-dkml-darwin_x86_64.sh setup-dkml-darwin_x86_64-gen.sh)))
4545

46+
; darwin_arm64
47+
48+
(rule
49+
(target setup-dkml-darwin_arm64-gen.sh)
50+
(action
51+
(setenv
52+
OCAMLRUNPARAM
53+
b
54+
(run ../../src/pc_setup_dkml.exe --output-darwin_arm64 %{target}))))
55+
56+
(rule
57+
(alias runtest)
58+
(action
59+
(diff setup-dkml-darwin_arm64.sh setup-dkml-darwin_arm64-gen.sh)))
60+
4661
; linux_x86
4762

4863
(rule

0 commit comments

Comments
 (0)