Skip to content

Commit 82338f4

Browse files
committed
chore: bump OCaml version 5.3 -> 5.4
Signed-off-by: Ali Caglayan <[email protected]>
1 parent 78236e0 commit 82338f4

File tree

25 files changed

+140
-115
lines changed

25 files changed

+140
-115
lines changed

.github/workflows/workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,22 @@ jobs:
168168
os: ubuntu-latest
169169
# OCaml 5:
170170
## ubuntu (x86)
171-
- ocaml-compiler: 5.3.x
171+
- ocaml-compiler: 5.4.x
172172
os: ubuntu-latest
173173
run_tests: true
174174
## macos (Apple Silicon)
175-
- ocaml-compiler: 5.3.x
175+
- ocaml-compiler: 5.4.x
176176
os: macos-latest
177177
run_tests: true
178178
## macos (x86)
179179
- ocaml-compiler: 5.4.x
180180
os: macos-15-intel
181181
## MSVC
182-
- ocaml-compiler: ocaml-compiler.5.3.0,system-msvc
182+
- ocaml-compiler: ocaml-compiler.5.4.0,system-msvc
183183
os: windows-latest
184184
run_tests: true
185185
## mingw
186-
- ocaml-compiler: ocaml-base-compiler.5.3.0,system-mingw
186+
- ocaml-compiler: ocaml-base-compiler.5.4.0,system-mingw
187187
os: windows-latest
188188
run_tests: true
189189
# OCaml 4:

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DEV_DEPS := \
1212
core_bench \
1313
patdiff
1414

15-
TEST_OCAMLVERSION := 5.3.0
15+
TEST_OCAMLVERSION := 5.4.0
1616
# When updating this version, don't forget to also bump the number in the docs.
1717

1818
-include Makefile.dev
@@ -109,9 +109,6 @@ test-melange: $(BIN)
109109
test-all: $(BIN)
110110
$(BIN) build @runtest @runtest-js @runtest-coq @runtest-melange
111111

112-
test-all-sans-melange: $(BIN)
113-
$(BIN) build @runtest @runtest-js @runtest-coq
114-
115112
test-ox: $(BIN)
116113
$(BIN) runtest test/blackbox-tests/test-cases/oxcaml
117114

doc/hacking.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ Here are the most common commands you'll be running:
5454
$ ./dune.exe build @foo
5555
5656
57-
Note that tests are currently written for version 5.3.0 of the OCaml compiler.
57+
Note that tests are currently written for version 5.4.0 of the OCaml compiler.
5858
Some tests depend on the specific wording of compilation errors which can change
5959
between compiler versions, so to reliably run the tests make sure that
60-
``ocaml.5.3.0`` is installed. The ``TEST_OCAMLVERSION`` in the ``Makefile`` at
60+
``ocaml.5.4.0`` is installed. The ``TEST_OCAMLVERSION`` in the ``Makefile`` at
6161
the root of the Dune repo contains the current compiler version for which tests
6262
are written.
6363

doc/tutorials/developing-with-dune/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Let's create a local switch: `cd` to this directory and run the following comman
4444
This can take a few minutes.
4545

4646
```sh
47-
opam switch create ./ 5.3.0
47+
opam switch create ./ 5.4.0
4848
```
4949

5050
This command has created a directory named `_opam` in the current directory.

