From de6e4a49ca2f55994f2092fb2beed3ca7f24b3f8 Mon Sep 17 00:00:00 2001 From: codygman Date: Mon, 29 Aug 2022 13:55:05 -0500 Subject: [PATCH 1/7] [sc-126569] compile hls with ghcup for 9.2.4 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7c42042..47401d1 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 \ @@ -89,7 +89,7 @@ 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 compile hls -g 7760340e --ghc $GHC_VERSION -j4 --cabal-update; \ ghcup gc --hls-no-ghc; \ haskell-language-server-wrapper --version; \ fi From 1d1bf0be0edae6ef4a2fede2ff1221c1f9352974 Mon Sep 17 00:00:00 2001 From: codygman Date: Tue, 6 Sep 2022 09:35:07 -0500 Subject: [PATCH 2/7] [sc-126569] only compile ghc for 9.2.4 --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 47401d1..0d5e1a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,8 +88,12 @@ RUN \ ARG HLS_VERSION=1.7.0.0 RUN \ set -o errexit -o xtrace; \ - if test -n "$HLS_VERSION"; then \ - ghcup compile hls -g 7760340e --ghc $GHC_VERSION -j4 --cabal-update; \ + if [ "$GHC_VERSION" == "9.2.4"]; then \ + if test -n "$HLS_VERSION"; then \ + ghcup compile hls -g 7760340e --ghc $GHC_VERSION -j4 --cabal-update; \ + else \ + ghcup install hls "$HLS_VERSION" --set; \ + fi \ ghcup gc --hls-no-ghc; \ haskell-language-server-wrapper --version; \ fi From ec0b121c0ba2e182d6d517dd1b6f065925b5b987 Mon Sep 17 00:00:00 2001 From: codygman Date: Tue, 6 Sep 2022 09:51:17 -0500 Subject: [PATCH 3/7] [sc-126569] use external file for install hls I couldn't get the inline variant to work after adding nested conditionals. --- Dockerfile | 13 ++----------- install_hls.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 install_hls.sh diff --git a/Dockerfile b/Dockerfile index 0d5e1a5..e2557d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -86,17 +86,8 @@ RUN \ # Install HLS. ARG HLS_VERSION=1.7.0.0 -RUN \ - set -o errexit -o xtrace; \ - if [ "$GHC_VERSION" == "9.2.4"]; then \ - if test -n "$HLS_VERSION"; then \ - ghcup compile hls -g 7760340e --ghc $GHC_VERSION -j4 --cabal-update; \ - else \ - ghcup install hls "$HLS_VERSION" --set; \ - fi \ - ghcup gc --hls-no-ghc; \ - haskell-language-server-wrapper --version; \ - fi +COPY install_hls.sh / +RUN bash /install_hls.sh # Configure Cabal. diff --git a/install_hls.sh b/install_hls.sh new file mode 100644 index 0000000..712a9b8 --- /dev/null +++ b/install_hls.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -o errexit -o xtrace; \ + if [[ "$GHC_VERSION" == "9.2.4" ]]; then \ + if test -n "$HLS_VERSION"; then \ + ghcup compile hls -j4 -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 From b75511e1f764ad026e271c3916269e299b78da45 Mon Sep 17 00:00:00 2001 From: codygman Date: Tue, 6 Sep 2022 10:12:02 -0500 Subject: [PATCH 4/7] [sc-126569] remove line continuations in script Weird this works fine for me locally --- install_hls.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/install_hls.sh b/install_hls.sh index 712a9b8..3252f73 100644 --- a/install_hls.sh +++ b/install_hls.sh @@ -1,12 +1,13 @@ #!/usr/bin/env bash -set -o errexit -o xtrace; \ - if [[ "$GHC_VERSION" == "9.2.4" ]]; then \ - if test -n "$HLS_VERSION"; then \ - ghcup compile hls -j4 -g 26a6ca607930b85bb1a2491b8deaf1a363c2e3df --ghc $GHC_VERSION --cabal-update; \ - else \ - ghcup install hls "$HLS_VERSION" --set; \ +set -o errexit -o xtrace; + +if [[ "$GHC_VERSION" == "9.2.4" ]]; then + if test -n "$HLS_VERSION"; then + ghcup compile hls -j4 -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 + ghcup gc --hls-no-ghc; + haskell-language-server-wrapper --version +fi From b5c2aaa3fa67caa70049cf780c5c5cbd609f250c Mon Sep 17 00:00:00 2001 From: codygman Date: Tue, 6 Sep 2022 15:19:05 -0500 Subject: [PATCH 5/7] try -j1 to compile hls with actions --- install_hls.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_hls.sh b/install_hls.sh index 3252f73..dd7f357 100644 --- a/install_hls.sh +++ b/install_hls.sh @@ -4,7 +4,7 @@ set -o errexit -o xtrace; if [[ "$GHC_VERSION" == "9.2.4" ]]; then if test -n "$HLS_VERSION"; then - ghcup compile hls -j4 -g 26a6ca607930b85bb1a2491b8deaf1a363c2e3df --ghc "$GHC_VERSION" --cabal-update + ghcup compile hls -j1 -g 26a6ca607930b85bb1a2491b8deaf1a363c2e3df --ghc "$GHC_VERSION" --cabal-update else ghcup install hls "$HLS_VERSION" --set fi From 487d9a3fd086334966555e71f8861ece425c00a6 Mon Sep 17 00:00:00 2001 From: codygman Date: Tue, 6 Sep 2022 15:26:58 -0500 Subject: [PATCH 6/7] fix --- install_hls.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_hls.sh b/install_hls.sh index dd7f357..7c75ae6 100644 --- a/install_hls.sh +++ b/install_hls.sh @@ -2,6 +2,9 @@ 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 From 29b317f524959c1bfe7fd94169fff2050d957492 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Wed, 7 Sep 2022 14:24:07 -0500 Subject: [PATCH 7/7] Try to fix HLS install --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e2557d4..ec87c36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,12 +83,6 @@ RUN \ stack --version; \ fi -# Install HLS. - -ARG HLS_VERSION=1.7.0.0 -COPY install_hls.sh / -RUN bash /install_hls.sh - # Configure Cabal. ARG CABAL_STORE=/cabal-store @@ -101,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