Skip to content

Commit 7a768a4

Browse files
committed
Update builder images. Yay for GHC's improved cross-compiler support!
1 parent 89806b9 commit 7a768a4

12 files changed

Lines changed: 117 additions & 214 deletions

File tree

builders/darwin.aarch64/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM ghcr.io/shepherdjerred/macos-cross-compiler:latest
1+
FROM ghcr.io/shepherdjerred/macos-cross-compiler@sha256:7d40c5e179d5d15453cf2a6b1bba3392bb1448b8257ee6b86021fc905c59dad6
22

3-
ENV TARGET aarch64-apple-darwin22
4-
ENV TARGETNAME darwin.aarch64
3+
ENV TARGET=aarch64-apple-darwin22
4+
ENV TARGETNAME=darwin.aarch64
55

66
# Build dependencies
77
USER root
8-
ENV DEBIAN_FRONTEND noninteractive
9-
ENV LC_ALL C.utf8
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
ENV LC_ALL=C.utf8
1010

1111
# Install basic deps
1212
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
2727

2828
# Due to an apparent cabal bug, we specify our options directly to cabal
2929
# It won't reuse caches if ghc-options are specified in ~/.cabal/config
30-
ENV CABALOPTS "--ghc-options;-optc-Os -optc-fPIC;--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;--constraint=hashable==1.3.5.0"
30+
ENV CABALOPTS="--ghc-options;-optc-Os -optc-fPIC;--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg;--constraint=hashable==1.3.5.0"
3131

3232
# Prebuild the dependencies
3333
RUN cabal update

builders/darwin.x86_64/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
FROM liushuyu/osxcross@sha256:fa32af4677e2860a1c5950bc8c360f309e2a87e2ddfed27b642fddf7a6093b76
22

3-
ENV TARGET x86_64-apple-darwin18
4-
ENV TARGETNAME darwin.x86_64
3+
ENV TARGET=x86_64-apple-darwin18
4+
ENV TARGETNAME=darwin.x86_64
55

66
# Build dependencies
77
USER root
8-
ENV DEBIAN_FRONTEND noninteractive
9-
RUN sed -e 's/focal/kinetic/g' -i /etc/apt/sources.list
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
RUN sed -e 's/focal/kinetic/g' -e 's/archive\|security/old-releases/' -i /etc/apt/sources.list
1010
RUN apt-get update
1111
RUN apt-get dist-upgrade -y
1212
RUN apt-get install -y ghc automake autoconf llvm curl alex happy
1313

1414
# Build GHC
1515
WORKDIR /ghc
16-
RUN curl -L "https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-src.tar.xz" | tar xJ --strip-components=1
16+
RUN curl -L "https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-src.tar.xz" | tar xJ --strip-components=1
1717
RUN ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
1818
RUN cp mk/flavours/quick-cross.mk mk/build.mk && make -j "$(nproc)"
1919
RUN make install
2020
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
2121

2222
# Due to an apparent cabal bug, we specify our options directly to cabal
2323
# It won't reuse caches if ghc-options are specified in ~/.cabal/config
24-
ENV CABALOPTS "--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg"
24+
ENV CABALOPTS="--with-ghc=$TARGET-ghc;--with-hc-pkg=$TARGET-ghc-pkg"
2525

2626
# Prebuild the dependencies
2727
RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck

builders/linux.aarch64/Dockerfile

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:25.04
22

3-
ENV TARGET aarch64-linux-gnu
4-
ENV TARGETNAME linux.aarch64
3+
ENV TARGET=aarch64-linux-gnu
4+
ENV TARGETNAME=linux.aarch64
55

66
# Build dependencies
77
USER root
8-
ENV DEBIAN_FRONTEND noninteractive
9-
10-
# These deps are from 20.04, because GHC's compiler/llvm support moves slowly
11-
RUN apt-get update && apt-get install -y llvm gcc-$TARGET
12-
13-
# The rest are from 22.10
14-
RUN sed -e 's/focal/kinetic/g' -i /etc/apt/sources.list
15-
# Kinetic does not receive updates anymore, switch to last available
16-
RUN sed -e 's/archive.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list
17-
RUN sed -e 's/security.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list
18-
19-
RUN apt-get update && apt-get install -y ghc alex happy automake autoconf build-essential curl qemu-user-static
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
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
10+
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
2011

