Update builder images. Yay for GHC's improved cross-compiler support!

This commit is contained in:
Vidar Holen 2025-07-22 14:40:37 -07:00
commit 7a768a4b0f
12 changed files with 115 additions and 212 deletions

View file

@ -1,12 +1,12 @@
FROM ghcr.io/shepherdjerred/macos-cross-compiler:latest FROM ghcr.io/shepherdjerred/macos-cross-compiler@sha256:7d40c5e179d5d15453cf2a6b1bba3392bb1448b8257ee6b86021fc905c59dad6
ENV TARGET aarch64-apple-darwin22 ENV TARGET=aarch64-apple-darwin22
ENV TARGETNAME darwin.aarch64 ENV TARGETNAME=darwin.aarch64
# Build dependencies # Build dependencies
USER root USER root
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL C.utf8 ENV LC_ALL=C.utf8
# Install basic deps # Install basic deps
RUN apt-get update && apt-get install -y automake autoconf build-essential curl xz-utils qemu-user-static RUN apt-get update && apt-get install -y automake autoconf build-essential curl xz-utils qemu-user-static
@ -27,7 +27,7 @@ RUN make install
# Due to an apparent cabal bug, we specify our options directly to cabal # Due to an apparent cabal bug, we specify our options directly to cabal
# It won't reuse caches if ghc-options are specified in ~/.cabal/config # It won't reuse caches if ghc-options are specified in ~/.cabal/config
ENV CABALOPTS "--ghc-options;-optc-Os -optc-fPIC;--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;--constraint=hashable==1.3.5.0" ENV CABALOPTS="--ghc-options;-optc-Os -optc-fPIC;--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;--constraint=hashable==1.3.5.0"
# Prebuild the dependencies # Prebuild the dependencies
RUN cabal update RUN cabal update

View file

@ -1,19 +1,19 @@
FROM liushuyu/osxcross@sha256:fa32af4677e2860a1c5950bc8c360f309e2a87e2ddfed27b642fddf7a6093b76 FROM liushuyu/osxcross@sha256:fa32af4677e2860a1c5950bc8c360f309e2a87e2ddfed27b642fddf7a6093b76
ENV TARGET x86_64-apple-darwin18 ENV TARGET=x86_64-apple-darwin18
ENV TARGETNAME darwin.x86_64 ENV TARGETNAME=darwin.x86_64
# Build dependencies # Build dependencies
USER root USER root
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN sed -e 's/focal/kinetic/g' -i /etc/apt/sources.list RUN sed -e 's/focal/kinetic/g' -e 's/archive\|security/old-releases/' -i /etc/apt/sources.list
RUN apt-get update RUN apt-get update
RUN apt-get dist-upgrade -y RUN apt-get dist-upgrade -y
RUN apt-get install -y ghc automake autoconf llvm curl alex happy RUN apt-get install -y ghc automake autoconf llvm curl alex happy
# Build GHC # Build GHC
WORKDIR /ghc WORKDIR /ghc
RUN curl -L "https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-src.tar.xz" | tar xJ --strip-components=1 RUN curl -L "https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-src.tar.xz" | tar xJ --strip-components=1
RUN ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET" RUN ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
RUN cp mk/flavours/quick-cross.mk mk/build.mk && make -j "$(nproc)" RUN cp mk/flavours/quick-cross.mk mk/build.mk && make -j "$(nproc)"
RUN make install RUN make install
@ -21,7 +21,7 @@ RUN curl -L "https://downloads.haskell.org/~cabal/cabal-install-3.9.0.0/cabal-in
# Due to an apparent cabal bug, we specify our options directly to cabal # Due to an apparent cabal bug, we specify our options directly to cabal
# It won't reuse caches if ghc-options are specified in ~/.cabal/config # It won't reuse caches if ghc-options are specified in ~/.cabal/config
ENV CABALOPTS "--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg" ENV CABALOPTS="--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg"
# Prebuild the dependencies # Prebuild the dependencies
RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck

View file

