From 6948f41f18ef7871d45da2e29128ff159542638c Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 10 Nov 2022 13:47:11 -0600 Subject: [PATCH 01/27] Allow installing HLS from source --- .github/workflows/workflow.yaml | 13 +++--- Dockerfile | 76 +++++++++++++++++---------------- aws/image.yaml | 7 ++- aws/manifest.yaml | 4 +- 4 files changed, 55 insertions(+), 45 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 9e2fdc0..6937156 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -7,10 +7,10 @@ jobs: arch: - amd64 - arm64 - ghc: - - 9.0.2 - - 9.2.4 - - 9.4.2 + include: + - { ghc: 9.0.2, hls: 1.8.0.0 } + - { ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } + - { ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } runs-on: ubuntu-latest steps: @@ -27,6 +27,7 @@ jobs: env-vars-for-codebuild: GHC_VERSION env: GHC_VERSION: ${{ matrix.ghc }} + HLS_VERSION: ${{ matrix.hls }} manifest: needs: image @@ -34,8 +35,8 @@ jobs: matrix: ghc: - 9.0.2 - - 9.2.4 - - 9.4.2 + - 9.2.5 + - 9.4.3 runs-on: ubuntu-latest steps: diff --git a/Dockerfile b/Dockerfile index 7c75dd0..a697c73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,20 +47,20 @@ ARG GHCUP_VERSION=0.1.18.0 RUN \ set -o errexit -o xtrace; \ if test -n "$GHCUP_VERSION"; then \ - curl --output ~/.ghcup/bin/ghcup "https://downloads.haskell.org/ghcup/$GHCUP_VERSION/$( uname --machine )-linux-ghcup-$GHCUP_VERSION"; \ - chmod --verbose +x ~/.ghcup/bin/ghcup; \ - ghcup --version; \ + curl --output ~/.ghcup/bin/ghcup "https://downloads.haskell.org/ghcup/$GHCUP_VERSION/$( uname --machine )-linux-ghcup-$GHCUP_VERSION"; \ + chmod --verbose +x ~/.ghcup/bin/ghcup; \ + ghcup --version; \ fi # Install GHC. -ARG GHC_VERSION=9.4.2 +ARG GHC_VERSION=9.0.2 RUN \ set -o errexit -o xtrace; \ if test -n "$GHC_VERSION"; then \ - ghcup install ghc "$GHC_VERSION" --set; \ - ghcup gc --profiling-libs --share-dir; \ - ghc --version; \ + ghcup install ghc "$GHC_VERSION" --set; \ + ghcup gc --profiling-libs --share-dir; \ + ghc --version; \ fi # Install Cabal. @@ -69,56 +69,60 @@ ARG CABAL_VERSION=3.8.1.0 RUN \ set -o errexit -o xtrace; \ if test -n "$CABAL_VERSION"; then \ - ghcup install cabal "$CABAL_VERSION" --set; \ - cabal --version; \ + ghcup install cabal "$CABAL_VERSION" --set; \ + cabal --version; \ fi -# Install Stack. +# Configure Cabal. -ARG STACK_VERSION=2.9.1 +ARG CABAL_STORE=/cabal-store RUN \ set -o errexit -o xtrace; \ - if test -n "$STACK_VERSION"; then \ - ghcup install stack "$STACK_VERSION" --set; \ - stack --version; \ + if command -v cabal; then \ + sudo mkdir --mode 0775 --parents --verbose "$CABAL_STORE"; \ + sudo chown --verbose "$USER_NAME" "$CABAL_STORE"; \ + sudo chgrp --verbose sudo "$CABAL_STORE"; \ + cabal user-config init --augment "store-dir: $CABAL_STORE"; \ fi -# Install HLS. +# Install Stack. -ARG HLS_VERSION=1.8.0.0 +ARG STACK_VERSION=2.9.1 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; \ + if test -n "$STACK_VERSION"; then \ + ghcup install stack "$STACK_VERSION" --set; \ + stack --version; \ fi -# Configure Cabal. +# Configure Stack. -ARG CABAL_STORE=/cabal-store +ARG STACK_ROOT=/stack-root RUN \ set -o errexit -o xtrace; \ - if command -v cabal; then \ - sudo mkdir --mode 0775 --parents --verbose "$CABAL_STORE"; \ - sudo chown --verbose "$USER_NAME" "$CABAL_STORE"; \ - sudo chgrp --verbose sudo "$CABAL_STORE"; \ - cabal user-config init --augment "store-dir: $CABAL_STORE"; \ + if command -v stack; then \ + sudo mkdir --mode 0775 --parents --verbose "$STACK_ROOT"; \ + sudo chown --verbose "$USER_NAME" "$STACK_ROOT"; \ + sudo chgrp --verbose sudo "$STACK_ROOT"; \ + stack config set install-ghc --global false; \ + stack config set system-ghc --global true; \ fi +ENV STACK_ROOT="$STACK_ROOT" -# Configure Stack. +# Install HLS. -ARG STACK_ROOT=/stack-root +ARG HLS_VERSION=1.8.0.0 RUN \ set -o errexit -o xtrace; \ - if command -v stack; then \ - sudo mkdir --mode 0775 --parents --verbose "$STACK_ROOT"; \ - sudo chown --verbose "$USER_NAME" "$STACK_ROOT"; \ - sudo chgrp --verbose sudo "$STACK_ROOT"; \ - stack config set install-ghc --global false; \ - stack config set system-ghc --global true; \ + if test -n "$HLS_VERSION"; then \ + if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION"; \ + else \ + ghcup install hls "$HLS_VERSION" --set; \ + fi; \ + ghcup gc --hls-no-ghc; \ + haskell-language-server-wrapper --version; \ fi -ENV STACK_ROOT="$STACK_ROOT" # Configure volumes. diff --git a/aws/image.yaml b/aws/image.yaml index eaf21e2..44a135f 100644 --- a/aws/image.yaml +++ b/aws/image.yaml @@ -5,7 +5,10 @@ env: DOCKER_USERNAME: docker-hub-read-only:DOCKER_USERNAME variables: AWS_REGION: us-east-1 - GHC_VERSION: 9.2.4 + # These values are simply the defaults. They are typically overriden by + # the workflow in `.github/workflows/workflow.yaml`. + GHC_VERSION: 9.0.2 + HLS_VERSION: 1.8.0.0 phases: build: commands: @@ -24,6 +27,6 @@ phases: - echo "$tag" - - docker build --build-arg GHC_VERSION="$GHC_VERSION" --tag "$tag" . + - docker build --build-arg GHC_VERSION="$GHC_VERSION" --build-arg HLS_VERSION="$HLS_VERSION" --tag "$tag" . - docker push "$tag" diff --git a/aws/manifest.yaml b/aws/manifest.yaml index 979d287..360a8d2 100644 --- a/aws/manifest.yaml +++ b/aws/manifest.yaml @@ -2,7 +2,9 @@ version: 0.2 env: variables: AWS_REGION: us-east-1 - GHC_VERSION: 9.2.4 + # This value is simply the default. It is typically overriden by the + # workflow in `.github/workflows/workflow.yaml`. + GHC_VERSION: 9.0.2 phases: build: commands: From 926b2a921f8b9ad9d46aec78dfaec0b715321df6 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 10 Nov 2022 14:00:18 -0600 Subject: [PATCH 02/27] Simplify build matrix --- .github/workflows/workflow.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 6937156..05e3e20 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -4,13 +4,13 @@ jobs: image: strategy: matrix: - arch: - - amd64 - - arm64 include: - - { ghc: 9.0.2, hls: 1.8.0.0 } - - { ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } - - { ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } + - { arch: amd64, ghc: 9.0.2, hls: 1.8.0.0 } + - { arch: arm64, ghc: 9.0.2, hls: 1.8.0.0 } + - { arch: amd64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } + - { arch: arm64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } + - { arch: amd64, ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } + - { arch: arm64, ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } runs-on: ubuntu-latest steps: From 26147ae6bbd06f8f52873ca98ebdc5e3295cc2fa Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Thu, 10 Nov 2022 14:28:33 -0600 Subject: [PATCH 03/27] Fix CodeBuild environment variables --- .github/workflows/workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 05e3e20..f5aab99 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -24,7 +24,7 @@ jobs: with: project-name: docker-haskell-${{ matrix.arch }} buildspec-override: aws/image.yaml - env-vars-for-codebuild: GHC_VERSION + env-vars-for-codebuild: GHC_VERSION,HLS_VERSION env: GHC_VERSION: ${{ matrix.ghc }} HLS_VERSION: ${{ matrix.hls }} From 2f791c72bbf6caa651fa4ebb5b118c12ca9ae290 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 12:54:32 -0600 Subject: [PATCH 04/27] try telling ghc to only use 8G --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a697c73..420f26f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION"; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M8G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 3d1730e4bb0b652a251992724374d48b989c1583 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 12:55:51 -0600 Subject: [PATCH 05/27] limit build matrix --- .github/workflows/workflow.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index f5aab99..d5cac6f 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -5,12 +5,8 @@ jobs: strategy: matrix: include: - - { arch: amd64, ghc: 9.0.2, hls: 1.8.0.0 } - - { arch: arm64, ghc: 9.0.2, hls: 1.8.0.0 } - { arch: amd64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } - { arch: arm64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } - - { arch: amd64, ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } - - { arch: arm64, ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } runs-on: ubuntu-latest steps: From ff4d0741fd840586caf7f001e6b3768ad5aab704 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 13:08:59 -0600 Subject: [PATCH 06/27] activate compacting collector after 1GB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I misunderstood this flag, here's the docs for the related `-c` that helped me understand it: > Automatically enable compacting collection when the live data exceeds ⟨n⟩% of the maximum heap size (see the -M ⟨size⟩ option). Note that the maximum heap size is unlimited by default, so this option has no effect unless the maximum heap size is set with -M ⟨size⟩. https://downloads.haskell.org/~ghc/9.2.5/docs/html/users_guide/runtime_control.html?highlight=compacting#rts-flag--c%20%E2%9F%A8n%E2%9F%A9 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 420f26f..bc53d3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M8G -RTS'; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 0eb1dbfbdbebf8e06458935b80e511947e75800c Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 13:26:42 -0600 Subject: [PATCH 07/27] return memory to OS sooner https://downloads.haskell.org/~ghc/9.2.5/docs/html/users_guide/runtime_control.html?highlight=compacting#rts-flag--Fd%20%E2%9F%A8factor%E2%9F%A9 https://well-typed.com/blog/2021/03/memory-return/ --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bc53d3f..b0cface 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -Fd 1 -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 6f4357151b5e98d838e17d586db6eaa5e477f788 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 13:32:42 -0600 Subject: [PATCH 08/27] manually specify default see if this at 1 caused an immediate OOM somehow or if I have syntax wrong but it threw an "exit code 9" still anyway --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b0cface..20d23e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -Fd 1 -RTS'; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -Fd 4 -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 4b836495eef0a0d7bd1ca4a39b829caa30677d0b Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 13:45:32 -0600 Subject: [PATCH 09/27] remove -Fd flag causing errors idk how to use it apparently and things passed without it --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 20d23e6..bc53d3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -Fd 4 -RTS'; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From e6f4a34fbee4aa550263fa2139d56192a5934cdf Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 13:46:21 -0600 Subject: [PATCH 10/27] try to get CI passing just for 9.2.5 --- .github/workflows/workflow.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index d5cac6f..33a9de8 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -30,9 +30,7 @@ jobs: strategy: matrix: ghc: - - 9.0.2 - 9.2.5 - - 9.4.3 runs-on: ubuntu-latest steps: From 308da173eaf2b2cf9b8eacefa93d183f99e716e0 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 13:54:01 -0600 Subject: [PATCH 11/27] add parallelism --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bc53d3f..81756fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ + ghcup compile hls --jobs --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From c7f3aa217c8aeae5bf8553e1436a4351ff9bedf4 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 14:00:08 -0600 Subject: [PATCH 12/27] specify number of cpus since I got a no parse error maybe only -j lets you use $NUMCPU --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 81756fc..72ed326 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --jobs --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ + ghcup compile hls --jobs 2 --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From b59ad47149ce72407b5d9f86d916b344b74cbf1f Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 14:30:50 -0600 Subject: [PATCH 13/27] add back 9.0.2 --- .github/workflows/workflow.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 33a9de8..918eed2 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -5,6 +5,8 @@ jobs: strategy: matrix: include: + - { arch: amd64, ghc: 9.0.2, hls: 1.8.0.0 } + - { arch: arm64, ghc: 9.0.2, hls: 1.8.0.0 } - { arch: amd64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } - { arch: arm64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } runs-on: ubuntu-latest @@ -30,6 +32,7 @@ jobs: strategy: matrix: ghc: + - 9.0.2 - 9.2.5 runs-on: ubuntu-latest steps: From 06aebef3d8dea8607292932ac83e7ba4fb089500 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 14:33:18 -0600 Subject: [PATCH 14/27] add back 9.4.3 --- .github/workflows/workflow.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 918eed2..f5aab99 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -9,6 +9,8 @@ jobs: - { arch: arm64, ghc: 9.0.2, hls: 1.8.0.0 } - { arch: amd64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } - { arch: arm64, ghc: 9.2.5, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } + - { arch: amd64, ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } + - { arch: arm64, ghc: 9.4.3, hls: 85f788135175a007d3db4ac911c4115b30ab9d87 } runs-on: ubuntu-latest steps: @@ -32,8 +34,9 @@ jobs: strategy: matrix: ghc: - - 9.0.2 + - 9.0.2 - 9.2.5 + - 9.4.3 runs-on: ubuntu-latest steps: From 22c6ebc42abbd26f519168fe5372a8b351f192d1 Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 14:37:03 -0600 Subject: [PATCH 15/27] try using -j --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 72ed326..d0d2944 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --jobs 2 --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ + ghcup compile hls -j --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From d29577f803a7c6f7362f216cbb2f691691f4714a Mon Sep 17 00:00:00 2001 From: codygman Date: Fri, 11 Nov 2022 14:46:32 -0600 Subject: [PATCH 16/27] just use nproc to specify num cpus --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d0d2944..62dfb74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls -j --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ + ghcup compile hls --jobs $(nproc) --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 66d8f6ea251936c67d4668f89818bba201beaaec Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 15:12:52 -0600 Subject: [PATCH 17/27] One job, bigger heap --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 62dfb74..e6ded32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --jobs $(nproc) --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M1G -RTS'; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M2G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 55fc0affb427000cb046d4b58c28da431544d873 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 15:59:33 -0600 Subject: [PATCH 18/27] Don't fail fast --- .github/workflows/workflow.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index f5aab99..a00607d 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -3,6 +3,7 @@ on: push jobs: image: strategy: + fail-fast: false matrix: include: - { arch: amd64, ghc: 9.0.2, hls: 1.8.0.0 } From 8fb5d9104f8fc97e538a7a9af66aaf139ac482d0 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 16:12:06 -0600 Subject: [PATCH 19/27] Compile HLS verbosely --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e6ded32..cfa3c1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M2G -RTS'; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" --verbose -- --ghc-options='+RTS -M2G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 8b9ddc60790e808d784939d913ee8a13c3a9e00b Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 16:12:47 -0600 Subject: [PATCH 20/27] Set GHC RTS options another way --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cfa3c1e..889f9ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,9 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" --verbose -- --ghc-options='+RTS -M2G -RTS'; \ + GHCRTS=-M2G; \ + export GHCRTS; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" --verbose; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 848223f862acbff5934ae323f34cbf688067e367 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 16:18:09 -0600 Subject: [PATCH 21/27] Revert "Set GHC RTS options another way" This reverts commit 8b9ddc60790e808d784939d913ee8a13c3a9e00b. --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 889f9ed..cfa3c1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,9 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - GHCRTS=-M2G; \ - export GHCRTS; \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" --verbose; \ + ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" --verbose -- --ghc-options='+RTS -M2G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 52ebcae348dd95c75f07ba07c388b93dd5ec4521 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 16:24:38 -0600 Subject: [PATCH 22/27] Fix verbose flag --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cfa3c1e..e30dffe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" --verbose -- --ghc-options='+RTS -M2G -RTS'; \ + ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M2G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From d366adfdf6b959cd1d77d122dd29304089fa207c Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 16:42:17 -0600 Subject: [PATCH 23/27] Try to force newer ghc-exactprint --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e30dffe..f78e9c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --ghc-options='+RTS -M2G -RTS'; \ + ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --constraint='ghc-exactprint > 1.6.0' --ghc-options='+RTS -M2G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From d878c8af20790bb27ee15de11143538a0acdd381 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 16:50:40 -0600 Subject: [PATCH 24/27] Try to override project index state --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f78e9c8..1bbb985 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --constraint='ghc-exactprint > 1.6.0' --ghc-options='+RTS -M2G -RTS'; \ + ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --constraint='ghc-exactprint > 1.6.0' --index-state='2022-11-11T21:44:45Z' --ghc-options='+RTS -M2G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From f9048e692cd00062f033f56346da4c9b0ae3371e Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Fri, 11 Nov 2022 17:15:34 -0600 Subject: [PATCH 25/27] Remove constraint --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1bbb985..95db446 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --constraint='ghc-exactprint > 1.6.0' --index-state='2022-11-11T21:44:45Z' --ghc-options='+RTS -M2G -RTS'; \ + ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --index-state='2022-11-11T21:44:45Z' --ghc-options='+RTS -M2G -RTS'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From bb0d0aaecb4abfb2429c7e34a63dc5b6eefeae6c Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Mon, 14 Nov 2022 08:05:10 -0600 Subject: [PATCH 26/27] Disable dynamic flag --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 95db446..1b120a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,7 +116,7 @@ RUN \ set -o errexit -o xtrace; \ if test -n "$HLS_VERSION"; then \ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'; then \ - ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --index-state='2022-11-11T21:44:45Z' --ghc-options='+RTS -M2G -RTS'; \ + ghcup --verbose compile hls --cabal-update --ghc "$GHC_VERSION" --git-describe-version --git-ref "$HLS_VERSION" -- --flags=-dynamic --ghc-options='+RTS -M2G -RTS' --index-state='2022-11-11T21:44:45Z'; \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ From 9e6f4e3e4bc082c549f3493c4e29d2d0c8afe035 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Mon, 14 Nov 2022 08:48:22 -0600 Subject: [PATCH 27/27] Try to slim down the image --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1b120a5..d203919 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,7 +120,8 @@ RUN \ else \ ghcup install hls "$HLS_VERSION" --set; \ fi; \ - ghcup gc --hls-no-ghc; \ + ghcup gc --cache --hls-no-ghc --tmpdirs; \ + rm --force --recursive --verbose /cabal-store/* ~/.cabal/{logs,packages,store}; \ haskell-language-server-wrapper --version; \ fi