Skip to content

Commit af82f6b

Browse files
authored
Fix CI failures and restore compatibility with OCaml 5.3 (#1212)
This patch bundles #1199, #1204, and #1208 into one. ## OCaml 5.3 compability This patch makes it possible to compile Links with the recently released OCaml 5.3.0 compiler. In OCaml 5.3.0 the token `effect` has become a keyword, and thus cannot be used as the name of a binder anymore. ## CI workflow changes Github is deprecating the CI image `ubuntu-20.04`: > The Ubuntu 20.04 runner image will be fully unsupported by April 1, 2025. To raise awareness of the upcoming removal, we will temporarily fail jobs using Ubuntu 20.04. Builds that are scheduled to run during the brownout periods will fail. The brownouts are scheduled for the following dates and times: > > March 4 14:00 UTC – 22:00 UTC > March 11 13:00 UTC – 21:00 UTC > March 18 13:00 UTC – 21:00 UTC > March 25 13:00 UTC – 21:00 UTC > > What you need to do > > Jobs using the ubuntu-20.04 YAML workflow label should be updated to ubuntu-22.04, ubuntu-24.04 or ubuntu-latest. You can always get up-to-date information on our tools by reading about the software in the runner images repository. Please contact GitHub Support if you run into any problems or need help. This patch updates the CI to use the `ubuntu-latest` image. In addition, this patch changes the OCaml compiler used for testing to 5.3.0 and upgrades the version of `ocaml/setup-ocaml` to version 3, which contains several fixes for the OCaml 5.3 toolchain. I have also disabled ocamlformat as the version we were using is incompatible with OCaml 5.3 and adopting a new version required reformatting the lens files.
1 parent c7a899c commit af82f6b

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

.github/workflows/default.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os:
18-
- ubuntu-20.04
18+
- ubuntu-latest
1919
ocaml-compiler:
20-
- 5.1.1
20+
- 5.3.0
2121

2222
runs-on: ${{ matrix.os }}
2323

@@ -29,12 +29,10 @@ jobs:
2929
shell: bash
3030

3131
- name: Use OCaml ${{ matrix.ocaml-compiler }}
32-
uses: ocaml/setup-ocaml@v2
32+
uses: ocaml/setup-ocaml@v3
3333
with:
3434
ocaml-compiler: ${{ matrix.ocaml-compiler }}
3535

36-
- run: opam install -y ocamlformat.0.25.1
37-
3836
- name: Ad-hoc rule check
3937
run: |
4038
eval $(opam config env)
@@ -46,7 +44,7 @@ jobs:
4644
fail-fast: false
4745
matrix:
4846
os:
49-
- ubuntu-20.04
47+
- ubuntu-latest
5048

5149
runs-on: ${{ matrix.os }}
5250

@@ -69,9 +67,9 @@ jobs:
6967
fail-fast: false
7068
matrix:
7169
os:
72-
- ubuntu-20.04
70+
- ubuntu-latest
7371
ocaml-compiler:
74-
- 5.1.1
72+
- 5.3.0
7573

7674
runs-on: ${{ matrix.os }}
7775

@@ -80,7 +78,7 @@ jobs:
8078
uses: actions/checkout@v2
8179

8280
- name: Use OCaml ${{ matrix.ocaml-compiler }}
83-
uses: ocaml/setup-ocaml@v2
81+
uses: ocaml/setup-ocaml@v3
8482
with:
8583
ocaml-compiler: ${{ matrix.ocaml-compiler }}
8684

@@ -110,9 +108,9 @@ jobs:
110108
fail-fast: false
111109
matrix:
112110
os:
113-
- ubuntu-20.04
111+
- ubuntu-latest
114112
ocaml-compiler:
115-
- 5.1.1
113+
- 5.3.0
116114

117115
runs-on: ${{ matrix.os }}
118116

@@ -149,7 +147,7 @@ jobs:
149147
shell: bash
150148

151149
- name: Use OCaml ${{ matrix.ocaml-compiler }}
152-
uses: ocaml/setup-ocaml@v2
150+
uses: ocaml/setup-ocaml@v3
153151
with:
154152
ocaml-compiler: ${{ matrix.ocaml-compiler }}
155153

@@ -198,9 +196,9 @@ jobs:
198196
fail-fast: false
199197
matrix:
200198
os:
201-
- ubuntu-20.04
199+
- ubuntu-latest
202200
ocaml-compiler:
203-
- 5.1.1
201+
- 5.3.0
204202

205203
runs-on: ${{ matrix.os }}
206204

@@ -236,7 +234,7 @@ jobs:
236234
shell: bash
237235

238236
- name: Use OCaml ${{ matrix.ocaml-compiler }}
239-
uses: ocaml/setup-ocaml@v2
237+
uses: ocaml/setup-ocaml@v3
240238
with:
241239
ocaml-compiler: ${{ matrix.ocaml-compiler }}
242240

core/irCheck.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,11 +1053,11 @@ struct
10531053
(* For each case branch, the corresponding entry goes directly into the field spec map of the inner effect row *)
10541054
let inner_effects_map_from_branches = StringMap.map (fun x -> Present x) branch_presence_spec_types in
10551055
(* We now add all entries from the outer effects that were not touched by the handler to the inner effects *)
1056-
let inner_effects_map = StringMap.fold (fun effect outer_presence_spec map ->
1057-
if StringMap.mem effect inner_effects_map_from_branches then
1056+
let inner_effects_map = StringMap.fold (fun effect_ outer_presence_spec map ->
1057+
if StringMap.mem effect_ inner_effects_map_from_branches then
10581058
map
10591059
else
1060-
StringMap.add effect outer_presence_spec map
1060+
StringMap.add effect_ outer_presence_spec map
10611061
) inner_effects_map_from_branches outer_effects_map in
10621062
let inner_effects = Row (inner_effects_map, outer_effects_var, outer_effects_dualized) in
10631063

dune-project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
(name links)
3232
(synopsis "The Links Programming Language")
3333
(description "Links is a functional programming language designed to make web programming easier.")
34-
(depends (ocaml (>= : 5.1.1))
35-
(dune-configurator (>= : 3.8))
34+
(depends (ocaml (>= 5.1.1))
35+
(dune-configurator (>= 3.8))
3636
ppx_deriving
3737
(ppx_deriving_yojson (>= 3.3))
3838
base64

links.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ doc: "https://links-lang.org/quick-help.html"
2323
bug-reports: "https://github.com/links-lang/links/issues"
2424
depends: [
2525
"dune" {>= "2.7"}
26-
"ocaml" { >= "5.1.0"}
27-
"dune-configurator" { >= "3.8"}
26+
"ocaml" {>= "5.1.1"}
27+
"dune-configurator" {>= "3.8"}
2828
"ppx_deriving"
2929
"ppx_deriving_yojson" {>= "3.3"}
3030
"base64"

tools/rule-check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66

77
RULEDIR="tools/rules"
8-
BLACKLIST=("")
8+
BLACKLIST=("ocamlformat_check.sh")
99

1010
function is_blacklisted () {
1111
local target="$1"

0 commit comments

Comments
 (0)