diff --git a/.github/scripts/depexts/generate-actions.sh b/.github/scripts/depexts/generate-actions.sh index e2ae0b7b9fe..f7860296268 100644 --- a/.github/scripts/depexts/generate-actions.sh +++ b/.github/scripts/depexts/generate-actions.sh @@ -21,6 +21,8 @@ EOF mainlibs="m4 git rsync patch tar unzip bzip2 make wget" ocaml="ocaml ocaml-compiler-libs" +OCAML_CONSTRAINT='' + case "$target" in alpine) cat >$dir/Dockerfile << EOF @@ -37,6 +39,8 @@ RUN pacman -Syu --noconfirm $mainlibs $ocaml gcc diffutils EOF ;; centos) + # CentOS 7 doesn't support OCaml 5 (GCC is too old) + OCAML_CONSTRAINT=' & < "5.0"' cat >$dir/Dockerfile << EOF FROM centos:7 RUN yum install -y $mainlibs $ocaml @@ -120,7 +124,7 @@ set -eux git config --global --add safe.directory /github/workspace # For systems that don't have an up to date compiler, to avoid ocaml-secondary -echo 'default-invariant: [ "ocaml" {>= "4.09.0"} ]' > /opam/opamrc +echo 'default-invariant: [ "ocaml" {>= "4.09.0"$OCAML_CONSTRAINT} ]' > /opam/opamrc opam init --no-setup --disable-sandboxing --bare --config /opam/opamrc git+$OPAM_REPO#$OPAM_REPO_SHA echo 'archive-mirrors: "https://opam.ocaml.org/cache"' >> \$OPAMROOT/config opam switch create this-opam ocaml