Skip to content

Commit 6162030

Browse files
authored
CI: setup-ocaml 3.4.6 / OPAM 2.4 / windows-2025 runners (#8006)
1 parent 5ce1de7 commit 6162030

File tree

3 files changed

+38
-49
lines changed

3 files changed

+38
-49
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ concurrency:
1818

1919
env:
2020
OCAMLRUNPARAM: b
21+
RUST_BACKTRACE: "1"
22+
RUSTFLAGS: "-Dwarnings"
2123

2224
jobs:
2325
build-compiler:
@@ -52,7 +54,7 @@ jobs:
5254
upload_binaries: true
5355
node-target: darwin-arm64
5456
rust-target: aarch64-apple-darwin
55-
- os: windows-2022
57+
- os: windows-2025
5658
ocaml_compiler: 5.3.0
5759
upload_binaries: true
5860
node-target: win32-x64
@@ -68,12 +70,8 @@ jobs:
6870
runs-on: ${{matrix.os}}
6971

7072
env:
71-
# setup-ocaml opam version cannot be configured
72-
# we do track its version manually
73-
OPAM_VERSION: 2.3.0
74-
DUNE_PROFILE: release
75-
RUST_BACKTRACE: "1"
76-
RUSTFLAGS: "-Dwarnings"
73+
# When changing the setup-ocaml version, also adjust it in the setup step further below.
74+
SETUP_OCAML_VERSION: 3.4.6 # OPAM <2.6.0
7775

7876
steps:
7977
- name: "Windows: Set git config"
@@ -102,9 +100,10 @@ jobs:
102100
if: runner.os == 'Linux'
103101
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
104102
with:
105-
# See https://github.com/ocaml/setup-ocaml/blob/b2105f9/packages/setup-ocaml/src/unix.ts#L9
106-
packages: bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync
107-
version: v3
103+
# https://github.com/ocaml/setup-ocaml/blob/2f57267f071bc8547dfcb9433ff21d44fffef190/packages/setup-ocaml/src/unix.ts#L48
104+
# plus OPAM wants cmake
105+
packages: bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync cmake
106+
version: v4
108107

109108
- name: Restore rewatch build cache
110109
id: rewatch-build-cache
@@ -147,7 +146,7 @@ jobs:
147146
# matrix.ocaml_compiler may contain commas
148147
- name: Get OPAM cache key
149148
shell: bash
150-
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
149+
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ env.SETUP_OCAML_VERSION }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
151150

152151
- name: Restore OPAM environment
153152
id: cache-opam-env
@@ -158,12 +157,12 @@ jobs:
158157
~/.opam
159158
_opam
160159
.opam-path
161-
D:\cygwin
162-
D:\.opam
160+
C:\cygwin
161+
C:\.opam
163162
key: ${{ env.opam_cache_key }}
164163

165164
- name: Use OCaml ${{matrix.ocaml_compiler}}
166-
uses: ocaml/setup-ocaml@v3.3.2
165+
uses: ocaml/setup-ocaml@v3.4.6
167166
if: steps.cache-opam-env.outputs.cache-hit != 'true'
168167
with:
169168
ocaml-compiler: ${{matrix.ocaml_compiler}}
@@ -194,25 +193,29 @@ jobs:
194193
~/.opam
195194
_opam
196195
.opam-path
197-
D:\cygwin
198-
D:\.opam
196+
C:\cygwin
197+
C:\.opam
199198
key: ${{ env.opam_cache_key }}
200199

