Skip to content

Commit b75ea82

Browse files
Alizteranmonteiro
authored andcommitted
chore: bump OCaml version 5.3 -> 5.4
Signed-off-by: Ali Caglayan <[email protected]>
1 parent b20ee74 commit b75ea82

File tree

25 files changed

+141
-115
lines changed

25 files changed

+141
-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
@@ -118,9 +118,6 @@ test-melange: $(BIN)
118118
test-all: $(BIN)
119119
$(BIN) build @runtest @runtest-js @runtest-coq @runtest-rocq @runtest-melange
120120

121-
test-all-sans-melange: $(BIN)
122-
$(BIN) build @runtest @runtest-js @runtest-coq @runtest-rocq
123-
124121
test-ox: $(BIN)
125122
$(BIN) runtest test/blackbox-tests/test-cases/oxcaml
126123

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: 37 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/refs/tags/6.0.0-54";
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 = ./.;
@@ -80,19 +87,16 @@
8087

8188
ocamlformat =
8289
let
83-
ocamlformat_version =
84-
let
85-
lists = pkgs.lib.lists;
86-
strings = pkgs.lib.strings;
87-
ocamlformat_config = strings.splitString "\n" (builtins.readFile ./.ocamlformat);
88-
prefix = "version=";
89-
ocamlformat_version_pred = line: strings.hasPrefix prefix line;
90-
version_line = lists.findFirst ocamlformat_version_pred "not_found" ocamlformat_config;
91-
version = strings.removePrefix prefix version_line;
92-
in
93-
builtins.replaceStrings [ "." ] [ "_" ] version;
90+
lists = pkgs.lib.lists;
91+
strings = pkgs.lib.strings;
92+
ocamlformat_config = strings.splitString "\n" (builtins.readFile ./.ocamlformat);
93+
prefix = "version=";
94+
ocamlformat_version_pred = line: strings.hasPrefix prefix line;
95+
version_line = lists.findFirst ocamlformat_version_pred "not_found" ocamlformat_config;
96+
version_string = strings.removePrefix prefix version_line;
97+
ocamlformat_attr = builtins.replaceStrings [ "." ] [ "_" ] version_string;
9498
in
95-
builtins.getAttr ("ocamlformat_" + ocamlformat_version) pkgs;
99+
builtins.getAttr ("ocamlformat_" + ocamlformat_attr) nixpkgs.legacyPackages.${system};
96100

97101
testBuildInputs =
98102
with pkgs;
@@ -274,13 +278,13 @@
274278
fmt = pkgs.mkShell {
275279
inherit INSIDE_NIX;
276280
nativeBuildInputs = [ ocamlformat ];
277-
# re shouldn't be needed. this is an issue with the fmt rules
278281
inputsFrom = [
279282
pkgs.dune_3
280283
];
281284
buildInputs = with pkgs.ocamlPackages; [
282285
csexp
283286
pp
287+
# re shouldn't be needed. this is an issue with the fmt rules
284288
re
285289
spawn
286290
uutf
@@ -342,9 +346,9 @@
342346

343347
bootstrap-check = pkgs.mkShell {
344348
inherit INSIDE_NIX;
345-
buildInputs = with pkgs; [
346-
gnumake
347-
ocaml-ng.ocamlPackages_4_02.ocaml
349+
buildInputs = [
350+
pkgs.gnumake
351+
pkgs-old.ocaml-ng.ocamlPackages_4_02.ocaml
348352
];
349353
meta.description = ''
350354
Provides a minimal shell environment with OCaml 4.02 in order
@@ -354,9 +358,9 @@
354358

355359
bootstrap-check_4_08 = pkgs.mkShell {
356360
inherit INSIDE_NIX;
357-
buildInputs = with pkgs; [
358-
gnumake
359-
ocaml-ng.ocamlPackages_4_08.ocaml
361+
buildInputs = [
362+
pkgs.gnumake
363+
pkgs-old.ocaml-ng.ocamlPackages_4_08.ocaml
360364
];
361365
meta.description = ''
362366
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)