dune.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ depends: [
5959
"ppx_expect" { with-dev-setup & >= "v0.17" & os != "win32" }
6060
"spawn" { with-dev-setup }
6161
"ppx_inline_test" { with-dev-setup & os != "win32" }
62-
"ppxlib" { with-dev-setup & >= "0.35.0" & os != "win32" }
62+
"ppxlib" { with-dev-setup & >= "0.37.0" & os != "win32" }
6363
"ctypes" { with-dev-setup & os != "win32" }
6464
"utop" { with-dev-setup & >= "2.6.0" & os != "win32" }
6565
"melange" { with-dev-setup & >= "5.1.0-51" & os != "win32" }

dune.opam.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ depends: [
2020
"ppx_expect" { with-dev-setup & >= "v0.17" & os != "win32" }
2121
"spawn" { with-dev-setup }
2222
"ppx_inline_test" { with-dev-setup & os != "win32" }
23-
"ppxlib" { with-dev-setup & >= "0.35.0" & os != "win32" }
23+
"ppxlib" { with-dev-setup & >= "0.37.0" & os != "win32" }
2424
"ctypes" { with-dev-setup & os != "win32" }
2525
"utop" { with-dev-setup & >= "2.6.0" & os != "win32" }
2626
"melange" { with-dev-setup & >= "5.1.0-51" & os != "win32" }

flake.lock

Lines changed: 36 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
inputs = {
33
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
4+
nixpkgs-old.url = "github:nixos/nixpkgs/7f50d4b33363d3948543f6a02b90a2c66852a453";
45
flake-utils.url = "github:numtide/flake-utils";
56
melange = {
6-
url = "github:melange-re/melange/refs/tags/5.1.0-53";
7+
url = "github:melange-re/melange/df569256baa6e90a5d70c9edf8b405add948df01";
78
inputs.nixpkgs.follows = "nixpkgs";
89
};
910
ocaml-overlays = {
@@ -24,6 +25,7 @@
2425
self,
2526
flake-utils,
2627
nixpkgs,
28+
nixpkgs-old,
2729
melange,
2830
ocaml-overlays,
2931
oxcaml,
@@ -35,7 +37,7 @@
3537
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
3638
ocaml-overlays.overlays.default
3739
(self: super: {
38-
ocamlPackages = super.ocaml-ng.ocamlPackages_5_3.overrideScope (
40+
ocamlPackages = super.ocaml-ng.ocamlPackages_5_4.overrideScope (
3941
oself: osuper: {
4042
mdx = osuper.mdx.override {
4143
logs = oself.logs;
@@ -63,8 +65,13 @@
6365
oxcamlOpamRepo = oxcaml-opam-repository;
6466
};
6567

68+
# Older nixpkgs for OCaml 4.02 support
69+
pkgs-old = nixpkgs-old.legacyPackages.${system}.appendOverlays [
70+
ocaml-overlays.overlays.default
71+
];
72+
6673
dune-static-overlay = self: super: {
67-
ocamlPackages = super.ocaml-ng.ocamlPackages_5_3.overrideScope (
74+
ocamlPackages = super.ocaml-ng.ocamlPackages_5_4.overrideScope (
6875
oself: osuper: {
6976
dune_3 = osuper.dune_3.overrideAttrs (a: {
7077
src = ./.;
@@ -93,19 +100,16 @@
93100

94101
ocamlformat =
95102
let
96-
ocamlformat_version =
97-
let
98-
lists = pkgs.lib.lists;
99-
strings = pkgs.lib.strings;
100-
ocamlformat_config = strings.splitString "\n" (builtins.readFile ./.ocamlformat);
101-
prefix = "version=";
102-
ocamlformat_version_pred = line: strings.hasPrefix prefix line;
103-
version_line = lists.findFirst ocamlformat_version_pred "not_found" ocamlformat_config;
104-
version = strings.removePrefix prefix version_line;
105-
in
106-
builtins.replaceStrings [ "." ] [ "_" ] version;
103+
lists = pkgs.lib.lists;
104+
strings = pkgs.lib.strings;
105+
ocamlformat_config = strings.splitString "\n" (builtins.readFile ./.ocamlformat);
106+
prefix = "version=";
107+
ocamlformat_version_pred = line: strings.hasPrefix prefix line;
108+
version_line = lists.findFirst ocamlformat_version_pred "not_found" ocamlformat_config;
109+
version_string = strings.removePrefix prefix version_line;
110+
ocamlformat_attr = builtins.replaceStrings [ "." ] [ "_" ] version_string;
107111
in
108-
builtins.getAttr ("ocamlformat_" + ocamlformat_version) pkgs;
112+
builtins.getAttr ("ocamlformat_" + ocamlformat_attr) nixpkgs.legacyPackages.${system};
109113

110114
testBuildInputs =
111115
with pkgs;
@@ -288,11 +292,11 @@
288292
fmt = pkgs.mkShell {
289293
inherit INSIDE_NIX;
290294
nativeBuildInputs = [ ocamlformat ];
291-
# re shouldn't be needed. this is an issue with the fmt rules
292295
inputsFrom = [
293296
pkgs.dune_3
294297
];
295298
buildInputs = with pkgs.ocamlPackages; [
299+
# re shouldn't be needed. this is an issue with the fmt rules
296300
re
297301
spawn
298302
uutf
@@ -352,9 +356,9 @@
352356

353357
bootstrap-check = pkgs.mkShell {
354358
inherit INSIDE_NIX;
355-
buildInputs = with pkgs; [
356-
gnumake
357-
ocaml-ng.ocamlPackages_4_02.ocaml
359+
buildInputs = [
360+
pkgs.gnumake
361+
pkgs-old.ocaml-ng.ocamlPackages_4_02.ocaml
358362
];
359363
meta.description = ''
360364
Provides a minimal shell environment with OCaml 4.02 in order
@@ -364,9 +368,9 @@
364368

365369
bootstrap-check_4_08 = pkgs.mkShell {
366370
inherit INSIDE_NIX;
367-
buildInputs = with pkgs; [
368-
gnumake
369-
ocaml-ng.ocamlPackages_4_08.ocaml
371+
buildInputs = [
372+
pkgs.gnumake
373+
pkgs-old.ocaml-ng.ocamlPackages_4_08.ocaml
370374
];
371375
meta.description = ''
372376
Provides a minimal shell environment with OCaml 4.08 in order

test/blackbox-tests/test-cases/hidden-deps-supported.t/run.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Test transitive deps can not be directly accessed, both for compiler versions su
4949
> EOF
5050
5151
$ dune build ./runf.exe 2>&1 | grep -v ocamlc
52-
File "runf.ml", line 1, characters 16-21:
52+
File "runf.ml", line 1, characters 16-19:
5353
1 | let _ = Bar.y + Foo.v
54-
^^^^^
54+
^^^
5555
Error: Unbound module Foo

test/blackbox-tests/test-cases/include-qualified/invalid-deps/toplevel-lib-interface.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ We should forbid lib interfaces modules from depending on themselves:
1717
$ touch bar.ml
1818

1919
$ dune build @check
20-
File "foo.ml", line 1, characters 9-14:
20+
File "foo.ml", line 1, characters 9-12:
2121
1 | let () = Foo.f ()
22-
^^^^^
22+
^^^
2323
Error: Unbound module Foo
2424
[1]

0 commit comments

Comments
 (0)