2112
# Build GHC
2213
WORKDIR /ghc
23-
RUN curl -L "https://downloads.haskell.org/~ghc/9.2.8/ghc-9.2.8-src.tar.xz" | tar xJ --strip-components=1
24-
RUN ./boot && ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
25-
RUN cp mk/flavours/quick-cross.mk mk/build.mk && make -j "$(nproc)"
26-
RUN make install
27-
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
14+
RUN curl -L "https://downloads.haskell.org/~ghc/9.12.2/ghc-9.12.2-src.tar.xz" | tar xJ --strip-components=1
15+
RUN ./boot.source && ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
16+
# GHC fails to build if it can't encode non-ascii
17+
ENV LC_CTYPE=C.utf8
18+
# We have to do a binary-dist instead of a direct install, otherwise the targest won't have
19+
# cross compilation prefixes in /usr/local/lib/aarch64-linux-gnu-ghc-*/lib/settings
20+
RUN ./hadrian/build --flavour=quickest --bignum=native -V -j --prefix=/usr/local install
21+
# Hadrian just outputs "gcc" as the name of gcc, without accounting for $TARGET. Manually fix up the paths:
22+
RUN sed -e 's/"\(gcc\|g++\|ld\)"/"'"$TARGET"'-\1"/g' -i /usr/local/lib/$TARGET-ghc-*/lib/settings
2823

2924
# Due to an apparent cabal bug, we specify our options directly to cabal
3025
# It won't reuse caches if ghc-options are specified in ~/.cabal/config
31-
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"
26+
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"
3227

3328
# Prebuild the dependencies
3429
RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck

builders/linux.aarch64/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ set -xe
99
ls -l "$TARGETNAME"
1010
"$TARGET-strip" -s "$TARGETNAME/shellcheck"
1111
ls -l "$TARGETNAME"
12-
qemu-aarch64-static "$TARGETNAME/shellcheck" --version
12+
"qemu-${TARGET%%-*}-static" "$TARGETNAME/shellcheck" --version
1313
} >&2
1414
tar czv "$TARGETNAME"

builders/linux.armv6hf/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Docker file uses a custom QEmu fork with patches to follow execve
22
# to build all of ShellCheck emulated.
33

4-
FROM ubuntu:24.04
4+
FROM ubuntu:25.04
55

