@@ -47,20 +47,20 @@ ARG GHCUP_VERSION=0.1.18.0
47
47
RUN \
48
48
set -o errexit -o xtrace; \
49
49
if test -n "$GHCUP_VERSION" ; then \
50
- curl --output ~/.ghcup/bin/ghcup "https://downloads.haskell.org/ghcup/$GHCUP_VERSION/$( uname --machine )-linux-ghcup-$GHCUP_VERSION" ; \
51
- chmod --verbose +x ~/.ghcup/bin/ghcup; \
52
- ghcup --version; \
50
+ curl --output ~/.ghcup/bin/ghcup "https://downloads.haskell.org/ghcup/$GHCUP_VERSION/$( uname --machine )-linux-ghcup-$GHCUP_VERSION" ; \
51
+ chmod --verbose +x ~/.ghcup/bin/ghcup; \
52
+ ghcup --version; \
53
53
fi
54
54
55
55
# Install GHC.
56
56
57
- ARG GHC_VERSION=9.4 .2
57
+ ARG GHC_VERSION=9.0 .2
58
58
RUN \
59
59
set -o errexit -o xtrace; \
60
60
if test -n "$GHC_VERSION" ; then \
61
- ghcup install ghc "$GHC_VERSION" --set; \
62
- ghcup gc --profiling-libs --share-dir; \
63
- ghc --version; \
61
+ ghcup install ghc "$GHC_VERSION" --set; \
62
+ ghcup gc --profiling-libs --share-dir; \
63
+ ghc --version; \
64
64
fi
65
65
66
66
# Install Cabal.
@@ -69,56 +69,61 @@ ARG CABAL_VERSION=3.8.1.0
69
69
RUN \
70
70
set -o errexit -o xtrace; \
71
71
if test -n "$CABAL_VERSION" ; then \
72
- ghcup install cabal "$CABAL_VERSION" --set; \
73
- cabal --version; \
72
+ ghcup install cabal "$CABAL_VERSION" --set; \
73
+ cabal --version; \
74
74
fi
75
75
76
- # Install Stack .
76
+ # Configure Cabal .
77
77
78
- ARG STACK_VERSION=2.9.1
78
+ ARG CABAL_STORE=/cabal-store
79
79
RUN \
80
80
set -o errexit -o xtrace; \
81
- if test -n "$STACK_VERSION" ; then \
82
- ghcup install stack "$STACK_VERSION" --set; \
83
- stack --version; \
81
+ if command -v cabal; then \
82
+ sudo mkdir --mode 0775 --parents --verbose "$CABAL_STORE" ; \
83
+ sudo chown --verbose "$USER_NAME" "$CABAL_STORE" ; \
84
+ sudo chgrp --verbose sudo "$CABAL_STORE" ; \
85
+ cabal user-config init --augment "store-dir: $CABAL_STORE" ; \
84
86
fi
85
87
86
- # Install HLS .
88
+ # Install Stack .
87
89
88
- ARG HLS_VERSION=1.8.0.0
90
+ ARG STACK_VERSION=2.9.1
89
91
RUN \
90
92
set -o errexit -o xtrace; \
91
- if test -n "$HLS_VERSION" ; then \
92
- ghcup install hls "$HLS_VERSION" --set; \
93
- ghcup gc --hls-no-ghc; \
94
- haskell-language-server-wrapper --version; \
93
+ if test -n "$STACK_VERSION" ; then \
94
+ ghcup install stack "$STACK_VERSION" --set; \
95
+ stack --version; \
95
96
fi
96
97
97
- # Configure Cabal .
98
+ # Configure Stack .
98
99
99
- ARG CABAL_STORE=/cabal-store
100
+ ARG STACK_ROOT=/stack-root
100
101
RUN \
101
102
set -o errexit -o xtrace; \
102
- if command -v cabal; then \
103
- sudo mkdir --mode 0775 --parents --verbose "$CABAL_STORE" ; \
104
- sudo chown --verbose "$USER_NAME" "$CABAL_STORE" ; \
105
- sudo chgrp --verbose sudo "$CABAL_STORE" ; \
106
- cabal user-config init --augment "store-dir: $CABAL_STORE" ; \
103
+ if command -v stack; then \
104
+ sudo mkdir --mode 0775 --parents --verbose "$STACK_ROOT" ; \
105
+ sudo chown --verbose "$USER_NAME" "$STACK_ROOT" ; \
106
+ sudo chgrp --verbose sudo "$STACK_ROOT" ; \
107
+ stack config set install-ghc --global false; \
108
+ stack config set system-ghc --global true; \
107
109
fi
110
+ ENV STACK_ROOT="$STACK_ROOT"
108
111
109
- # Configure Stack .
112
+ # Install HLS .
110
113
111
- ARG STACK_ROOT=/stack-root
114
+ ARG HLS_VERSION=1.8.0.0
112
115
RUN \
113
116
set -o errexit -o xtrace; \
114
- if command -v stack; then \
115
- sudo mkdir --mode 0775 --parents --verbose "$STACK_ROOT" ; \
116
- sudo chown --verbose "$USER_NAME" "$STACK_ROOT" ; \
117
- sudo chgrp --verbose sudo "$STACK_ROOT" ; \
118
- stack config set install-ghc --global false; \
119
- stack config set system-ghc --global true; \
117
+ if test -n "$HLS_VERSION" ; then \
118
+ if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$' ; then \
119
+ 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' ; \
120
+ else \
121
+ ghcup install hls "$HLS_VERSION" --set; \
122
+ fi; \
123
+ ghcup gc --cache --hls-no-ghc --tmpdirs; \
124
+ rm --force --recursive --verbose /cabal-store/* ~/.cabal/{logs,packages,store}; \
125
+ haskell-language-server-wrapper --version; \
120
126
fi
121
- ENV STACK_ROOT="$STACK_ROOT"
122
127
123
128
# Configure volumes.
124
129
0 commit comments