From e72ca1f3bd5330980c286e901120a8ce6856aad3 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Thu, 4 Jan 2024 13:03:45 -0500 Subject: [PATCH] Dockerfiles: Consistently factor out GHCVER, CABALVER --- Dockerfile | 10 ++++++---- cryptol-remote-api/Dockerfile | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9fcb69d..d47d09d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:22.04 AS build +ARG GHCVER="9.2.8" +ARG CABALVER="3.10.1.0" RUN apt-get update && \ apt-get install -y \ # ghcup requirements @@ -24,15 +26,15 @@ RUN z3 --version ARG CRYPTOLPATH="/cryptol/.cryptol" ENV LANG=C.UTF-8 \ LC_ALL=C.UTF-8 -COPY cabal.GHC-9.2.8.config cabal.project.freeze +COPY cabal.GHC-${GHCVER}.config cabal.project.freeze RUN mkdir -p /home/cryptol/.local/bin && \ curl -L https://downloads.haskell.org/~ghcup/0.1.19.4/x86_64-linux-ghcup-0.1.19.4 -o /home/cryptol/.local/bin/ghcup && \ chmod +x /home/cryptol/.local/bin/ghcup RUN mkdir -p /home/cryptol/.ghcup && \ ghcup --version && \ - ghcup install cabal 3.10.1.0 && \ - ghcup install ghc 9.2.8 && \ - ghcup set ghc 9.2.8 + ghcup install cabal ${CABALVER} && \ + ghcup install ghc ${GHCVER} && \ + ghcup set ghc ${GHCVER} RUN cabal v2-update && \ cabal v2-build -j cryptol:exe:cryptol && \ cp $(cabal v2-exec which cryptol) rootfs/usr/local/bin && \ diff --git a/cryptol-remote-api/Dockerfile b/cryptol-remote-api/Dockerfile index 9bb414d4..758fdb6f 100644 --- a/cryptol-remote-api/Dockerfile +++ b/cryptol-remote-api/Dockerfile @@ -1,4 +1,5 @@ ARG GHCVER="9.2.8" +ARG CABALVER="3.10.1.0" ARG GHCVER_BOOTSTRAP="8.10.2" FROM ubuntu:22.04 AS toolchain ARG PORTABILITY=false @@ -18,7 +19,7 @@ ENV GHCUP_INSTALL_BASE_PREFIX=/opt \ PATH=/opt/.ghcup/bin:/root/.local/bin:$PATH RUN curl -o /usr/local/bin/ghcup "https://downloads.haskell.org/~ghcup/0.1.19.4/x86_64-linux-ghcup-0.1.19.4" && \ chmod +x /usr/local/bin/ghcup -RUN ghcup install cabal 3.10.1.0 --set +RUN ghcup install cabal ${CABALVER} --set ENV PATH=/root/.cabal/bin:$PATH ADD ./cryptol-remote-api/ghc-portability.patch . ARG GHCVER