201200
- name: Use cached OPAM environment
202201
if: steps.cache-opam-env.outputs.cache-hit == 'true'
203202
run: |
204-
# https://github.com/ocaml/setup-ocaml/blob/b2105f9/packages/setup-ocaml/src/installer.ts#L33
205-
echo "OPAMVERBOSE=$RUNNER_DEBUG" >> "$GITHUB_ENV"
206-
echo "OPAMCOLOR=always" >> "$GITHUB_ENV"
207-
echo "OPAMCONFIRMLEVEL=unsafe-yes" >> "$GITHUB_ENV"
208-
echo "OPAMERRLOGLEN=0" >> "$GITHUB_ENV"
209-
echo "OPAMPRECISETRACKING=1" >> "$GITHUB_ENV"
210-
echo "OPAMYES=1" >> "$GITHUB_ENV"
203+
# https://github.com/ocaml/setup-ocaml/blob/v3.4.6/packages/setup-ocaml/src/installer.ts
204+
echo "OPAMCOLOR=always" >> "$GITHUB_ENV"
205+
echo "OPAMCONFIRMLEVEL=unsafe-yes" >> "$GITHUB_ENV"
206+
echo "OPAMDOWNLOADJOBS=4" >> "$GITHUB_ENV"
207+
echo "OPAMERRLOGLEN=0" >> "$GITHUB_ENV"
208+
echo "OPAMEXTERNALSOLVER=builtin-0install" >> "$GITHUB_ENV"
209+
echo "OPAMPRECISETRACKING=1" >> "$GITHUB_ENV"
210+
echo "OPAMRETRIES=10" >> "$GITHUB_ENV"
211+
echo "OPAMSOLVERTIMEOUT=600" >> "$GITHUB_ENV"
212+
echo "OPAMYES=1" >> "$GITHUB_ENV"
213+
echo "CLICOLOR_FORCE=1" >> "$GITHUB_ENV"
211214
212215
if [[ "$RUNNER_OS" != "Windows" ]]; then
213216
echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV"
214217
else
215-
echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
218+
echo "OPAMROOT=C:\\.opam" >> "$GITHUB_ENV"
216219
fi
217220
218221
OPAM_PATH="$(cat .opam-path)"
@@ -224,27 +227,18 @@ jobs:
224227
fsutil behavior set symlinkEvaluation R2L:1 R2R:1
225228
fsutil behavior query SymlinkEvaluation
226229
227-
CYGWIN="winsymlinks:native"
228-
CYGWIN_ROOT="D:\\cygwin"
229-
CYGWIN_ROOT_BIN="D:\\cygwin\\bin"
230-
CYGWIN_ROOT_WRAPPERBIN="D:\\cygwin\\wrapperbin"
231-
232230
echo "HOME=$USERPROFILE" >> "$GITHUB_ENV"
233231
echo "MSYS=winsymlinks:native" >> "$GITHUB_ENV"
234-
echo "CYGWIN=$CYGWIN" >> "$GITHUB_ENV"
235-
echo "CYGWIN_ROOT=$CYGWIN_ROOT" >> "$GITHUB_ENV"
236-
echo "CYGWIN_ROOT_BIN=$CYGWIN_ROOT_BIN" >> "$GITHUB_ENV"
237-
echo "CYGWIN_ROOT_WRAPPERBIN=$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_ENV"
238-
239-
echo "$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_PATH"
232+
echo "CYGWIN=winsymlinks:native" >> "$GITHUB_ENV"
233+
echo "BASH_ENV=C:\\cygwin\\bash_env" >> "$GITHUB_ENV"
240234
fi
241235
shell: bash
242236

243237
- name: Compiler build state key
244238
id: compiler-build-state-key
245239
shell: bash
246240
run: |
247-
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" \
241+
echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ env.SETUP_OCAML_VERSION }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" \
248242
| sed 's/,/-/g' >> "$GITHUB_OUTPUT"
249243
250244
- name: Restore compiler build state
@@ -253,7 +247,7 @@ jobs:
253247
uses: actions/cache/restore@v4
254248
with:
255249
path: |
256-
D:\.cache\dune
250+
C:\.cache\dune
257251
~/.cache/dune
258252
_build
259253
key: ${{ steps.compiler-build-state-key.outputs.value }}
@@ -283,7 +277,7 @@ jobs:
283277
uses: actions/cache/save@v4
284278
with:
285279
path: |
286-
D:\.cache\dune
280+
C:\.cache\dune
287281
~/.cache/dune
288282
_build
289283
key: ${{ steps.compiler-build-state-key.outputs.value }}
@@ -548,10 +542,8 @@ jobs:
548542
- os: macos-15
549543
- os: ubuntu-24.04
550544
- os: ubuntu-24.04-arm
551-
- os: windows-2022
545+
- os: windows-2025
552546
runs-on: ${{ matrix.os }}
553-
env:
554-
RUST_BACKTRACE: "1"
555547
steps:
556548
- name: Checkout
557549
uses: actions/checkout@v4
@@ -599,10 +591,8 @@ jobs:
599591
- os: macos-15
600592
- os: ubuntu-24.04
601593
- os: ubuntu-24.04-arm
602-
- os: windows-2022
594+
- os: windows-2025
603595
runs-on: ${{ matrix.os }}
604-
env:
605-
RUST_BACKTRACE: "1"
606596
steps:
607597
- name: Install pnpm
608598
uses: pnpm/action-setup@v4
@@ -654,10 +644,8 @@ jobs:
654644
- os: macos-15
655645
- os: ubuntu-24.04
656646
- os: ubuntu-24.04-arm
657-
- os: windows-2022
647+
- os: windows-2025
658648
runs-on: ${{ matrix.os }}
659-
env:
660-
RUST_BACKTRACE: "1"
661649
steps:
662650
- name: Checkout
663651
uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#### :house: Internal
3232

3333
- Rename Core to Stdlib in tests/tests. https://github.com/rescript-lang/rescript/pull/8005
34+
- CI: Build on `windows-2025` runners. https://github.com/rescript-lang/rescript/pull/8006
3435

3536
# 12.0.0-rc.3
3637

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Happy hacking!
1414

1515
> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!
1616
17-
- [Node.js](https://nodejs.org/) v22.x
17+
- [Node.js](https://nodejs.org/) v22.x or newer
1818
- [Yarn CLI](https://yarnpkg.com/getting-started/install) (can be installed with `corepack`, Homebrew, etc)
1919
- C compiler toolchain (usually installed with `xcode` on Mac)
2020
- Python <= 3.11 (required to build ninja)
2121
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install)
22-
- `opam` (OCaml Package Manager) v2.2.0
22+
- `opam` (OCaml Package Manager) v2.2.0 or newer
2323
- VSCode (+ [OCaml Platform Extension](https://marketplace.visualstudio.com/items?itemName=ocamllabs.ocaml-platform))
2424

2525
## Cloning the Git Repo

0 commit comments

Comments
 (0)