66
ENV TARGETNAME linux.armv6hf
77

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,69 @@
11
active-repositories: hackage.haskell.org:merge
2-
constraints: any.Diff ==0.5,
2+
constraints: any.Diff ==1.0.2,
33
any.OneTuple ==0.4.2,
4-
any.QuickCheck ==2.14.3,
4+
any.QuickCheck ==2.16.0.0,
55
QuickCheck -old-random +templatehaskell,
66
any.StateVar ==1.2.2,
77
any.aeson ==2.2.3.0,
88
aeson +ordered-keymap,
9+
any.ansi-terminal ==1.1.3,
10+
ansi-terminal -example,
11+
any.ansi-terminal-types ==1.1.3,
912
any.array ==0.5.4.0,
1013
any.assoc ==1.1.1,
1114
assoc -tagged,
1215
any.base ==4.15.1.0,
13-
any.base-orphans ==0.9.2,
16+
any.base-orphans ==0.9.3,
1417
any.bifunctors ==5.6.2,
1518
bifunctors +tagged,
1619
any.binary ==0.8.8.0,
1720
any.bytestring ==0.10.12.1,
1821
any.character-ps ==0.1,
19-
any.comonad ==5.0.8,
22+
any.colour ==2.3.6,
23+
any.comonad ==5.0.9,
2024
comonad +containers +distributive +indexed-traversable,
2125
any.containers ==0.6.4.1,
2226
any.contravariant ==1.5.5,
2327
contravariant +semigroups +statevar +tagged,
2428
any.data-array-byte ==0.1.0.1,
25-
any.data-fix ==0.3.3,
29+
any.data-fix ==0.3.4,
2630
any.deepseq ==1.4.5.0,
2731
any.directory ==1.3.6.2,
2832
any.distributive ==0.6.2.1,
2933
distributive +semigroups +tagged,
3034
any.dlist ==1.0,
3135
dlist -werror,
3236
any.exceptions ==0.10.4,
33-
any.fgl ==5.8.2.0,
37+
any.fgl ==5.8.3.0,
3438
fgl +containers042,
3539
any.filepath ==1.4.2.1,
36-
any.foldable1-classes-compat ==0.1,
40+
any.foldable1-classes-compat ==0.1.2,
3741
foldable1-classes-compat +tagged,
3842
any.generically ==0.1.1,
3943
any.ghc-bignum ==1.1,
4044
any.ghc-boot-th ==9.0.2,
4145
any.ghc-prim ==0.7.0,
42-
any.hashable ==1.4.6.0,
46+
any.hashable ==1.4.7.0,
4347
hashable -arch-native +integer-gmp -random-initial-seed,
4448
any.indexed-traversable ==0.1.4,
4549
any.indexed-traversable-instances ==0.1.2,
4650
any.integer-conversion ==0.1.1,
47-
any.integer-logarithms ==1.0.3.1,
51+
any.integer-logarithms ==1.0.4,
4852
integer-logarithms -check-bounds +integer-gmp,
4953
any.mtl ==2.2.2,
5054
any.network-uri ==2.6.4.2,
55+
any.optparse-applicative ==0.19.0.0,
56+
optparse-applicative +process,
5157
any.parsec ==3.1.14.0,
5258
any.pretty ==1.1.3.6,
53-
any.primitive ==0.9.0.0,
59+
any.prettyprinter ==1.7.1,
60+
prettyprinter -buildreadme +text,
61+
any.prettyprinter-ansi-terminal ==1.1.3,
62+
any.primitive ==0.9.1.0,
5463
any.process ==1.6.13.2,
55-
any.random ==1.2.1.2,
56-
any.regex-base ==0.94.0.2,
57-
any.regex-tdfa ==1.3.2.2,
64+
any.random ==1.3.1,
65+
any.regex-base ==0.94.0.3,
66+
any.regex-tdfa ==1.3.2.4,
5867
regex-tdfa +doctest -force-o2,
5968
any.rts ==1.0.2,
6069
any.scientific ==0.3.8.0,
@@ -63,31 +72,34 @@ constraints: any.Diff ==0.5,
6372
semialign +semigroupoids,
6473
any.semigroupoids ==6.0.1,
6574
semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers,
66-
any.splitmix ==0.1.0.5,
75+
any.splitmix ==0.1.3.1,
6776
splitmix -optimised-mixer,
6877
any.stm ==2.5.0.0,
69-
any.strict ==0.5,
70-
any.tagged ==0.8.8,
78+
any.strict ==0.5.1,
79+
any.tagged ==0.8.9,
7180
tagged +deepseq +transformers,
81+
any.tasty ==1.5.3,
82+
tasty +unix,
7283
any.template-haskell ==2.17.0.0,
7384
any.text ==1.2.5.0,
7485
any.text-iso8601 ==0.1.1,
7586
any.text-short ==0.1.6,
7687
text-short -asserts,
77-
any.th-abstraction ==0.7.0.0,
78-
any.th-compat ==0.1.5,
88+
any.th-abstraction ==0.7.1.0,
89+
any.th-compat ==0.1.6,
7990
any.these ==1.2.1,
8091
any.time ==1.9.3,
81-
any.time-compat ==1.9.7,
92+
any.time-compat ==1.9.8,
8293
any.transformers ==0.5.6.2,
8394
any.transformers-compat ==0.7.2,
8495
transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
96+
any.unbounded-delays ==0.1.1.1,
8597
any.unix ==2.7.2.2,
8698
any.unordered-containers ==0.2.20,
8799
unordered-containers -debug,
88100
any.uuid-types ==1.0.6,
89-
any.vector ==0.13.1.0,
101+
any.vector ==0.13.2.0,
90102
vector +boundschecks -internalchecks -unsafechecks -wall,
91103
any.vector-stream ==0.1.0.1,
92104
any.witherable ==0.5
93-
index-state: hackage.haskell.org 2024-06-18T02:21:19Z
105+
index-state: hackage.haskell.org 2025-07-22T18:12:16Z

builders/linux.armv6hf/scutil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ install_from_freeze() {
3030
linefeed=${linefeed%x}
3131
flags=$(
3232
sed 's/constraints:/&\n /' "$1" |
33-
grep -vw -e rts -e base |
33+
grep -vw -e rts -e base -e ghc |
3434
sed -n -e 's/^ *\([^,]*\).*/\1/p' |
3535
sed -e 's/any\.\([^ ]*\) ==\(.*\)/\1-\2/; te; s/.*/--constraint\n&/; :e')
3636
shift

builders/linux.riscv64/Dockerfile

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,35 @@
1-
FROM ubuntu:24.04
1+
FROM ubuntu:25.04
22

3-
ENV TARGETNAME linux.riscv64
4-
ENV TARGET riscv64-linux-gnu
3+
ENV TARGETNAME=linux.riscv64
4+
ENV TARGET=riscv64-linux-gnu
55

6+
# Build dependencies
67
USER root
7-
ENV DEBIAN_FRONTEND noninteractive
8-
9-
# Init base
10-
RUN apt-get update -y
11-
12-
# Install qemu
13-
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
14-
WORKDIR /qemu
15-
RUN git clone --depth 1 https://github.com/koalaman/qemu .
16-
RUN ./configure --target-list=riscv64-linux-user --static --disable-system --disable-pie --disable-werror
17-
RUN cd build && ninja qemu-riscv64
18-
ENV QEMU_EXECVE 1
19-
20-
# Convenience utility
21-
COPY scutil /bin/scutil
22-
# We have to copy to /usr/bin because debootstrap will try to symlink /bin and fail if it exists
23-
COPY scutil /chroot/usr/bin/scutil
24-
RUN chmod +x /bin/scutil /chroot/usr/bin/scutil
25-
26-
# Set up a riscv64 userspace
27-
WORKDIR /
28-
RUN debootstrap --arch=riscv64 --variant=minbase --components=main,universe --foreign noble /chroot http://ports.ubuntu.com/ubuntu-ports
29-
RUN cp /qemu/build/qemu-riscv64 /chroot/bin/qemu
30-
RUN scutil emu /debootstrap/debootstrap --second-stage
31-
32-
# Install deps in the chroot
33-
RUN scutil emu apt-get update
34-
RUN scutil emu apt-get install -y --no-install-recommends ghc cabal-install
35-
RUN scutil emu cabal update
36-
37-
# Generated with: cabal freeze -c 'hashable -arch-native'. We put it in /etc so cabal won't find it.
38-
COPY cabal.project.freeze /chroot/etc
39-
40-
# Build all dependencies from the freeze file. The emulator segfaults at random,
41-
# so retry a few times.
42-
RUN scutil install_from_freeze /chroot/etc/cabal.project.freeze retry 5 emu cabal install --keep-going
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
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
10+
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
11+
12+
# Build GHC
13+
WORKDIR /ghc
14+
RUN curl -L "https://downloads.haskell.org/~ghc/9.12.2/ghc-9.12.2-src.tar.xz" | tar xJ --strip-components=1
15+
RUN ./boot.source && ./configure --host x86_64-linux-gnu --build x86_64-linux-gnu --target "$TARGET"
16+
# GHC fails to build if it can't encode non-ascii
17+
ENV LC_CTYPE=C.utf8
18+
# We have to do a binary-dist instead of a direct install, otherwise the targest won't have
19+
# cross compilation prefixes in /usr/local/lib/aarch64-linux-gnu-ghc-*/lib/settings
20+
RUN ./hadrian/build --flavour=quickest --bignum=native -V -j --prefix=/usr/local install
21+
# Hadrian just outputs "gcc" as the name of gcc, without accounting for $TARGET. Manually fix up the paths:
22+
RUN sed -e 's/"\(gcc\|g++\|ld\)"/"'"$TARGET"'-\1"/g' -i /usr/local/lib/$TARGET-ghc-*/lib/settings
23+
24+
# Due to an apparent cabal bug, we specify our options directly to cabal
25+
# It won't reuse caches if ghc-options are specified in ~/.cabal/config
26+
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"
27+
28+
# Prebuild the dependencies
29+
RUN cabal update && IFS=';' && cabal install --dependencies-only $CABALOPTS ShellCheck
4330

4431
# Copy the build script
45-
COPY build /chroot/bin/build
46-
ENTRYPOINT ["/bin/scutil", "emu", "/bin/build"]
32+
COPY build /usr/bin
33+
34+
WORKDIR /scratch
35+
ENTRYPOINT ["/usr/bin/build"]

builders/linux.riscv64/build

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
#!/bin/sh
22
set -xe
3-
IFS=';'
43
{
5-
mkdir -p /tmp/scratch
6-
cd /tmp/scratch
74
tar xzv --strip-components=1
85
chmod +x striptests && ./striptests
9-
# Use a freeze file to ensure we use the same dependencies we cached during
10-
# the docker image build. We don't want to spend time compiling anything new.
11-
cp /etc/cabal.project.freeze .
126
mkdir "$TARGETNAME"
13-
# Retry in case of random segfault
14-
scutil retry 3 cabal build --enable-executable-static
7+
( IFS=';'; cabal build $CABALOPTS --enable-executable-static )
158
find . -name shellcheck -type f -exec mv {} "$TARGETNAME/" \;
169
ls -l "$TARGETNAME"
1710
"$TARGET-strip" -s "$TARGETNAME/shellcheck"
1811
ls -l "$TARGETNAME"
19-
"$TARGETNAME/shellcheck" --version
12+
"qemu-${TARGET%%-*}-static" "$TARGETNAME/shellcheck" --version
2013
} >&2
2114
tar czv "$TARGETNAME"

0 commit comments

Comments
 (0)