@@ -4,6 +4,10 @@ RUN apt-get update && \
4
4
apt-get install -y \
5
5
# ghcup requirements
6
6
build-essential curl libffi-dev libffi8 libgmp-dev libgmp10 libncurses-dev libncurses6 libtinfo6 \
7
+ # Although ghcup's version of GHC shouldn't require libnuma, the aarch64 \
8
+ # version does impose this requirement for unknown reasons. \
9
+ # (See https://gitlab.haskell.org/ghc/ghc/-/issues/20876#note_399802) \
10
+ libnuma1 \
7
11
# SAW dependencies
8
12
pkg-config zlib1g-dev \
9
13
# Miscellaneous
@@ -16,8 +20,18 @@ ENV LANG=C.UTF-8 \
16
20
LC_ALL=C.UTF-8
17
21
COPY cabal.GHC-9.4.8.config cabal.project.freeze
18
22
ENV PATH=/home/saw/ghcup-download/bin:/home/saw/.ghcup/bin:$PATH
19
- RUN mkdir -p /home/saw/ghcup-download/bin && \
20
- curl -L https://downloads.haskell.org/~ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 -o /home/saw/ghcup-download/bin/ghcup && \
23
+ ARG TARGETPLATFORM
24
+ RUN case ${TARGETPLATFORM} in \
25
+ "linux/amd64" ) \
26
+ GHCUP_ARCH=x86_64 ;; \
27
+ "linux/arm64" | "linux/arm64/v8" ) \
28
+ GHCUP_ARCH=aarch64 ;; \
29
+ *) \
30
+ printf "Unsupported architecture: %s\n " "${TARGETPLATFORM}" >&2 \
31
+ exit 1 ;; \
32
+ esac && \
33
+ mkdir -p /home/saw/ghcup-download/bin && \
34
+ curl -L https://downloads.haskell.org/~ghcup/0.1.19.5/${GHCUP_ARCH}-linux-ghcup-0.1.19.5 -o /home/saw/ghcup-download/bin/ghcup && \
21
35
chmod +x /home/saw/ghcup-download/bin/ghcup
22
36
RUN mkdir -p /home/saw/.ghcup && \
23
37
ghcup --version && \
@@ -26,13 +40,21 @@ RUN mkdir -p /home/saw/.ghcup && \
26
40
ghcup set ghc 9.4.8
27
41
RUN cabal v2-update && cabal v2-build -j exe:saw-remote-api
28
42
RUN mkdir -p /home/saw/rootfs/usr/local/bin
29
- RUN cp $(cabal v2-exec which saw-remote-api) /home/saw/rootfs/usr/local/bin/saw-remote-api
43
+ RUN cp $(cabal -v0 list-bin exe: saw-remote-api) /home/saw/rootfs/usr/local/bin/saw-remote-api
30
44
WORKDIR /home/saw//rootfs/usr/local/bin
31
45
# The URL here is based on the same logic used to specify BUILD_TARGET_OS and
32
- # BUILD_TARGET_ARCH in `.github/workflow/ci.yml`, but specialized to x86-64
33
- # Ubuntu.
46
+ # BUILD_TARGET_ARCH in `.github/workflow/ci.yml`, but specialized to Ubuntu.
34
47
# If updating the snapshot version, update ci.yml and saw/Dockerfile too.
35
- RUN curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20250326/ubuntu-24.04-X64-bin.zip"
48
+ RUN case ${TARGETPLATFORM} in \
49
+ "linux/amd64" ) \
50
+ WHAT4_SOLVERS_ARCH=X64 ;; \
51
+ "linux/arm64" | "linux/arm64/v8" ) \
52
+ WHAT4_SOLVERS_ARCH=ARM64 ;; \
53
+ *) \
54
+ printf "Unsupported architecture: %s\n " "${TARGETPLATFORM}" >&2 \
55
+ exit 1 ;; \
56
+ esac && \
57
+ curl -o solvers.zip -sL "https://github.com/GaloisInc/what4-solvers/releases/download/snapshot-20250326/ubuntu-24.04-${WHAT4_SOLVERS_ARCH}-bin.zip"
36
58
RUN unzip solvers.zip && rm solvers.zip && chmod +x *
37
59
USER root
38
60
RUN chown -R root:root /home/saw/rootfs
0 commit comments