Skip to content

Commit

Permalink
GHA: Use both 4.14 and 5.3 as default version, remove i686 from the b…
Browse files Browse the repository at this point in the history
…uild matrix and add 5.2
  • Loading branch information
kit-ty-kate committed Sep 5, 2024
1 parent f9c7df9 commit 05ae806
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 18 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
11 changes: 7 additions & 4 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ open Lib

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"; "4.14.1";
"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.1"; "5.3"; (* The last elements of the list after 4.14 be
used as default versions *)
]

(* Entry point for the workflow. Workflows are specified as continuations where
Expand Down Expand Up @@ -63,9 +66,9 @@ 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 latest_ocaml = List.fold_left (fun _ (v, _) -> v) (0, 0) ocamls
let latest_ocaml = (4, 14)

let platform_ocaml_matrix ?(dir=List.drop_while) ~fail_fast start_version =
(fail_fast,
Expand Down Expand Up @@ -299,7 +302,7 @@ let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~w
let (_fail_fast, matrix, _) = platform_ocaml_matrix ~fail_fast:true start_version in
let (matrix, includes) =
if platform = Windows then
(("host", ["x86_64-pc-cygwin"; "i686-w64-mingw32"; "x86_64-w64-mingw32"; "i686-pc-windows"; "x86_64-pc-windows"]) ::
(("host", ["x86_64-pc-cygwin"; "x86_64-w64-mingw32"; "x86_64-pc-windows"]) ::
("build", ["x86_64-pc-cygwin"]) ::
matrix, [])
else
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
24 changes: 12 additions & 12 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.1 ]
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.1, 5.3 ]
fail-fast: true
steps:
- name: Install bubblewrap
Expand Down Expand Up @@ -137,13 +137,13 @@ jobs:
run: bash -exu .github/scripts/main/test.sh

Build-Windows:
runs-on: windows-2019
runs-on: windows-2022
needs: [ Analyse, Cygwin ]
strategy:
matrix:
host: [ x86_64-pc-cygwin, i686-w64-mingw32, x86_64-w64-mingw32, i686-pc-windows, x86_64-pc-windows ]
host: [ x86_64-pc-cygwin, x86_64-w64-mingw32, x86_64-pc-windows ]
build: [ x86_64-pc-cygwin ]
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: false
defaults:
run:
Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: true
steps:
- name: Checkout tree
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
needs: [ Analyse, Build-Linux ]
strategy:
matrix:
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: false
env:
OPAM_TEST: 1
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
needs: Analyse
strategy:
matrix:
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: false
env:
OPAM_TEST: 1
Expand Down Expand Up @@ -403,7 +403,7 @@ jobs:
strategy:
matrix:
solver: [ z3, 0install ]
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: false
env:
SOLVER: ${{ matrix.solver }}
Expand Down Expand Up @@ -451,7 +451,7 @@ jobs:
strategy:
matrix:
solver: [ z3, 0install ]
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: false
env:
SOLVER: ${{ matrix.solver }}
Expand Down Expand Up @@ -499,7 +499,7 @@ jobs:
needs: [ Analyse, Build-Linux ]
strategy:
matrix:
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: false
steps:
- name: Install bubblewrap
Expand Down Expand Up @@ -532,7 +532,7 @@ jobs:
needs: [ Analyse, Build-macOS ]
strategy:
matrix:
ocamlv: [ 4.14.1 ]
ocamlv: [ 4.14.1, 5.3 ]
fail-fast: false
steps:
- name: Checkout tree
Expand Down
3 changes: 3 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ users)
* Update action checkout to v4 [#6081 @rjbou]
* Update action upload-artifact to v4 [#6081 @rjbou]
* preamble: Allow local git submodules (ignore CVE-2022-39253) [#6132 @kit-ty-kate]
* Use both 4.14 and 5.3 as default version [#6189 @kit-ty-kate]
* Add OCaml 5.2 to the build matrix [#6189 @kit-ty-kate]
* Remove Windows/i686 from the build matrix [#6189 @kit-ty-kate]

## Doc
* Remove the ppa from the installation instructions on Ubuntu [#5988 @kit-ty-kate - fix #5987]
Expand Down
26 changes: 26 additions & 0 deletions src_ext/patches/extlib/ocaml-5.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff -Naur a/src/extArray.mli b/src/extArray.mli
--- a/src/extArray.mli 2022-08-05 14:12:23.000000000 +0000
+++ b/src/extArray.mli 2024-09-04 20:51:58.170821498 +0000
@@ -112,7 +112,9 @@

(** These functions are reimplemented in extlib when they are missing from the stdlib *)

-#if OCAML >= 403
+#if OCAML >= 503
+ external create_float : int -> float array = "caml_array_create_float"
+#elif OCAML >= 403
external create_float : int -> float array = "caml_make_float_vect"
#else
val create_float : int -> float array
@@ -149,7 +151,11 @@
external length : 'a array -> int = "%array_length"
external get : 'a array -> int -> 'a = "%array_safe_get"
external set : 'a array -> int -> 'a -> unit = "%array_safe_set"
+#if OCAML >= 503
+ external make : int -> 'a -> 'a array = "caml_array_make"
+#else
external make : int -> 'a -> 'a array = "caml_make_vect"
+#endif
external create : int -> 'a -> 'a array = "caml_make_vect"
val init : int -> (int -> 'a) -> 'a array
val make_matrix : int -> int -> 'a -> 'a array array
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 05ae806

Please sign in to comment.