Skip to content

Commit

Permalink
GHA: Add OCaml 5.3 to the build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Oct 10, 2024
1 parent e563a67 commit eab7333
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/main/ocaml-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ esac

FLEXDLL_VERSION=0.43

curl -sLO "https://github.com/ocaml/ocaml/archive/refs/tags/${OCAML_VERSION}.tar.gz"
curl -sLO "https://github.com/ocaml/ocaml/archive/${OCAML_VERSION}.tar.gz"
if [[ $PLATFORM = 'Windows' ]] ; then
curl -sLO "https://github.com/ocaml/flexdll/archive/refs/tags/$FLEXDLL_VERSION.tar.gz"
fi
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
open Lib

let latest_ocaml4 = "4.14.2"
let latest_ocaml5 = "5.2.0" (* Add this number to ocamls below when the next version comes out *)
let latest_ocaml5 = "5.3" (* Add this number to ocamls below when the next version comes out *)
let ocamls = [
(* Fully supported versions *)
"4.08.1"; "4.09.1"; "4.10.2"; "4.11.2"; "4.12.1"; "4.13.1";
"5.0.0"; "5.1.1";
"5.0.0"; "5.1.1"; "5.2.0";

(* The last elements of the list after 4.14 will be used as default versions *)
latest_ocaml4; latest_ocaml5;
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
let end_workflow ~oc:_ ~workflow:_ = ()

let ocamls =
List.map (fun v -> Scanf.sscanf v "%u.%u.%u" (fun major minor _ -> ((major, minor), v))) ocamls
List.map (fun v -> Scanf.sscanf v "%u.%u" (fun major minor -> ((major, minor), v))) ocamls

let platform_ocaml_matrix ?(dir=List.drop_while) ~fail_fast start_version =
(fail_fast,
Expand Down Expand Up @@ -312,8 +312,9 @@ let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~w
"x86_64-pc-windows"
] in
let ocaml5 = [
"x86_64-pc-cygwin";
"x86_64-w64-mingw32";
(* "x86_64-pc-windows"; 5.3 needed *)
"x86_64-pc-windows";
] in
let matrix_elem ocamlv hosts =
let elem ocaml host =
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ let find_need need = Hashtbl.find jobs need
let emit_runs_on ~oc runs_on =
let runner_of_platform (type a) (platform : a platform) =
match platform with
| Windows -> "windows-2019"
| Windows -> "windows-2022"
| MacOS
| Linux as platform -> os_name_of_platform platform ^ "-latest"
| Specific (platform, version) -> os_name_of_platform platform ^ "-" ^ version
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
run: bash -exu .github/scripts/main/archives-cache.sh

Cygwin:
runs-on: windows-2019
runs-on: windows-2022
needs: Analyse
steps:
- name: Cygwin64 Cache
Expand All @@ -106,7 +106,7 @@ jobs:
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 4.14.2, 5.2.0 ]
ocamlv: [ 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.1, 4.13.1, 5.0.0, 5.1.1, 5.2.0, 4.14.2, 5.3 ]
fail-fast: true
steps:
- name: Install bubblewrap
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
run: bash -exu .github/scripts/main/test.sh

Build-Windows:
runs-on: windows-2019
runs-on: windows-2022
needs: [ Analyse, Cygwin ]
strategy:
matrix:
Expand All @@ -157,9 +157,15 @@ jobs:
- host: x86_64-pc-windows
build: x86_64-pc-cygwin
ocamlv: 4.14.2
- host: x86_64-pc-cygwin
build: x86_64-pc-cygwin
ocamlv: 5.3
- host: x86_64-w64-mingw32
build: x86_64-pc-cygwin
ocamlv: 5.2.0
ocamlv: 5.3
- host: x86_64-pc-windows
build: x86_64-pc-cygwin
ocamlv: 5.3
fail-fast: false
defaults:
run:
Expand Down Expand Up @@ -242,7 +248,7 @@ jobs:
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.14.2, 5.2.0 ]
ocamlv: [ 4.14.2, 5.3 ]
fail-fast: true
steps:
- name: Checkout tree
Expand Down Expand Up @@ -278,7 +284,7 @@ jobs:
needs: [ Analyse, Build-Linux ]
strategy:
matrix:
ocamlv: [ 4.14.2, 5.2.0 ]
ocamlv: [ 4.14.2, 5.3 ]
fail-fast: false
env:
OPAM_TEST: 1
Expand Down Expand Up @@ -332,7 +338,7 @@ jobs:
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.14.2, 5.2.0 ]
ocamlv: [ 4.14.2, 5.3 ]
fail-fast: false
env:
OPAM_TEST: 1
Expand Down Expand Up @@ -419,7 +425,7 @@ jobs:
strategy:
matrix:
solver: [ z3, 0install ]
ocamlv: [ 4.14.2, 5.2.0 ]
ocamlv: [ 4.14.2, 5.3 ]
fail-fast: false
env:
SOLVER: ${{ matrix.solver }}
Expand Down Expand Up @@ -467,7 +473,7 @@ jobs:
strategy:
matrix:
solver: [ z3, 0install ]
ocamlv: [ 4.14.2, 5.2.0 ]
ocamlv: [ 4.14.2, 5.3 ]
fail-fast: false
env:
SOLVER: ${{ matrix.solver }}
Expand Down Expand Up @@ -515,7 +521,7 @@ jobs:
needs: [ Analyse, Build-Linux ]
strategy:
matrix:
ocamlv: [ 4.14.2, 5.2.0 ]
ocamlv: [ 4.14.2, 5.3 ]
fail-fast: false
steps:
- name: Install bubblewrap
Expand Down Expand Up @@ -548,7 +554,7 @@ jobs:
needs: [ Analyse, Build-macOS ]
strategy:
matrix:
ocamlv: [ 4.14.2, 5.2.0 ]
ocamlv: [ 4.14.2, 5.3 ]
fail-fast: false
steps:
- name: Checkout tree
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ users)
* Add OCaml 5.2.0 to the build matrix [#6216 @kit-ty-kate]
* Allow to have more than one OCaml default version to run all jobs and add 5.2 to the list of default versions together with 4.14 [#6216 @kit-ty-kate]
* Bump 4.14 to the latest patch version (4.14.2) [#6216 @kit-ty-kate]
* Add OCaml 5.3 to the build matrix [#6189 @kit-ty-kate]

## Doc
* Update the command to install opam to point to the new simplified url on opam.ocaml.org [#6226 @kit-ty-kate]
Expand Down
12 changes: 12 additions & 0 deletions src_ext/patches/mccs/ocaml-5.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Naur a/src/context_flags.ml b/src/context_flags.ml
--- a/src/context_flags.ml 2024-08-21 13:03:37.000000000 +0000
+++ b/src/context_flags.ml 2024-09-05 14:57:29.242019552 +0000
@@ -23,7 +23,7 @@
let flags =
(if (Sys.win32 && Config.ccomp_type = "msvc")
then ["\"/EHsc\""]
- else ["-Wall -Wextra -Wno-unused-parameter -x c++"]) @
+ else ["-Wall -Wextra -Wno-unused-parameter -x c++ -std=c++11"]) @
(ifc useGLPK ["-DUSEGLPK"]) @
(ifc useCOIN ["-DUSECOIN"]) @
(ifc useCLP ["-DUSECLP"]) @

0 comments on commit eab7333

Please sign in to comment.