Skip to content

Commit

Permalink
Avoid OCaml 5.0 on CentOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Jan 18, 2024
1 parent fbd4eb4 commit 6f84815
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/scripts/depexts/generate-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6f84815

Please sign in to comment.