@ -1,34 +1,29 @@
FROM ubuntu:20.04 FROM ubuntu:25.04
ENV TARGET aarch64-linux-gnu ENV TARGET=aarch64-linux-gnu
ENV TARGETNAME linux.aarch64 ENV TARGETNAME=linux.aarch64
# Build dependencies # Build dependencies
USER root USER root
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y llvm-20 "gcc-$TARGET" "g++-$TARGET" ghc alex happy automake autoconf build-essential curl qemu-user-static
# These deps are from 20.04, because GHC's compiler/llvm support moves slowly RUN curl -L "https://downloads.haskell.org/~cabal/cabal-install-3.16.0.0/cabal-install-3.16.0.0-x86_64-linux-alpine3_20.tar.xz" | tar xJv -C /usr/local/bin && cabal update
RUN apt-get update && apt-get install -y llvm gcc-$TARGET
# The rest are from 22.10
RUN sed -e 's/focal/kinetic/g' -i /etc/apt/sources.list
# Kinetic does not receive updates anymore, switch to last available
RUN sed -e 's/archive.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list
RUN sed -e 's/security.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list
RUN apt-get update && apt-get install -y ghc alex happy automake autoconf build-essential curl qemu-user-static
# Build GHC # Build GHC
WORKDIR /ghc WORKDIR /ghc
RUN curl -L "https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-src.tar.xz" | tar xJ --strip-components=1 RUN curl -L "https://downloads.haskell.org/~ghc/9.12.2/ghc-9.12.2-src.tar.xz" | tar xJ --strip-components=1
RUN ./boot && ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET" RUN ./boot.source && ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
RUN cp mk/flavours/quick-cross.mk mk/build.mk && make -j "$(nproc)" # GHC fails to build if it can't encode non-ascii
RUN make install ENV LC_CTYPE=C.utf8
RUN curl -L "https://downloads.haskell.org/~cabal/cabal-install-3.9.0.0/cabal-install-3.9-x86_64-linux-alpine.tar.xz" | tar xJv -C /usr/local/bin # We have to do a binary-dist instead of a direct install, otherwise the targest won't have
# cross compilation prefixes in /usr/local/lib/aarch64-linux-gnu-ghc-*/lib/settings
RUN ./hadrian/build --flavour=quickest --bignum=native -V -j --prefix=/usr/local install
# Hadrian just outputs "gcc" as the name of gcc, without accounting for $TARGET. Manually fix up the paths:
RUN sed -e 's/"\(gcc\|g++\|ld\)"/"'"$TARGET"'-\1"/g' -i /usr/local/lib/$TARGET-ghc-*/lib/settings
# Due to an apparent cabal bug, we specify our options directly to cabal # Due to an apparent cabal bug, we specify our options directly to cabal
# It won't reuse caches if ghc-options are specified in ~/.cabal/config # It won't reuse caches if ghc-options are specified in ~/.cabal/config
ENV CABALOPTS "--ghc-options;-split-sections -optc-Os -optc-Wl,--gc-sections -optc-fPIC;--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;-c;hashable -arch-native" ENV CABALOPTS="--ghc-options;-split-sections -optc-Os -optc-Wl,--gc-sections -optc-fPIC;--with-compiler=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;-c;hashable -arch-native"
# Prebuild the dependencies # Prebuild the dependencies
RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck

View file

@ -9,6 +9,6 @@ set -xe
ls -l "$TARGETNAME" ls -l "$TARGETNAME"
"$TARGET-strip" -s "$TARGETNAME/shellcheck" "$TARGET-strip" -s "$TARGETNAME/shellcheck"
ls -l "$TARGETNAME" ls -l "$TARGETNAME"
qemu-aarch64-static "$TARGETNAME/shellcheck" --version "qemu-${TARGET%%-*}-static" "$TARGETNAME/shellcheck" --version
} >&2 } >&2
tar czv "$TARGETNAME" tar czv "$TARGETNAME"

View file

@ -1,7 +1,7 @@
# This Docker file uses a custom QEmu fork with patches to follow execve # This Docker file uses a custom QEmu fork with patches to follow execve
# to build all of ShellCheck emulated. # to build all of ShellCheck emulated.
FROM ubuntu:24.04 FROM ubuntu:25.04
ENV TARGETNAME linux.armv6hf ENV TARGETNAME linux.armv6hf

View file

