@@ -24,21 +24,14 @@ jobs:
24
24
strategy :
25
25
fail-fast : false
26
26
matrix :
27
- os : [
28
- macos-13, # x64
29
- macos-14, # ARM
30
- ubuntu-latest, # x64
31
- buildjet-2vcpu-ubuntu-2204-arm, # ARM
32
- windows-latest,
33
- ]
34
27
include :
35
- - os : macos-13
28
+ - os : macos-13 # x64
36
29
rust-target : x86_64-apple-darwin
37
- - os : macos-14
30
+ - os : macos-14 # ARM
38
31
rust-target : aarch64-apple-darwin
39
- - os : ubuntu-latest
32
+ - os : ubuntu-latest # x64
40
33
rust-target : x86_64-unknown-linux-musl
41
- - os : buildjet-2vcpu-ubuntu-2204-arm
34
+ - os : buildjet-2vcpu-ubuntu-2204-arm # ARM
42
35
rust-target : aarch64-unknown-linux-musl
43
36
- os : windows-latest
44
37
rust-target : x86_64-pc-windows-gnu
@@ -96,13 +89,10 @@ jobs:
96
89
# for more info.
97
90
# The container already comes with all required tools pre-installed
98
91
# (see https://github.com/rescript-lang/docker-rescript-ci-build/blob/main/Dockerfile).
99
- static-binaries-linux :
100
- strategy :
101
- fail-fast : false
102
- matrix :
103
- os : [ubuntu-latest, buildjet-2vcpu-ubuntu-2204-arm]
104
-
105
- runs-on : ${{matrix.os}}
92
+ # Note: Static ARM64 binaries cannot be built directly on Ubuntu runner because of
93
+ # https://github.com/ocaml/opam-repository/issues/26216
94
+ static-binaries-linux-arm :
95
+ runs-on : buildjet-2vcpu-ubuntu-2204-arm
106
96
107
97
steps :
108
98
- name : Checkout
@@ -131,7 +121,7 @@ jobs:
131
121
upload-linux-arm64-binaries :
132
122
needs :
133
123
- build-rewatch
134
- - static-binaries-linux
124
+ - static-binaries-linux-arm
135
125
136
126
runs-on : buildjet-2vcpu-ubuntu-2204-arm
137
127
@@ -140,7 +130,6 @@ jobs:
140
130
uses : actions/checkout@v4
141
131
142
132
- name : Download static linux binaries
143
- if : runner.os == 'Linux'
144
133
uses : actions/download-artifact@v4
145
134
with :
146
135
name : static-binaries-linux-${{ runner.arch }}
@@ -171,18 +160,19 @@ jobs:
171
160
build :
172
161
needs :
173
162
- build-rewatch
174
- - static-binaries-linux
175
163
176
164
strategy :
177
165
fail-fast : false
178
166
matrix :
179
- os : [
180
- macos-13, # x64
181
- macos-14, # ARM
182
- ubuntu-latest,
183
- windows-latest,
184
- ]
185
- ocaml_compiler : [5.2.0]
167
+ include :
168
+ - os : macos-13 # x64
169
+ ocaml_compiler : 5.2.0
170
+ - os : macos-14 # ARM
171
+ ocaml_compiler : 5.2.0
172
+ - os : ubuntu-latest # x64
173
+ ocaml_compiler : ocaml-variants.5.2.0+options,ocaml-option-static
174
+ - os : windows-latest
175
+ ocaml_compiler : 5.2.0
186
176
187
177
runs-on : ${{matrix.os}}
188
178
@@ -204,12 +194,6 @@ jobs:
204
194
with :
205
195
fetch-depth : 2 # to be able to check for changes in subfolder jscomp/syntax later
206
196
207
- - name : Download static linux binaries
208
- if : runner.os == 'Linux'
209
- uses : actions/download-artifact@v4
210
- with :
211
- name : static-binaries-linux-${{ runner.arch }}
212
-
213
197
- name : Get artifact dir name
214
198
run : node .github/workflows/get_artifact_dir_name.js
215
199
@@ -219,13 +203,6 @@ jobs:
219
203
name : rewatch-${{ env.artifact_dir_name }}
220
204
path : rewatch
221
205
222
- - name : Make static linux binaries executable
223
- if : runner.os == 'Linux'
224
- run : |
225
- chmod +x ninja/ninja
226
- chmod +x rewatch/rewatch
227
- chmod +x _build/install/default/bin/*
228
-
229
206
- name : Install dependencies (Linux)
230
207
if : runner.os == 'Linux'
231
208
@@ -239,6 +216,11 @@ jobs:
239
216
with :
240
217
python-version : ' 3.10'
241
218
219
+ # matrix.ocaml_compiler may contain commas
220
+ - name : Get OPAM cache key
221
+ shell : bash
222
+ run : echo "opam_cache_key=opam-env-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}" | sed 's/,/-/g' >> $GITHUB_ENV
223
+
242
224
- name : Restore OPAM environment
243
225
id : cache-opam-env
244
226
uses : actions/cache/restore@v4
@@ -250,7 +232,7 @@ jobs:
250
232
.opam-path
251
233
D:\cygwin
252
234
D:\.opam
253
- key : opam-env-v1- ${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}
235
+ key : ${{ env.opam_cache_key }}
254
236
255
237
- name : Use OCaml ${{matrix.ocaml_compiler}}
256
238
@@ -286,7 +268,7 @@ jobs:
286
268
.opam-path
287
269
D:\cygwin
288
270
D:\.opam
289
- key : opam-env-v1- ${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project') }}
271
+ key : ${{ env.opam_cache_key }}
290
272
291
273
- name : Use cached OPAM environment
292
274
if : steps.cache-opam-env.outputs.cache-hit == 'true'
@@ -334,6 +316,10 @@ jobs:
334
316
if : runner.os != 'Linux'
335
317
run : opam exec -- dune build --display quiet --profile release
336
318
319
+ - name : Build compiler (Linux static)
320
+ if : runner.os == 'Linux'
321
+ run : opam exec -- dune build --display quiet --profile static
322
+
337
323
- name : Use Node.js
338
324
uses : actions/setup-node@v4
339
325
with :
@@ -352,6 +338,12 @@ jobs:
352
338
if : runner.os != 'Linux'
353
339
run : node scripts/buildNinjaBinary.js
354
340
341
+ - name : Build ninja (Linux static)
342
+ if : runner.os == 'Linux'
343
+ env :
344
+ LDFLAGS : -static
345
+ run : node scripts/buildNinjaBinary.js
346
+
355
347
- name : Copy exes to platform bin dirs
356
348
run : node ./scripts/copyExes.js
357
349
0 commit comments