From ebd009192d6b251925d7a2445e3dca6f1f01bd39 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Thu, 25 Jul 2024 15:21:27 +0200 Subject: [PATCH] feat: complete porting to OCaml 5.1 and jsoo 5.8 --- .github/workflows/opam-publish.yml | 2 +- Dockerfile | 6 +++--- Dockerfile.test-client | 4 ++-- Dockerfile.test-server | 6 +++--- scripts/static-build.sh | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/opam-publish.yml b/.github/workflows/opam-publish.yml index 293920990..ddb58bcae 100644 --- a/.github/workflows/opam-publish.yml +++ b/.github/workflows/opam-publish.yml @@ -73,7 +73,7 @@ jobs: uses: avsm/setup-ocaml@v1 # TODO: Keep up-to-date! with: - ocaml-version: 4.12.0 + ocaml-version: 5.1.1 - name: Install opam-publish run: | opam install -y -j 2 "opam-publish>=2.3.0" diff --git a/Dockerfile b/Dockerfile index 270f8a15c..347320a65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ocaml/opam:alpine-3.13-ocaml-4.12 as compilation +FROM ocaml/opam:alpine-3.20-ocaml-5.1 as compilation LABEL Description="learn-ocaml building" Vendor="OCamlPro" WORKDIR /home/opam/learn-ocaml @@ -9,7 +9,7 @@ RUN sudo chown -R opam:nogroup . ENV OPAMYES true RUN echo 'archive-mirrors: [ "https://opam.ocaml.org/cache" ]' >> ~/.opam/config \ && opam repository set-url default http://opam.ocaml.org \ - && opam switch 4.12 \ + && opam switch 5.1 \ && echo 'pre-session-commands: [ "sudo" "apk" "add" depexts ]' >> ~/.opam/config \ && opam install . --deps-only --locked @@ -61,7 +61,7 @@ EXPOSE 8443 USER learn-ocaml WORKDIR /home/learn-ocaml -ARG opam_switch="/home/opam/.opam/4.12" +ARG opam_switch="/home/opam/.opam/5.1" COPY --from=compilation /home/opam/install-prefix /usr COPY --from=compilation "$opam_switch/bin"/ocaml* "$opam_switch/bin/" diff --git a/Dockerfile.test-client b/Dockerfile.test-client index d3ac9139a..644409ff6 100644 --- a/Dockerfile.test-client +++ b/Dockerfile.test-client @@ -1,7 +1,7 @@ # This Dockerfile is useful for testing purposes # to ensure learn-ocaml-client can be built alone from learn-ocaml-client.opam -FROM ocaml/opam:alpine-3.13-ocaml-4.12 as compilation +FROM ocaml/opam:alpine-3.20-ocaml-5.1 as compilation LABEL Description="learn-ocaml building" Vendor="OCamlPro" WORKDIR /home/opam/learn-ocaml @@ -13,7 +13,7 @@ RUN sudo chown -R opam:nogroup . ENV OPAMYES true RUN echo 'archive-mirrors: [ "https://opam.ocaml.org/cache" ]' >> ~/.opam/config \ && opam repository set-url default http://opam.ocaml.org \ - && opam switch 4.12 \ + && opam switch 5.1 \ && echo 'pre-session-commands: [ "sudo" "apk" "add" depexts ]' >> ~/.opam/config \ && opam pin add -n -y -k path learn-ocaml-client . \ && opam install learn-ocaml-client --deps-only diff --git a/Dockerfile.test-server b/Dockerfile.test-server index 063b1d559..089daa819 100644 --- a/Dockerfile.test-server +++ b/Dockerfile.test-server @@ -1,7 +1,7 @@ # This Dockerfile is useful for testing purposes # to ensure learn-ocaml can be built alone from learn-ocaml.opam -FROM ocaml/opam:alpine-3.13-ocaml-4.12 as compilation +FROM ocaml/opam:alpine-3.20-ocaml-5.1 as compilation LABEL Description="learn-ocaml building" Vendor="OCamlPro" WORKDIR /home/opam/learn-ocaml @@ -13,7 +13,7 @@ RUN sudo chown -R opam:nogroup . ENV OPAMYES true RUN echo 'archive-mirrors: [ "https://opam.ocaml.org/cache" ]' >> ~/.opam/config \ && opam repository set-url default http://opam.ocaml.org \ - && opam switch 4.12 \ + && opam switch 5.1 \ && echo 'pre-session-commands: [ "sudo" "apk" "add" depexts ]' >> ~/.opam/config \ && opam pin add -n -y -k path learn-ocaml . \ && opam install learn-ocaml --deps-only @@ -67,7 +67,7 @@ EXPOSE 8443 USER learn-ocaml WORKDIR /home/learn-ocaml -ARG opam_switch="/home/opam/.opam/4.12" +ARG opam_switch="/home/opam/.opam/5.1" COPY --from=compilation /home/opam/install-prefix /usr COPY --from=compilation "$opam_switch/bin"/ocaml* "$opam_switch/bin/" diff --git a/scripts/static-build.sh b/scripts/static-build.sh index f854d6b17..939a9feb6 100755 --- a/scripts/static-build.sh +++ b/scripts/static-build.sh @@ -10,7 +10,7 @@ cd $(dirname "$0")/.. set -o pipefail git ls-files -z | xargs -0 tar c | \ docker run --rm -i \ - ocamlpro/ocaml:4.12 \ + ocamlpro/ocaml:5.1 \ sh -uexc \ 'tar x >&2 && sudo apk add openssl-libs-static bash >&2 &&