@ -1,28 +1,32 @@
active-repositories: hackage.haskell.org:merge active-repositories: hackage.haskell.org:merge
constraints: any.Diff ==0.5, constraints: any.Diff ==1.0.2,
any.OneTuple ==0.4.2, any.OneTuple ==0.4.2,
any.QuickCheck ==2.14.3, any.QuickCheck ==2.16.0.0,
QuickCheck -old-random +templatehaskell, QuickCheck -old-random +templatehaskell,
any.StateVar ==1.2.2, any.StateVar ==1.2.2,
any.aeson ==2.2.3.0, any.aeson ==2.2.3.0,
aeson +ordered-keymap, aeson +ordered-keymap,
any.ansi-terminal ==1.1.3,
ansi-terminal -example,
any.ansi-terminal-types ==1.1.3,
any.array ==0.5.4.0, any.array ==0.5.4.0,
any.assoc ==1.1.1, any.assoc ==1.1.1,
assoc -tagged, assoc -tagged,
any.base ==4.15.1.0, any.base ==4.15.1.0,
any.base-orphans ==0.9.2, any.base-orphans ==0.9.3,
any.bifunctors ==5.6.2, any.bifunctors ==5.6.2,
bifunctors +tagged, bifunctors +tagged,
any.binary ==0.8.8.0, any.binary ==0.8.8.0,
any.bytestring ==0.10.12.1, any.bytestring ==0.10.12.1,
any.character-ps ==0.1, any.character-ps ==0.1,
any.comonad ==5.0.8, any.colour ==2.3.6,
any.comonad ==5.0.9,
comonad +containers +distributive +indexed-traversable, comonad +containers +distributive +indexed-traversable,
any.containers ==0.6.4.1, any.containers ==0.6.4.1,
any.contravariant ==1.5.5, any.contravariant ==1.5.5,
contravariant +semigroups +statevar +tagged, contravariant +semigroups +statevar +tagged,
any.data-array-byte ==0.1.0.1, any.data-array-byte ==0.1.0.1,
any.data-fix ==0.3.3, any.data-fix ==0.3.4,
any.deepseq ==1.4.5.0, any.deepseq ==1.4.5.0,
any.directory ==1.3.6.2, any.directory ==1.3.6.2,
any.distributive ==0.6.2.1, any.distributive ==0.6.2.1,
@ -30,31 +34,36 @@ constraints: any.Diff ==0.5,
any.dlist ==1.0, any.dlist ==1.0,
dlist -werror, dlist -werror,
any.exceptions ==0.10.4, any.exceptions ==0.10.4,
any.fgl ==5.8.2.0, any.fgl ==5.8.3.0,
fgl +containers042, fgl +containers042,
any.filepath ==1.4.2.1, any.filepath ==1.4.2.1,
any.foldable1-classes-compat ==0.1, any.foldable1-classes-compat ==0.1.2,
foldable1-classes-compat +tagged, foldable1-classes-compat +tagged,
any.generically ==0.1.1, any.generically ==0.1.1,
any.ghc-bignum ==1.1, any.ghc-bignum ==1.1,
any.ghc-boot-th ==9.0.2, any.ghc-boot-th ==9.0.2,
any.ghc-prim ==0.7.0, any.ghc-prim ==0.7.0,
any.hashable ==1.4.6.0, any.hashable ==1.4.7.0,
hashable -arch-native +integer-gmp -random-initial-seed, hashable -arch-native +integer-gmp -random-initial-seed,
any.indexed-traversable ==0.1.4, any.indexed-traversable ==0.1.4,
any.indexed-traversable-instances ==0.1.2, any.indexed-traversable-instances ==0.1.2,
any.integer-conversion ==0.1.1, any.integer-conversion ==0.1.1,
any.integer-logarithms ==1.0.3.1, any.integer-logarithms ==1.0.4,
integer-logarithms -check-bounds +integer-gmp, integer-logarithms -check-bounds +integer-gmp,
any.mtl ==2.2.2, any.mtl ==2.2.2,
any.network-uri ==2.6.4.2, any.network-uri ==2.6.4.2,
any.optparse-applicative ==0.19.0.0,
optparse-applicative +process,
any.parsec ==3.1.14.0, any.parsec ==3.1.14.0,
any.pretty ==1.1.3.6, any.pretty ==1.1.3.6,
any.primitive ==0.9.0.0, any.prettyprinter ==1.7.1,
prettyprinter -buildreadme +text,
any.prettyprinter-ansi-terminal ==1.1.3,
any.primitive ==0.9.1.0,
any.process ==1.6.13.2, any.process ==1.6.13.2,
any.random ==1.2.1.2, any.random ==1.3.1,
any.regex-base ==0.94.0.2, any.regex-base ==0.94.0.3,
any.regex-tdfa ==1.3.2.2, any.regex-tdfa ==1.3.2.4,
regex-tdfa +doctest -force-o2, regex-tdfa +doctest -force-o2,
any.rts ==1.0.2, any.rts ==1.0.2,
any.scientific ==0.3.8.0, any.scientific ==0.3.8.0,
@ -63,31 +72,34 @@ constraints: any.Diff ==0.5,
semialign +semigroupoids, semialign +semigroupoids,
any.semigroupoids ==6.0.1, any.semigroupoids ==6.0.1,
semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers, semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers,
any.splitmix ==0.1.0.5, any.splitmix ==0.1.3.1,
splitmix -optimised-mixer, splitmix -optimised-mixer,
any.stm ==2.5.0.0, any.stm ==2.5.0.0,
any.strict ==0.5, any.strict ==0.5.1,
any.tagged ==0.8.8, any.tagged ==0.8.9,
tagged +deepseq +transformers, tagged +deepseq +transformers,
any.tasty ==1.5.3,
tasty +unix,
any.template-haskell ==2.17.0.0, any.template-haskell ==2.17.0.0,
any.text ==1.2.5.0, any.text ==1.2.5.0,
any.text-iso8601 ==0.1.1, any.text-iso8601 ==0.1.1,
any.text-short ==0.1.6, any.text-short ==0.1.6,
text-short -asserts, text-short -asserts,
any.th-abstraction ==0.7.0.0, any.th-abstraction ==0.7.1.0,
any.th-compat ==0.1.5, any.th-compat ==0.1.6,
any.these ==1.2.1, any.these ==1.2.1,
any.time ==1.9.3, any.time ==1.9.3,
any.time-compat ==1.9.7, any.time-compat ==1.9.8,
any.transformers ==0.5.6.2, any.transformers ==0.5.6.2,
any.transformers-compat ==0.7.2, any.transformers-compat ==0.7.2,
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two, transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
any.unbounded-delays ==0.1.1.1,
any.unix ==2.7.2.2, any.unix ==2.7.2.2,
any.unordered-containers ==0.2.20, any.unordered-containers ==0.2.20,
unordered-containers -debug, unordered-containers -debug,
any.uuid-types ==1.0.6, any.uuid-types ==1.0.6,
any.vector ==0.13.1.0, any.vector ==0.13.2.0,
vector +boundschecks -internalchecks -unsafechecks -wall, vector +boundschecks -internalchecks -unsafechecks -wall,
any.vector-stream ==0.1.0.1, any.vector-stream ==0.1.0.1,
any.witherable ==0.5 any.witherable ==0.5
index-state: hackage.haskell.org 2024-06-18T02:21:19Z index-state: hackage.haskell.org 2025-07-22T18:12:16Z

