Skip to content
Snippets Groups Projects
Verified Commit 8dcfea34 authored by Olivier Benz's avatar Olivier Benz
Browse files

Rebuild GHC version 9.8.1

- Use GHC 9.6.4 for bootstrapping
- Update base image to alpine:3.19
parent 2839c1f2
No related branches found
No related tags found
No related merge requests found
Pipeline #25800 passed
.env: .env:
variables: variables:
GHC_VERSION: "9.6.4" GHC_VERSION: "9.8.1"
CABAL_VERSION: "3.10.1.0" CABAL_VERSION: "3.10.2.1"
STACK_VERSION: "2.13.1" STACK_VERSION: "2.13.1"
HLS_VERSION: "2.5.0.0" HLS_VERSION: "2.5.0.0"
BUILD_GHC: "true" BUILD_GHC: "true"
......
...@@ -5,13 +5,7 @@ ARG STACK_VERSION ...@@ -5,13 +5,7 @@ ARG STACK_VERSION
ARG GHC_VERSION_BUILD=${GHC_VERSION} ARG GHC_VERSION_BUILD=${GHC_VERSION}
ARG CABAL_VERSION_BUILD=${CABAL_VERSION} ARG CABAL_VERSION_BUILD=${CABAL_VERSION}
FROM glcr.b-data.ch/ghc/ghc-musl:9.6.3 as bootstrap FROM glcr.b-data.ch/ghc/ghc-musl:9.6.4 as bootstrap
ARG GHC_VERSION_BUILD
ARG CABAL_VERSION_BUILD
ENV GHC_VERSION=${GHC_VERSION_BUILD} \
CABAL_VERSION=${CABAL_VERSION_BUILD}
RUN apk upgrade --no-cache \ RUN apk upgrade --no-cache \
&& apk add --no-cache \ && apk add --no-cache \
...@@ -32,6 +26,12 @@ RUN apk upgrade --no-cache \ ...@@ -32,6 +26,12 @@ RUN apk upgrade --no-cache \
xz \ xz \
zlib-dev zlib-dev
FROM bootstrap as bootstrap-ghc
ARG GHC_VERSION_BUILD
ENV GHC_VERSION=${GHC_VERSION_BUILD}
RUN cd /tmp \ RUN cd /tmp \
&& curl -sSLO https://downloads.haskell.org/~ghc/"$GHC_VERSION"/ghc-"$GHC_VERSION"-src.tar.xz \ && curl -sSLO https://downloads.haskell.org/~ghc/"$GHC_VERSION"/ghc-"$GHC_VERSION"-src.tar.xz \
&& curl -sSLO https://downloads.haskell.org/~ghc/"$GHC_VERSION"/ghc-"$GHC_VERSION"-src.tar.xz.sig \ && curl -sSLO https://downloads.haskell.org/~ghc/"$GHC_VERSION"/ghc-"$GHC_VERSION"-src.tar.xz.sig \
...@@ -58,12 +58,16 @@ RUN cd /tmp \ ...@@ -58,12 +58,16 @@ RUN cd /tmp \
FROM bootstrap as bootstrap-cabal FROM bootstrap as bootstrap-cabal
ARG CABAL_VERSION_BUILD
ENV CABAL_VERSION=${CABAL_VERSION_BUILD}
## Build Cabal (the tool) with the GHC bootstrap version ## Build Cabal (the tool) with the GHC bootstrap version
RUN cabal update \ RUN cabal update \
## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history ## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
&& cabal install --allow-newer --constraint 'Cabal-syntax<3.11' "cabal-install-$CABAL_VERSION" && cabal install "cabal-install-$CABAL_VERSION"
FROM alpine:3.18 as ghc-stage1 FROM alpine:3.19 as ghc-stage1
LABEL org.opencontainers.image.licenses="MIT" \ LABEL org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \ org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \
...@@ -112,16 +116,9 @@ RUN apk add --no-cache \ ...@@ -112,16 +116,9 @@ RUN apk add --no-cache \
zlib-dev \ zlib-dev \
zlib-static zlib-static
COPY --from=bootstrap /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/ COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
RUN cd /tmp \ RUN cd /tmp \
## Fix https://github.com/haskell/cabal/issues/8923
&& PKG_CONFIG_VERSION="$(pkg-config --version)" \
&& if [ "${PKG_CONFIG_VERSION%.*}" = "1.9" ]; then \
## Downgrade pkgconf from 1.9.x to 1.8.1
curl -sSLO http://dl-cdn.alpinelinux.org/alpine/v3.16/main/"$(uname -m)"/pkgconf-1.8.1-r0.apk; \
apk add --no-cache pkgconf-1.8.1-r0.apk; \
fi \
## Install GHC ## Install GHC
&& tar -xJf ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz \ && tar -xJf ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz \
&& cd ghc-"$GHC_VERSION"-*-alpine-linux \ && cd ghc-"$GHC_VERSION"-*-alpine-linux \
...@@ -144,7 +141,7 @@ COPY --from=bootstrap-cabal /root/.local/bin/cabal /usr/local/bin/cabal ...@@ -144,7 +141,7 @@ COPY --from=bootstrap-cabal /root/.local/bin/cabal /usr/local/bin/cabal
## Rebuild Cabal (the tool) with the GHC target version ## Rebuild Cabal (the tool) with the GHC target version
RUN cabal update \ RUN cabal update \
&& cabal install --allow-newer --constraint 'Cabal-syntax<3.11' "cabal-install-$CABAL_VERSION" && cabal install "cabal-install-$CABAL_VERSION"
FROM ghc-stage1 as test FROM ghc-stage1 as test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment