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

Merge branch 'freeze-version'

parents fc7e74ea 29e8ad2a
Branches
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
|:------------------------------|:----------|:----------|:---------------------------------------- |
| latest<br>9.10.1<br>9.10<br>9 | 3.12.1.0 | ≥ 2.13.1 | latest<br>2.9.0.0 |
| 9.8.2<br>9.8 | 3.10.3.0 | ≥ 2.13.1 | 2.9.0.0<br>2.8.0.0<br>2.7.0.0<br>2.6.0.0 |
| 9.6.5<br>9.6 | 3.10.3.0 | ≥ 2.13.1 | 2.9.0.0<br>2.8.0.0<br>2.7.0.0 |
| 9.6.6<br>9.6 | 3.10.3.0 | ≥ 2.13.1 | 2.9.0.1 |
[^1]: built-in version; see [GHC musl > Version Matrix](../VERSION_MATRIX.md)
......@@ -15,6 +15,7 @@
| GHC | Cabal[^1] | Stack[^1] | HLS |
|:-------------|:----------|:----------|:----------------------------------------------------------------------------------------------- |
| 9.8.1 | 3.10.2.1 | ≥ 2.13.1 | 2.6.0.0<br>2.5.0.0<br>2.4.0.0 |
| 9.6.5 | 3.10.3.0 | ≥ 2.13.1 | 2.9.0.0<br>2.8.0.0<br>2.7.0.0 |
| 9.6.4 | 3.10.3.0 | ≥ 2.13.1 | 2.7.0.0<br>2.6.0.0 |
| 9.6.3 | 3.10.1.0 | ≥ 2.13.1 | 2.5.0.0<br>2.4.0.0<br>2.3.0.0<br>2.2.0.0 |
| 9.4.8<br>9.4 | 3.8.1.0 | ≥ 2.13.1 | 2.8.0.0<br>2.7.0.0<br>2.6.0.0<br>2.5.0.0<br>2.4.0.0 |
......
.env:
variables:
GHC_VERSION: "9.10.1"
CABAL_VERSION: "3.12.1.0"
GHC_VERSION: "9.6.6"
CABAL_VERSION: "3.10.3.0"
STACK_VERSION: "2.15.7"
HLS_VERSION: "2.9.0.0"
HLS_VERSION: "2.9.0.1"
BUILD_GHC: "true"
BUILD_HLS: "true"
TAG_VERSION_MAJ_MIN: "false"
TAG_VERSION_MAJ_MIN: "true"
TAG_VERSION_MAJ: "false"
.before-script-build: &before-script-build
......
......@@ -7,6 +7,7 @@ Topmost entry = Tag `latest`
| 9.10.1 | 3.12.1.0 | 2.15.7 | 18 | Alpine 3.20 |
| 9.8.2 | 3.10.3.0 | 2.15.7 | 16 | Alpine 3.20 |
| 9.8.1 | 3.10.2.1 | 2.15.1 | 14 | Alpine 3.19 |
| 9.6.6 | 3.10.3.0 | 2.15.7 | 16 | Alpine 3.20 |
| 9.6.5 | 3.10.3.0 | 2.15.7 | 16 | Alpine 3.20 |
| 9.6.4 | 3.10.3.0 | 2.15.5 | 14 | Alpine 3.19 |
| 9.6.3 | 3.10.1.0 | 2.13.1 | 14 | Alpine 3.19 |
......
ARG GHC_VERSION
ARG HLS_VERSION=2.9.0.1
FROM glcr.b-data.ch/ghc/ghc-musl:${GHC_VERSION} as builder
ARG HLS_VERSION
RUN apk add --no-cache patchelf findutils \
&& cd /tmp \
&& curl -sSL "https://github.com/haskell/haskell-language-server/archive/refs/tags/$HLS_VERSION.tar.gz" \
-o "haskell-language-server-$HLS_VERSION.tar.gz" \
&& tar -xzf "haskell-language-server-$HLS_VERSION.tar.gz" \
&& cd "haskell-language-server-$HLS_VERSION" \
&& . .github/scripts/env.sh \
&& . .github/scripts/common.sh \
&& sed -i.bak -e '/DELETE MARKER FOR CI/,/END DELETE/d' cabal.project \
&& GHCS="$GHC_VERSION" \
&& export GHCS \
&& ARTIFACT="$(uname -m)-linux-alpine" \
&& export ARTIFACT \
&& cabal update \
&& emake hls-ghc \
&& CABAL_VERSION_NUMERIC="$(cabal --numeric-version)" \
&& if dpkg --compare-versions "${CABAL_VERSION_NUMERIC%.*.*}" ge "3.11"; then \
sed -i 's|"$(STORE_DIR)/ghc-$(GHC_VERSION)"|"$(STORE_DIR)/ghc-$(GHC_VERSION)-inplace"|g' \
GNUmakefile; \
fi \
&& emake bindist \
&& strip "out/bindist/$ARTIFACT/haskell-language-server-$HLS_VERSION/lib/$GHC_VERSION"/*.so \
&& emake bindist-tar
FROM alpine:3.20 as hls
ARG HLS_VERSION
COPY --from=builder /tmp/haskell-language-server-"$HLS_VERSION"/out/haskell-language-server-*-linux-alpine.tar.xz /tmp/
RUN apk add --no-cache build-base \
&& cd /tmp \
&& tar -xJf haskell-language-server-"$HLS_VERSION"-*-linux-alpine.tar.xz \
&& cd haskell-language-server-"$HLS_VERSION" \
&& make install
FROM scratch
ARG HLS_VERSION
ENV HLS_VERSION=${HLS_VERSION}
COPY --from=hls /usr/local /usr/local
--- compiler/GHC/Driver/Flags.hs
+++ compiler/GHC/Driver/Flags.hs.patched
@@ -273,7 +273,6 @@
| Opt_RegsGraph -- do graph coloring register allocation
| Opt_RegsIterative -- do iterative coalescing graph coloring register allocation
| Opt_PedanticBottoms -- Be picky about how we treat bottom
- | Opt_LlvmTBAA -- Use LLVM TBAA infrastructure for improving AA (hidden flag)
| Opt_LlvmFillUndefWithGarbage -- Testing for undef bugs (hidden flag)
| Opt_IrrefutableTuples
| Opt_CmmSink
@@ -508,7 +507,6 @@
, Opt_EnableRewriteRules
, Opt_RegsGraph
, Opt_RegsIterative
- , Opt_LlvmTBAA
, Opt_IrrefutableTuples
, Opt_CmmSink
, Opt_CmmElimCommonBlocks
--- compiler/GHC/Driver/Pipeline/Execute.hs
+++ compiler/GHC/Driver/Pipeline/Execute.hs.patched
@@ -989,8 +989,7 @@
-> DynFlags
-> [(String, String)] -- ^ pairs of (opt, llc) arguments
llvmOptions llvm_config dflags =
- [("-enable-tbaa -tbaa", "-enable-tbaa") | gopt Opt_LlvmTBAA dflags ]
- ++ [("-relocation-model=" ++ rmodel
+ [("-relocation-model=" ++ rmodel
,"-relocation-model=" ++ rmodel) | not (null rmodel)]
++ [("-stack-alignment=" ++ (show align)
,"-stack-alignment=" ++ (show align)) | align > 0 ]
--- compiler/GHC/Driver/Session.hs
+++ compiler/GHC/Driver/Session.hs.patched
@@ -3430,7 +3430,6 @@
flagSpec "late-dmd-anal" Opt_LateDmdAnal,
flagSpec "late-specialise" Opt_LateSpecialise,
flagSpec "liberate-case" Opt_LiberateCase,
- flagHiddenSpec "llvm-tbaa" Opt_LlvmTBAA,
flagHiddenSpec "llvm-fill-undef-with-garbage" Opt_LlvmFillUndefWithGarbage,
flagSpec "loopification" Opt_Loopification,
flagSpec "block-layout-cfg" Opt_CfgBlocklayout,
@@ -3989,7 +3988,6 @@
optLevelFlags -- see Note [Documenting optimisation flags]
= [ ([0,1,2], Opt_DoLambdaEtaExpansion)
, ([0,1,2], Opt_DoEtaReduction) -- See Note [Eta-reduction in -O0]
- , ([0,1,2], Opt_LlvmTBAA)
, ([0,1,2], Opt_ProfManualCcs )
, ([2], Opt_DictsStrict)
--- configure.ac
+++ configure.ac.patched
@@ -556,7 +556,7 @@
# versions of LLVM simultaneously, but that stopped working around
# 3.5/3.6 release of LLVM.
LlvmMinVersion=11 # inclusive
-LlvmMaxVersion=16 # not inclusive
+LlvmMaxVersion=17 # not inclusive
AC_SUBST([LlvmMinVersion])
AC_SUBST([LlvmMaxVersion])
sUPPORTED_LLVM_VERSION_MIN=$(echo \($LlvmMinVersion\) | sed 's/\./,/')
--- llvm-passes
+++ llvm-passes.patched
@@ -1,5 +1,5 @@
[
-(0, "-enable-new-pm=0 -mem2reg -globalopt -lower-expect"),
-(1, "-enable-new-pm=0 -O1 -globalopt"),
-(2, "-enable-new-pm=0 -O2")
+(0, "-passes=function(require<tbaa>),function(mem2reg),globalopt,function(lower-expect)"),
+(1, "-passes=default<O1>"),
+(2, "-passes=default<O2>")
]
ARG GHC_VERSION=9.6.6
ARG CABAL_VERSION=3.10.3.0
ARG STACK_VERSION=2.15.7
ARG GHC_VERSION_BUILD=${GHC_VERSION}
ARG CABAL_VERSION_BUILD=${CABAL_VERSION}
FROM glcr.b-data.ch/ghc/ghc-musl:9.4.8 as bootstrap
RUN apk upgrade --no-cache \
&& apk add --no-cache \
autoconf \
automake \
binutils-gold \
build-base \
coreutils \
cpio \
curl \
gnupg \
linux-headers \
libffi-dev \
llvm16 \
ncurses-dev \
perl \
python3 \
xz \
zlib-dev
FROM bootstrap as bootstrap-ghc
ARG GHC_VERSION_BUILD
ENV GHC_VERSION=${GHC_VERSION_BUILD}
COPY patches/${GHC_VERSION}.patch /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.sig \
&& gpg --keyserver hkps://keyserver.ubuntu.com:443 \
--receive-keys 88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4 || \
gpg --keyserver hkp://keyserver.ubuntu.com:80 \
--receive-keys 88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4 \
&& 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" \
# Apply patches
&& mv "/tmp/$GHC_VERSION.patch" . \
&& patch -p0 <"$GHC_VERSION.patch" \
&& ./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 \
&& 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
FROM bootstrap as bootstrap-cabal
ARG CABAL_VERSION_BUILD
ENV CABAL_VERSION=${CABAL_VERSION_BUILD}
## Build Cabal (the tool) with the GHC bootstrap version
RUN cabal update \
## See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
&& cabal install "cabal-install-$CABAL_VERSION"
FROM alpine:3.20 as ghc-base
LABEL org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.source="https://gitlab.b-data.ch/ghc/ghc-musl" \
org.opencontainers.image.vendor="Olivier Benz" \
org.opencontainers.image.authors="Olivier Benz <olivier.benz@b-data.ch>"
ARG GHC_VERSION_BUILD
ARG CABAL_VERSION_BUILD
ARG STACK_VERSION
ENV GHC_VERSION=${GHC_VERSION_BUILD} \
CABAL_VERSION=${CABAL_VERSION_BUILD} \
STACK_VERSION=${STACK_VERSION}
RUN apk add --no-cache \
bash \
build-base \
bzip2 \
bzip2-dev \
bzip2-static \
curl \
curl-static \
dpkg \
fakeroot \
git \
gmp-dev \
libcurl \
libffi \
libffi-dev \
llvm16 \
ncurses-dev \
ncurses-static \
openssl-dev \
openssl-libs-static \
pcre \
pcre-dev \
pcre2 \
pcre2-dev \
perl \
## Install shadow for `stack --docker`
shadow \
wget \
xz \
xz-dev \
zlib \
zlib-dev \
zlib-static
FROM ghc-base as ghc-stage1
COPY --from=bootstrap-ghc /tmp/ghc-"$GHC_VERSION"/_build/bindist/ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz /tmp/
RUN cd /tmp \
## Install GHC
&& tar -xJf ghc-"$GHC_VERSION"-*-alpine-linux.tar.xz \
&& cd ghc-"$GHC_VERSION"-*-alpine-linux \
&& ./configure --disable-ld-override \
&& make install \
## Install Stack
&& cd /tmp \
&& curl -sSLO https://github.com/commercialhaskell/stack/releases/download/v"$STACK_VERSION"/stack-"$STACK_VERSION"-linux-"$(uname -m)".tar.gz \
&& curl -sSLO https://github.com/commercialhaskell/stack/releases/download/v"$STACK_VERSION"/stack-"$STACK_VERSION"-linux-"$(uname -m)".tar.gz.sha256 \
&& sha256sum -cs stack-"$STACK_VERSION"-linux-"$(uname -m)".tar.gz.sha256 \
&& tar -xzf stack-"$STACK_VERSION"-linux-"$(uname -m)".tar.gz \
&& mv stack-"$STACK_VERSION"-linux-"$(uname -m)"/stack /usr/local/bin/stack \
## Clean up
&& rm -rf /tmp/*
FROM ghc-stage1 as ghc-stage2
## Install Cabal (the tool) built with the GHC bootstrap version
COPY --from=bootstrap-cabal /root/.cabal/bin/cabal /usr/local/bin/cabal
## Rebuild Cabal (the tool) with the GHC target version
RUN cabal update \
&& cabal install "cabal-install-$CABAL_VERSION"
FROM ghc-stage1 as test
WORKDIR /usr/local/src
## Install Cabal (the tool) built with the GHC target version
COPY --from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal
COPY Main.hs Main.hs
RUN ghc -static -optl-pthread -optl-static Main.hs \
&& file Main \
&& ./Main \
## Test cabal workflow
&& mkdir cabal-test \
&& cd cabal-test \
&& cabal update \
&& cabal init -n --is-executable -p tester -l MIT \
&& cabal run
FROM ghc-base
## Install GHC and Stack
COPY --from=ghc-stage1 /usr/local /usr/local
## Install Cabal (the tool) built with the GHC target version
COPY --from=ghc-stage2 /root/.local/bin/cabal /usr/local/bin/cabal
CMD ["ghci"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment