diff --git a/builders/darwin.aarch64/Dockerfile b/builders/darwin.aarch64/Dockerfile index 7839728..95c1cbe 100644 --- a/builders/darwin.aarch64/Dockerfile +++ b/builders/darwin.aarch64/Dockerfile @@ -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 TARGETNAME darwin.aarch64 +ENV TARGET=aarch64-apple-darwin22 +ENV TARGETNAME=darwin.aarch64 # Build dependencies USER root -ENV DEBIAN_FRONTEND noninteractive -ENV LC_ALL C.utf8 +ENV DEBIAN_FRONTEND=noninteractive +ENV LC_ALL=C.utf8 # Install basic deps 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 # 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 RUN cabal update diff --git a/builders/darwin.x86_64/Dockerfile b/builders/darwin.x86_64/Dockerfile index a53245f..ceef155 100644 --- a/builders/darwin.x86_64/Dockerfile +++ b/builders/darwin.x86_64/Dockerfile @@ -1,19 +1,19 @@ FROM liushuyu/osxcross@sha256:fa32af4677e2860a1c5950bc8c360f309e2a87e2ddfed27b642fddf7a6093b76 -ENV TARGET x86_64-apple-darwin18 -ENV TARGETNAME darwin.x86_64 +ENV TARGET=x86_64-apple-darwin18 +ENV TARGETNAME=darwin.x86_64 # Build dependencies USER root -ENV DEBIAN_FRONTEND noninteractive -RUN sed -e 's/focal/kinetic/g' -i /etc/apt/sources.list +ENV DEBIAN_FRONTEND=noninteractive +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 dist-upgrade -y RUN apt-get install -y ghc automake autoconf llvm curl alex happy # Build 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 cp mk/flavours/quick-cross.mk mk/build.mk && make -j "$(nproc)" 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 # 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 RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck diff --git a/builders/linux.aarch64/Dockerfile b/builders/linux.aarch64/Dockerfile index 1ffe1bd..e783bf7 100644 --- a/builders/linux.aarch64/Dockerfile +++ b/builders/linux.aarch64/Dockerfile @@ -1,34 +1,29 @@ -FROM ubuntu:20.04 +FROM ubuntu:25.04 -ENV TARGET aarch64-linux-gnu -ENV TARGETNAME linux.aarch64 +ENV TARGET=aarch64-linux-gnu +ENV TARGETNAME=linux.aarch64 # Build dependencies USER root -ENV DEBIAN_FRONTEND noninteractive - -# These deps are from 20.04, because GHC's compiler/llvm support moves slowly -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 +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 # Build 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 ./boot && ./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 make install -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 +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 # 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 -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 RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck diff --git a/builders/linux.aarch64/build b/builders/linux.aarch64/build index 3ce61ce..c68f7b2 100755 --- a/builders/linux.aarch64/build +++ b/builders/linux.aarch64/build @@ -9,6 +9,6 @@ set -xe ls -l "$TARGETNAME" "$TARGET-strip" -s "$TARGETNAME/shellcheck" ls -l "$TARGETNAME" - qemu-aarch64-static "$TARGETNAME/shellcheck" --version + "qemu-${TARGET%%-*}-static" "$TARGETNAME/shellcheck" --version } >&2 tar czv "$TARGETNAME" diff --git a/builders/linux.armv6hf/Dockerfile b/builders/linux.armv6hf/Dockerfile index b4d4197..70a1148 100644 --- a/builders/linux.armv6hf/Dockerfile +++ b/builders/linux.armv6hf/Dockerfile @@ -1,7 +1,7 @@ # This Docker file uses a custom QEmu fork with patches to follow execve # to build all of ShellCheck emulated. -FROM ubuntu:24.04 +FROM ubuntu:25.04 ENV TARGETNAME linux.armv6hf diff --git a/builders/linux.armv6hf/cabal.project.freeze b/builders/linux.armv6hf/cabal.project.freeze index 183bcc6..43388ec 100644 --- a/builders/linux.armv6hf/cabal.project.freeze +++ b/builders/linux.armv6hf/cabal.project.freeze @@ -1,28 +1,32 @@ active-repositories: hackage.haskell.org:merge -constraints: any.Diff ==0.5, +constraints: any.Diff ==1.0.2, any.OneTuple ==0.4.2, - any.QuickCheck ==2.14.3, + any.QuickCheck ==2.16.0.0, QuickCheck -old-random +templatehaskell, any.StateVar ==1.2.2, any.aeson ==2.2.3.0, 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.assoc ==1.1.1, assoc -tagged, any.base ==4.15.1.0, - any.base-orphans ==0.9.2, + any.base-orphans ==0.9.3, any.bifunctors ==5.6.2, bifunctors +tagged, any.binary ==0.8.8.0, any.bytestring ==0.10.12.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, any.containers ==0.6.4.1, any.contravariant ==1.5.5, contravariant +semigroups +statevar +tagged, 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.directory ==1.3.6.2, any.distributive ==0.6.2.1, @@ -30,31 +34,36 @@ constraints: any.Diff ==0.5, any.dlist ==1.0, dlist -werror, any.exceptions ==0.10.4, - any.fgl ==5.8.2.0, + any.fgl ==5.8.3.0, fgl +containers042, any.filepath ==1.4.2.1, - any.foldable1-classes-compat ==0.1, + any.foldable1-classes-compat ==0.1.2, foldable1-classes-compat +tagged, any.generically ==0.1.1, any.ghc-bignum ==1.1, any.ghc-boot-th ==9.0.2, 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, 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, + any.integer-logarithms ==1.0.4, integer-logarithms -check-bounds +integer-gmp, any.mtl ==2.2.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.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.random ==1.2.1.2, - any.regex-base ==0.94.0.2, - any.regex-tdfa ==1.3.2.2, + any.random ==1.3.1, + any.regex-base ==0.94.0.3, + any.regex-tdfa ==1.3.2.4, regex-tdfa +doctest -force-o2, any.rts ==1.0.2, any.scientific ==0.3.8.0, @@ -63,31 +72,34 @@ constraints: any.Diff ==0.5, semialign +semigroupoids, any.semigroupoids ==6.0.1, semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers, - any.splitmix ==0.1.0.5, + any.splitmix ==0.1.3.1, splitmix -optimised-mixer, any.stm ==2.5.0.0, - any.strict ==0.5, - any.tagged ==0.8.8, + any.strict ==0.5.1, + any.tagged ==0.8.9, tagged +deepseq +transformers, + any.tasty ==1.5.3, + tasty +unix, any.template-haskell ==2.17.0.0, any.text ==1.2.5.0, 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.th-abstraction ==0.7.1.0, + any.th-compat ==0.1.6, any.these ==1.2.1, 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-compat ==0.7.2, 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.unordered-containers ==0.2.20, unordered-containers -debug, any.uuid-types ==1.0.6, - any.vector ==0.13.1.0, + any.vector ==0.13.2.0, vector +boundschecks -internalchecks -unsafechecks -wall, any.vector-stream ==0.1.0.1, any.witherable ==0.5 -index-state: hackage.haskell.org 2024-06-18T02:21:19Z +index-state: hackage.haskell.org 2025-07-22T18:12:16Z diff --git a/builders/linux.armv6hf/scutil b/builders/linux.armv6hf/scutil index a85d810..96d5216 100644 --- a/builders/linux.armv6hf/scutil +++ b/builders/linux.armv6hf/scutil @@ -30,7 +30,7 @@ install_from_freeze() { linefeed=${linefeed%x} flags=$( 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 -e 's/any\.\([^ ]*\) ==\(.*\)/\1-\2/; te; s/.*/--constraint\n&/; :e') shift diff --git a/builders/linux.riscv64/Dockerfile b/builders/linux.riscv64/Dockerfile index d138ff7..b7bd961 100644 --- a/builders/linux.riscv64/Dockerfile +++ b/builders/linux.riscv64/Dockerfile @@ -1,46 +1,35 @@ -FROM ubuntu:24.04 +FROM ubuntu:25.04 -ENV TARGETNAME linux.riscv64 -ENV TARGET riscv64-linux-gnu +ENV TARGETNAME=linux.riscv64 +ENV TARGET=riscv64-linux-gnu +# Build dependencies 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 -RUN apt-get update -y +# Build GHC +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 -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 -WORKDIR /qemu -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 +# 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 +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" -# Convenience utility -COPY scutil /bin/scutil -# 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 +# Prebuild the dependencies +RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck # Copy the build script -COPY build /chroot/bin/build -ENTRYPOINT ["/bin/scutil", "emu", "/bin/build"] +COPY build /usr/bin + +WORKDIR /scratch +ENTRYPOINT ["/usr/bin/build"] diff --git a/builders/linux.riscv64/build b/builders/linux.riscv64/build index ed9dc27..c68f7b2 100755 --- a/builders/linux.riscv64/build +++ b/builders/linux.riscv64/build @@ -1,21 +1,14 @@ #!/bin/sh set -xe -IFS=';' { - mkdir -p /tmp/scratch - cd /tmp/scratch tar xzv --strip-components=1 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" - # Retry in case of random segfault - scutil retry 3 cabal build --enable-executable-static + ( IFS=';'; cabal build $CABALOPTS --enable-executable-static ) find . -name shellcheck -type f -exec mv {} "$TARGETNAME/" \; ls -l "$TARGETNAME" "$TARGET-strip" -s "$TARGETNAME/shellcheck" ls -l "$TARGETNAME" - "$TARGETNAME/shellcheck" --version + "qemu-${TARGET%%-*}-static" "$TARGETNAME/shellcheck" --version } >&2 tar czv "$TARGETNAME" diff --git a/builders/linux.riscv64/cabal.project.freeze b/builders/linux.riscv64/cabal.project.freeze deleted file mode 100644 index cbb42e1..0000000 --- a/builders/linux.riscv64/cabal.project.freeze +++ /dev/null @@ -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 diff --git a/builders/linux.x86_64/Dockerfile b/builders/linux.x86_64/Dockerfile index edafb36..aafe306 100644 --- a/builders/linux.x86_64/Dockerfile +++ b/builders/linux.x86_64/Dockerfile @@ -4,7 +4,7 @@ FROM alpine:3.16 # alpine:3.18 (GHC 9.4.4): 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 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 # 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 -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 diff --git a/builders/windows.x86_64/Dockerfile b/builders/windows.x86_64/Dockerfile index 2ae78ac..366cbc1 100644 --- a/builders/windows.x86_64/Dockerfile +++ b/builders/windows.x86_64/Dockerfile @@ -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 USER root -ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && apt-get install -y curl busybox wine winbind +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y curl busybox wine winbind xz-utils # Fetch Windows version, will be available under z:\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 -WORKDIR /haskell/bin -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 - -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/* . -ENV WINEPATH /haskell/bin +# 9.12.2 produces a 37M binary +# 9.0.2 produces a 28M binary +# 8.10.4 produces a 16M binary +# We don't want to be stuck on old versions forever though, so just go with the latest version +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 -# that necessitated this but I don't care enough to find out -ENV CABALOPTS "--ghc-options;-split-sections -optc-Os -optc-Wl,--gc-sections" +# Fetch dependencies +WORKDIR /haskell/bin +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 -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 WORKDIR /scratch