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

Rebuild GHC version 9.6.2

- Use GHC 9.4.6 for bootstrapping
- Check Dockerfiles with hadolint. Ignored rules:
  - DL3003: Use WORKDIR to switch to a directory.
  - DL3018: Pin versions in apk add.
parent 1f52c67d
No related branches found
No related tags found
No related merge requests found
ignored:
- DL3003
- DL3018
ARG GHC_VERSION_BUILD
ARG CABAL_VERSION_BUILD
FROM glcr.b-data.ch/ghc/ghc-musl:9.4.5 as bootstrap
FROM glcr.b-data.ch/ghc/ghc-musl:9.4.6 as bootstrap
ARG GHC_VERSION_BUILD
ARG CABAL_VERSION_BUILD
......@@ -29,13 +29,13 @@ RUN apk upgrade --no-cache \
zlib-dev
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.sig \
&& 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 \
&& gpg --keyserver hkps://keyserver.ubuntu.com:443 \
--receive-keys FFEB7CE81E16A36B3E2DED6F2DE04D4E97DB64AD \
&& gpg --verify ghc-$GHC_VERSION-src.tar.xz.sig ghc-$GHC_VERSION-src.tar.xz \
&& tar xf ghc-$GHC_VERSION-src.tar.xz \
&& cd ghc-$GHC_VERSION \
&& gpg --verify "ghc-$GHC_VERSION-src.tar.xz.sig" "ghc-$GHC_VERSION-src.tar.xz" \
&& tar -xJf "ghc-$GHC_VERSION-src.tar.xz" \
&& cd "ghc-$GHC_VERSION" \
&& ./boot.source \
&& ./configure --disable-ld-override LD=ld.gold \
# Use the LLVM backend
......@@ -46,11 +46,11 @@ RUN cd /tmp \
&& sed -i -e 's/unknown-linux-gnu/alpine-linux/g' llvm-targets \
&& cabal update \
# See https://unix.stackexchange.com/questions/519092/what-is-the-logic-of-using-nproc-1-in-make-command
&& hadrian/build binary-dist -j$((`nproc`+1)) \
&& hadrian/build binary-dist -j"$(($(nproc)+1))" \
--flavour=perf+llvm+split_sections \
--docs=none \
# 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 --allow-newer --constraint 'Cabal-syntax<3.11' "cabal-install-$CABAL_VERSION"
FROM alpine:3.18 as builder
......@@ -98,12 +98,12 @@ RUN apk upgrade --no-cache \
zlib-dev \
zlib-static
COPY --from=bootstrap /tmp/ghc-$GHC_VERSION/_build/bindist/ghc-$GHC_VERSION-*-alpine-linux.tar.xz /tmp/
COPY --from=bootstrap /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
COPY --from=bootstrap /root/.cabal/bin/cabal /usr/bin/cabal
RUN cd /tmp \
&& tar -xJf ghc-$GHC_VERSION-*-alpine-linux.tar.xz \
&& cd ghc-$GHC_VERSION-*-alpine-linux \
&& tar -xJf ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz \
&& cd ghc-"$GHC_VERSION"-*-alpine-linux \
&& ./configure --disable-ld-override \
&& make install \
&& cd / \
......@@ -111,6 +111,8 @@ RUN cd /tmp \
FROM builder as tester
WORKDIR /usr/local/src
COPY Main.hs Main.hs
RUN ghc -static -optl-pthread -optl-static Main.hs \
......
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