From 086cc60cfba8ead8b7b38074069a2080992250aa Mon Sep 17 00:00:00 2001 From: Christopher Sasarak Date: Thu, 4 Jan 2024 13:29:12 -0600 Subject: [PATCH] Image featuring GHC 9.4.8 and cabal 3.10.2.0 (#16) * Image featuring GHC 9.4.8 and cabal 3.10.2.0 * Build ghc 9.4.8 image. --- .github/workflows/build-docker.yml | 1 + ghc-9.4.8/Dockerfile | 31 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ghc-9.4.8/Dockerfile diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index db7e215..0acc7d7 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -19,6 +19,7 @@ jobs: - ghc-8.10.7 - ghc-9.0.2 - ghc-9.4.7 + - ghc-9.4.8 steps: - uses: actions/checkout@v2 diff --git a/ghc-9.4.8/Dockerfile b/ghc-9.4.8/Dockerfile new file mode 100644 index 0000000..65f4d53 --- /dev/null +++ b/ghc-9.4.8/Dockerfile @@ -0,0 +1,31 @@ +# There are more recent versions of Alpine. +# However, they have a version of pkg-config which changed its output in a way cabal doesn't understand. +# See: https://github.com/haskell/cabal/issues/8923 +# There is a workaround script, but I don't think it's worth it since alpine:3.16 is still maintained as of 9/2023. +# If you try to upgrade and have trouble building, it may be related to the above. + +FROM alpine:3.16 +# Install deps for: +# - ghc/cabal: curl gcc g++ gmp-dev ncurses-dev libffi-dev make xz tar perl zlib-dev +# - repo clone: git +# - static builds: zlib-static HACK(broken-ghc-musl): ncurses-static +# - random haskell libraries with cbits (basement): binutils-gold +# - to use embedded binaries in development (ie themis): libc6-compat +# - for nix installation via github action cachix/install-nix-action: sudo +RUN apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static bash sudo libc6-compat git-lfs + +# Install system deps for FOSSA CLI: +RUN apk --no-cache add bash xz-libs xz-dev bzip2-dev bzip2-static upx curl jq + +# manual installation of ghcup -- the install script doesn't work headless +RUN mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup +ENV PATH="/root/.cabal/bin:/root/.ghcup/bin:$PATH" + +RUN ghcup install ghc 9.4.8 + +RUN ghcup set ghc 9.4.8 +RUN ghcup install cabal 3.10.2.0 + +# Sets USER environment to overcome issue, as described in: +# https://github.com/cachix/install-nix-action/issues/122 +ENV USER=guest