diff --git a/Dockerfile b/Dockerfile index 7c42042..ec87c36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,7 @@ RUN \ # Install GHC. -ARG GHC_VERSION=9.0.2 +ARG GHC_VERSION=9.2.4 RUN \ set -o errexit -o xtrace; \ if test -n "$GHC_VERSION"; then \ @@ -83,17 +83,6 @@ RUN \ stack --version; \ fi -# Install HLS. - -ARG HLS_VERSION=1.7.0.0 -RUN \ - set -o errexit -o xtrace; \ - if test -n "$HLS_VERSION"; then \ - ghcup install hls "$HLS_VERSION" --set; \ - ghcup gc --hls-no-ghc; \ - haskell-language-server-wrapper --version; \ - fi - # Configure Cabal. ARG CABAL_STORE=/cabal-store @@ -106,6 +95,12 @@ RUN \ cabal user-config init --augment "store-dir: $CABAL_STORE"; \ fi +# Install HLS. + +ARG HLS_VERSION=1.7.0.0 +COPY install_hls.sh / +RUN bash /install_hls.sh + # Configure Stack. ARG STACK_ROOT=/stack-root diff --git a/install_hls.sh b/install_hls.sh new file mode 100644 index 0000000..7c75ae6 --- /dev/null +++ b/install_hls.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -o errexit -o xtrace; + +# shouldn't this get picked up from the docker environment? maybe not... +export HLS_VERSION="1.7.0.0" + +if [[ "$GHC_VERSION" == "9.2.4" ]]; then + if test -n "$HLS_VERSION"; then + ghcup compile hls -j1 -g 26a6ca607930b85bb1a2491b8deaf1a363c2e3df --ghc "$GHC_VERSION" --cabal-update + else + ghcup install hls "$HLS_VERSION" --set + fi + ghcup gc --hls-no-ghc; + haskell-language-server-wrapper --version +fi