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

Update GHC to v9.4.1

- Build system: Migrate from make to Hadrian
- Install location: Migrate from /usr to /usr/local
- CMD instruction: Add ghci
parent 4ae489cd
No related branches found
No related tags found
No related merge requests found
Pipeline #11962 passed
......@@ -33,8 +33,8 @@
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
GHC_VERSION_BUILD: "9.2.4"
CABAL_VERSION_BUILD: "3.6.2.0"
GHC_VERSION_BUILD: "9.4.1"
CABAL_VERSION_BUILD: "3.8.1.0"
before_script:
- *before-script-build
......@@ -168,13 +168,6 @@ build-manifest:version-linux-multiarch:
$CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
fi
docker manifest push $CI_APP_REPO:$CI_APP_TAG
- |
docker manifest create $CI_APP_REPO:$VERSION_MAJ_MIN $CI_MANIFEST_LIST
if echo $OS_ARCH | grep "linux-arm64v8" >/dev/null ; then
docker manifest annotate --variant v8 $CI_APP_REPO:$VERSION_MAJ_MIN \
$CI_APP_REPO:$CI_APP_TAG-linux-arm64v8
fi
docker manifest push $CI_APP_REPO:$VERSION_MAJ_MIN
rules:
- if: $CI_COMMIT_BRANCH == "freeze-version"
changes:
......
ARG GHC_VERSION_BUILD
ARG CABAL_VERSION_BUILD
FROM registry.gitlab.b-data.ch/ghc/ghc4pandoc:9.0.2 as bootstrap
FROM registry.gitlab.b-data.ch/ghc/ghc4pandoc:9.2.4 as bootstrap
ARG GHC_VERSION_BUILD
ARG CABAL_VERSION_BUILD
......@@ -32,31 +32,23 @@ 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 \
&& gpg --keyserver hkps://keyserver.ubuntu.com:443 \
--receive-keys 88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4 \
--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 \
# Use the LLVM backend
&& cp mk/build.mk.sample mk/build.mk \
&& echo 'BuildFlavour=perf-llvm' >> mk/build.mk \
&& echo 'BeConservative=YES' >> mk/build.mk \
&& echo 'SplitSections=YES' >> mk/build.mk \
&& echo 'HADDOCK_DOCS=NO' >> mk/build.mk \
&& echo 'HSCOLOUR_SRCS=NO' >> mk/build.mk \
&& echo 'BUILD_SPHINX_HTML=NO' >> mk/build.mk \
&& echo 'BUILD_SPHINX_PS=NO' >> mk/build.mk \
&& echo 'BUILD_SPHINX_PDF=NO' >> mk/build.mk \
&& ./boot \
&& ./boot.source \
&& ./configure --disable-ld-override LD=ld.gold \
# Use the LLVM backend
# Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
# so we can match the llvm vendor string alpine uses
&& sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets \
&& sed -i -e 's/unknown-linux-gnueabi/alpine-linux/g' llvm-targets \
&& sed -i -e 's/unknown-linux-gnu/alpine-linux/g' llvm-targets \
# See https://unix.stackexchange.com/questions/519092/what-is-the-logic-of-using-nproc-1-in-make-command
&& make -j$((`nproc`+1)) \
&& make binary-dist \
&& 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)) \
--flavour=perf+llvm+split_sections \
--docs=none \
# See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
&& cabal install --allow-newer cabal-install-$CABAL_VERSION
......@@ -105,16 +97,19 @@ RUN apk upgrade --no-cache \
zlib-dev \
zlib-static
COPY --from=bootstrap /tmp/ghc-$GHC_VERSION/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 \
&& ./configure --disable-ld-override --prefix=/usr \
&& cd ghc-$GHC_VERSION-*-alpine-linux \
&& ./configure --disable-ld-override \
&& make install \
&& cd / \
&& rm -rf /tmp/*
&& rm -rf /tmp/* \
## Somehow /tmp/ghc-$GHC_VERSION-*-alpine-linux
## ends up at /usr/local/share/doc/ghc-$GHC_VERSION
&& rm -rf /usr/local/share/doc/ghc-$GHC_VERSION/*
FROM builder as tester
......@@ -131,3 +126,5 @@ RUN ghc -static -optl-pthread -optl-static Main.hs \
&& cabal run
FROM builder as final
CMD ["ghci"]
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