on master help sign in
Install GHC via Stack

PPA does not yet include GHC 8.6.4

commita4b8cf413223ef639d932cfd2987b809db91df52 authorMichael Snoyman <michael@snoyman.com> dateWed 6 Mar 2019, 04:48 (8 years ago) parente364dd4
2 files changed+17−16
Dockerfile+3−1 debian-bootstrap.sh+14−15
Dockerfile+3−1
@@ -2,9 +2,11 @@ FROM fpco/pid1:18.04
22
33ENV HOME /home/stackage
44ENV LANG en_US.UTF-8
5+ENV GHCVER 8.6.4
6+ENV GHCDIR /home/stackage/.stack/programs/x86_64-linux/ghc-$GHCVER
57
68# NOTE: also update debian-bootstrap.sh when cuda version changes
7−ENV PATH /usr/local/cuda-10.0/bin:/opt/ghc/8.6.4/bin:/usr/sbin:/usr/bin:/sbin:/bin
9+ENV PATH /usr/local/cuda-10.0/bin:/home/stackage/.stack/programs/x86_64-linux/ghc-$GHCVER:/usr/sbin:/usr/bin:/sbin:/bin
810ENV CUDA_PATH /usr/local/cuda-10.0
911
1012ADD debian-bootstrap.sh /tmp/debian-bootstrap.sh
debian-bootstrap.sh+14−15
@@ -10,13 +10,21 @@
1010# instructions, see:
1111# http://www.stackage.org/install
1212
13−set -exu
13+set -exuo pipefail
1414
1515mkdir -p /home/stackage
1616
1717export LANG=C.UTF-8
1818export DEBIAN_FRONTEND=noninteractive
1919
20+# Get curl
21+apt-get update
22+apt-get install -y curl
23+
24+# Get Stack and GHC
25+curl -sSL https://get.haskellstack.org/ | sh -s - -d /usr/bin
26+stack setup --resolver ghc-$GHCVER
27+
2028apt-get update
2129
2230apt-get install -y \
@@ -146,11 +154,6 @@ apt-get install -y \
146154 zlib1g-dev \
147155 zsh
148156
149−GHCVER=8.6.4
150−
151−add-apt-repository ppa:hvr/ghc -y
152−apt-get install -y ghc-$GHCVER ghc-$GHCVER-dyn ghc-$GHCVER-htmldocs ghc-$GHCVER-prof
153−
154157# odbc
155158curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
156159curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
@@ -159,11 +162,6 @@ ACCEPT_EULA=Y apt-get install msodbcsql17 -y
159162
160163locale-gen en_US.UTF-8
161164
162−curl -sSL https://get.haskellstack.org/ | sh
163−
164−# Put documentation where we expect it
165−mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
166−
167165# llvm-7.0 for llvm-hs (separate since it needs wget)
168166wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
169167 && add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main" \
@@ -258,10 +256,6 @@ apt-add-repository multiverse \
258256export CLANG_PURE_LLVM_LIB_DIR=/usr/lib/llvm-6.0/lib;
259257export CLANG_PURE_LLVM_INCLUDE_DIR=/usr/lib/llvm-6.0/include;
260258
261−# finally run:
262−ldconfig
263−# EOF: don't build anything below this line
264−
265259# protoc, for proto-lens-combinators test suite
266260# Instructions from: https://google.github.io/proto-lens/installing-protoc.html
267261PROTOC_ZIP=protoc-3.3.0-linux-x86_64.zip
@@ -278,3 +272,8 @@ echo /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server > /etc/ld.so.conf.d/
278272echo /usr/lib/llvm-3.7/lib > /etc/ld.so.conf.d/llvm.conf
279273
280274ldconfig
275+# EOF: don't build anything below this line
276+
277+# Cleanup
278+apt-get clean
279+rm -rf /var/lib/apt/lists/*