View file

@ -30,7 +30,7 @@ install_from_freeze() {
linefeed=${linefeed%x} linefeed=${linefeed%x}
flags=$( flags=$(
sed 's/constraints:/&\n /' "$1" | sed 's/constraints:/&\n /' "$1" |
grep -vw -e rts -e base | grep -vw -e rts -e base -e ghc |
sed -n -e 's/^ *\([^,]*\).*/\1/p' | sed -n -e 's/^ *\([^,]*\).*/\1/p' |
sed -e 's/any\.\([^ ]*\) ==\(.*\)/\1-\2/; te; s/.*/--constraint\n&/; :e') sed -e 's/any\.\([^ ]*\) ==\(.*\)/\1-\2/; te; s/.*/--constraint\n&/; :e')
shift shift

View file

@ -1,46 +1,35 @@
FROM ubuntu:24.04 FROM ubuntu:25.04
ENV TARGETNAME linux.riscv64 ENV TARGETNAME=linux.riscv64
ENV TARGET riscv64-linux-gnu ENV TARGET=riscv64-linux-gnu
# Build dependencies
USER root USER root
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y llvm-20 "gcc-$TARGET" "g++-$TARGET" ghc alex happy automake autoconf build-essential curl qemu-user-static
RUN curl -L "https://downloads.haskell.org/~cabal/cabal-install-3.16.0.0/cabal-install-3.16.0.0-x86_64-linux-alpine3_20.tar.xz" | tar xJv -C /usr/local/bin && cabal update
# Init base # Build GHC
RUN apt-get update -y WORKDIR /ghc
RUN curl -L "https://downloads.haskell.org/~ghc/9.12.2/ghc-9.12.2-src.tar.xz" | tar xJ --strip-components=1
RUN ./boot.source && ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
# GHC fails to build if it can't encode non-ascii
ENV LC_CTYPE=C.utf8
# We have to do a binary-dist instead of a direct install, otherwise the targest won't have
# cross compilation prefixes in /usr/local/lib/aarch64-linux-gnu-ghc-*/lib/settings
RUN ./hadrian/build --flavour=quickest --bignum=native -V -j --prefix=/usr/local install
# Hadrian just outputs "gcc" as the name of gcc, without accounting for $TARGET. Manually fix up the paths:
RUN sed -e 's/"\(gcc\|g++\|ld\)"/"'"$TARGET"'-\1"/g' -i /usr/local/lib/$TARGET-ghc-*/lib/settings
# Install qemu # Due to an apparent cabal bug, we specify our options directly to cabal
RUN apt-get install -y --no-install-recommends build-essential ninja-build python3 pkg-config libglib2.0-dev libpixman-1-dev curl ca-certificates python3-virtualenv git python3-setuptools debootstrap # It won't reuse caches if ghc-options are specified in ~/.cabal/config
WORKDIR /qemu ENV CABALOPTS="--ghc-options;-split-sections -optc-Os -optc-Wl,--gc-sections -optc-fPIC;--with-compiler=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;-c;hashable -arch-native"
RUN git clone --depth 1 https://github.com/koalaman/qemu .
RUN ./configure --target-list=riscv64-linux-user --static --disable-system --disable-pie --disable-werror
RUN cd build && ninja qemu-riscv64
ENV QEMU_EXECVE 1
# Convenience utility # Prebuild the dependencies
COPY scutil /bin/scutil RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck
# We have to copy to /usr/bin because debootstrap will try to symlink /bin and fail if it exists
COPY scutil /chroot/usr/bin/scutil
RUN chmod +x /bin/scutil /chroot/usr/bin/scutil
# Set up a riscv64 userspace
WORKDIR /
RUN debootstrap --arch=riscv64 --variant=minbase --components=main,universe --foreign noble /chroot http://ports.ubuntu.com/ubuntu-ports
RUN cp /qemu/build/qemu-riscv64 /chroot/bin/qemu
RUN scutil emu /debootstrap/debootstrap --second-stage
# Install deps in the chroot
RUN scutil emu apt-get update
RUN scutil emu apt-get install -y --no-install-recommends ghc cabal-install
RUN scutil emu cabal update
# Generated with: cabal freeze -c 'hashable -arch-native'. We put it in /etc so cabal won't find it.
COPY cabal.project.freeze /chroot/etc
# Build all dependencies from the freeze file. The emulator segfaults at random,
# so retry a few times.
RUN scutil install_from_freeze /chroot/etc/cabal.project.freeze retry 5 emu cabal install --keep-going
# Copy the build script # Copy the build script
COPY build /chroot/bin/build COPY build /usr/bin
ENTRYPOINT ["/bin/scutil", "emu", "/bin/build"]
WORKDIR /scratch
ENTRYPOINT ["/usr/bin/build"]

View file

@ -1,21 +1,14 @@
#!/bin/sh #!/bin/sh
set -xe set -xe
IFS=';'
{ {
mkdir -p /tmp/scratch
cd /tmp/scratch
tar xzv --strip-components=1 tar xzv --strip-components=1
chmod +x striptests && ./striptests chmod +x striptests && ./striptests
# Use a freeze file to ensure we use the same dependencies we cached during
# the docker image build. We don't want to spend time compiling anything new.
cp /etc/cabal.project.freeze .
mkdir "$TARGETNAME" mkdir "$TARGETNAME"
# Retry in case of random segfault ( IFS=';'; cabal build $CABALOPTS --enable-executable-static )
scutil retry 3 cabal build --enable-executable-static
find . -name shellcheck -type f -exec mv {} "$TARGETNAME/" \; find . -name shellcheck -type f -exec mv {} "$TARGETNAME/" \;
ls -l "$TARGETNAME" ls -l "$TARGETNAME"
"$TARGET-strip" -s "$TARGETNAME/shellcheck" "$TARGET-strip" -s "$TARGETNAME/shellcheck"
ls -l "$TARGETNAME" ls -l "$TARGETNAME"
"$TARGETNAME/shellcheck" --version "qemu-${TARGET%%-*}-static" "$TARGETNAME/shellcheck" --version
} >&2 } >&2
tar czv "$TARGETNAME" tar czv "$TARGETNAME"

View file

@ -1,93 +0,0 @@
active-repositories: hackage.haskell.org:merge
constraints: any.Diff ==0.5,
any.OneTuple ==0.4.2,
any.QuickCheck ==2.14.3,
QuickCheck -old-random +templatehaskell,
any.StateVar ==1.2.2,
any.aeson ==2.2.3.0,
aeson +ordered-keymap,
any.array ==0.5.4.0,
any.assoc ==1.1.1,
assoc -tagged,
any.base ==4.17.2.0,
any.base-orphans ==0.9.2,
any.bifunctors ==5.6.2,
bifunctors +tagged,
any.binary ==0.8.9.1,
any.bytestring ==0.11.5.2,
any.character-ps ==0.1,
any.comonad ==5.0.8,
comonad +containers +distributive +indexed-traversable,
any.containers ==0.6.7,
any.contravariant ==1.5.5,
contravariant +semigroups +statevar +tagged,
any.data-fix ==0.3.3,
any.deepseq ==1.4.8.0,
any.directory ==1.3.7.1,
any.distributive ==0.6.2.1,
distributive +semigroups +tagged,
any.dlist ==1.0,
dlist -werror,
any.exceptions ==0.10.5,
any.fgl ==5.8.2.0,
fgl +containers042,
any.filepath ==1.4.2.2,
any.foldable1-classes-compat ==0.1,
foldable1-classes-compat +tagged,
any.generically ==0.1.1,
any.ghc-bignum ==1.3,
any.ghc-boot-th ==9.4.7,
any.ghc-prim ==0.9.1,
any.hashable ==1.4.6.0,
hashable -arch-native +integer-gmp -random-initial-seed,
any.indexed-traversable ==0.1.4,
any.indexed-traversable-instances ==0.1.2,
any.integer-conversion ==0.1.1,
any.integer-logarithms ==1.0.3.1,
integer-logarithms -check-bounds +integer-gmp,
any.mtl ==2.2.2,
any.network-uri ==2.6.4.2,
any.os-string ==2.0.3,
any.parsec ==3.1.16.1,
any.pretty ==1.1.3.6,
any.primitive ==0.9.0.0,
any.process ==1.6.17.0,
any.random ==1.2.1.2,
any.regex-base ==0.94.0.2,
any.regex-tdfa ==1.3.2.2,
regex-tdfa +doctest -force-o2,
any.rts ==1.0.2,
any.scientific ==0.3.8.0,
scientific -integer-simple,
any.semialign ==1.3.1,
semialign +semigroupoids,
any.semigroupoids ==6.0.1,
semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers,
any.splitmix ==0.1.0.5,
splitmix -optimised-mixer,
any.stm ==2.5.1.0,
any.strict ==0.5,
any.tagged ==0.8.8,
tagged +deepseq +transformers,
any.template-haskell ==2.19.0.0,
any.text ==2.0.2,
any.text-iso8601 ==0.1.1,
any.text-short ==0.1.6,
text-short -asserts,
any.th-abstraction ==0.7.0.0,
any.th-compat ==0.1.5,
any.these ==1.2.1,
any.time ==1.12.2,
any.time-compat ==1.9.7,
any.transformers ==0.5.6.2,
any.transformers-compat ==0.7.2,
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
any.unix ==2.7.3,
any.unordered-containers ==0.2.20,
unordered-containers -debug,
any.uuid-types ==1.0.6,
any.vector ==0.13.1.0,
vector +boundschecks -internalchecks -unsafechecks -wall,
any.vector-stream ==0.1.0.1,
any.witherable ==0.5
index-state: hackage.haskell.org 2024-06-17T00:48:51Z

View file

@ -4,7 +4,7 @@ FROM alpine:3.16
# alpine:3.18 (GHC 9.4.4): 29.0 megabytes # alpine:3.18 (GHC 9.4.4): 29.0 megabytes
# alpine:3.19 (GHC 9.4.7): 29.0 megabytes # alpine:3.19 (GHC 9.4.7): 29.0 megabytes
ENV TARGETNAME linux.x86_64 ENV TARGETNAME=linux.x86_64
# Install GHC and cabal # Install GHC and cabal
USER root USER root
@ -13,7 +13,7 @@ RUN apk add ghc cabal g++ libffi-dev curl bash
# Use ld.bfd instead of ld.gold due to # Use ld.bfd instead of ld.gold due to
# x86_64-linux-gnu/libpthread.a(pthread_cond_init.o)(.note.stapsdt+0x14): error: # x86_64-linux-gnu/libpthread.a(pthread_cond_init.o)(.note.stapsdt+0x14): error:
# relocation refers to local symbol "" [2], which is defined in a discarded section # relocation refers to local symbol "" [2], which is defined in a discarded section
ENV CABALOPTS "--ghc-options;-optl-Wl,-fuse-ld=bfd -split-sections -optc-Os -optc-Wl,--gc-sections" ENV CABALOPTS="--ghc-options;-optl-Wl,-fuse-ld=bfd -split-sections -optc-Os -optc-Wl,--gc-sections"
# Other archs pre-build dependencies here, but this one doesn't to detect ecosystem movement # Other archs pre-build dependencies here, but this one doesn't to detect ecosystem movement

View file

@ -1,26 +1,33 @@
FROM ubuntu:20.04 FROM ubuntu:25.04
ENV TARGETNAME windows.x86_64 ENV TARGETNAME=windows.x86_64
# We don't need wine32, even though it complains # We don't need wine32, even though it complains
USER root USER root
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y curl busybox wine winbind RUN apt-get update && apt-get install -y curl busybox wine winbind xz-utils
# Fetch Windows version, will be available under z:\haskell # Fetch Windows version, will be available under z:\haskell
WORKDIR /haskell WORKDIR /haskell
RUN curl -L "https://downloads.haskell.org/~ghc/8.10.4/ghc-8.10.4-x86_64-unknown-mingw32.tar.xz" | tar xJ --strip-components=1 # 9.12.2 produces a 37M binary
WORKDIR /haskell/bin # 9.0.2 produces a 28M binary
RUN curl -L "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-unknown-mingw32.zip" | busybox unzip - # 8.10.4 produces a 16M binary
RUN curl -L "https://curl.se/windows/dl-8.7.1_7/curl-8.7.1_7-win64-mingw.zip" | busybox unzip - && mv curl-*-win64-mingw/bin/* . # We don't want to be stuck on old versions forever though, so just go with the latest version
ENV WINEPATH /haskell/bin RUN curl -L "https://downloads.haskell.org/~ghc/9.12.2/ghc-9.12.2-x86_64-unknown-mingw32.tar.xz" | tar xJ --strip-components=1
# It's unknown whether Cabal on Windows suffers from the same issue # Fetch dependencies
# that necessitated this but I don't care enough to find out WORKDIR /haskell/bin
ENV CABALOPTS "--ghc-options;-split-sections -optc-Os -optc-Wl,--gc-sections" RUN curl -L "https://downloads.haskell.org/~cabal/cabal-install-3.16.0.0/cabal-install-3.16.0.0-x86_64-windows.zip" | busybox unzip -
RUN curl -L "https://curl.se/windows/dl-8.15.0_2/curl-8.15.0_2-win64-mingw.zip" | busybox unzip - && mv curl-*-win64-mingw/bin/* .
RUN wine /haskell/bin/cabal.exe update
ENV WINEPATH=/haskell/bin:/haskell/mingw/bin
# None of these actually seem to have an effect on GHC on Windows anymore,
# but we'll leave them in place anyways.
ENV CABALOPTS="--ghc-options;-split-sections -optc-Os -optc-Wl,--gc-sections"
# Precompile some deps to speed up later builds # Precompile some deps to speed up later builds
RUN wine /haskell/bin/cabal.exe update && IFS=';' && wine /haskell/bin/cabal.exe install --lib --dependencies-only $CABALOPTS ShellCheck RUN IFS=';' && wine /haskell/bin/cabal.exe install --lib --dependencies-only $CABALOPTS ShellCheck
COPY build /usr/bin COPY build /usr/bin
WORKDIR /scratch WORKDIR /scratch