Skip to content

Commit 408177e

Browse files
committed
Fix building container + set default resolver to nightly
1 parent fe56df7 commit 408177e

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

.devcontainer/Dockerfile

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM debian:bullseye-slim as base
1+
FROM debian:bookworm-slim as base
22

33
ENV LANG C.UTF-8
44

5-
ARG GHC_VERSION=9.4.4
5+
ARG GHC_VERSION=9.6.3
66
ARG STACK_VERSION=recommended
7-
ARG STACK_RESOLVER=default
7+
ARG STACK_RESOLVER=nightly
88
ARG CABAL_VERSION=recommended
99
ARG HLS_VERSION=recommended
10-
ARG LLVM_VERSION=14
10+
ARG LLVM_VERSION=17
1111

1212
ENV USERNAME=vscode \
1313
USER_UID=1000 \
@@ -22,10 +22,16 @@ ENV USERNAME=vscode \
2222

2323
RUN ulimit -n 8192
2424

25-
RUN apt-get update
26-
RUN apt-get install -y --no-install-recommends apt-utils bash build-essential ca-certificates curl gcc git gnupg libffi-dev libffi7 libgmp-dev libgmp-dev libgmp10 libicu-dev libncurses-dev libncurses5 libnuma1 libnuma-dev libtinfo5 lsb-release make procps software-properties-common sudo wget xz-utils z3 zlib1g-dev
27-
28-
RUN wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && chmod +x /tmp/llvm.sh && /tmp/llvm.sh ${LLVM_VERSION} && rm /tmp/llvm.sh
25+
RUN VERSION_CODENAME=$(grep VERSION_CODENAME /etc/os-release | cut -d'=' -f2) && \
26+
apt-get update && \
27+
apt-get install -y --no-install-recommends software-properties-common wget && \
28+
# I don't know why, nor do I have any mental capacity to figure it out,
29+
# but we need to add the repository twice, otherwise it doesn't work (repo isn't being added)
30+
add-apt-repository -y -s -n "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${LLVM_VERSION} main" && \
31+
add-apt-repository -y -s -n "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${LLVM_VERSION} main" && \
32+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
33+
apt-get update && \
34+
apt-get install -y --no-install-recommends apt-utils bash build-essential ca-certificates curl gcc git gnupg libffi-dev libffi8 libgmp-dev libgmp-dev libgmp10 libicu-dev libncurses-dev libncurses5 libnuma1 libnuma-dev libtinfo5 lsb-release make procps sudo xz-utils z3 zlib1g-dev clang-$LLVM_VERSION lldb-$LLVM_VERSION lld-$LLVM_VERSION clangd-$LLVM_VERSION
2935

3036
RUN groupadd --gid ${USER_GID} ${USERNAME} && \
3137
useradd -ms /bin/bash -K MAIL_DIR=/dev/null --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME} && \
@@ -66,7 +72,6 @@ RUN ((stack ghc -- --version 2>/dev/null) || true) && \
6672
# Set global defaults for stack.
6773
stack config --system-ghc set system-ghc true --global && \
6874
stack config --system-ghc set install-ghc false --global && \
69-
test "${STACK_RESOLVER}" = 'default' && export STACK_RESOLVER=$(stack ls snapshots remote | grep -B1 "\(ghc-${GHC_VERSION}\)" | head -2 | sed -n -e 's/^Resolver name: \(\S\+\)$/\1/p'); \
7075
stack config --system-ghc set resolver ${STACK_RESOLVER}
7176

7277
# Set global custom defaults for stack.
@@ -79,21 +84,21 @@ FROM tooling as packages
7984

8085
# Install global packages.
8186
# Versions are pinned, since we don't want to accidentally break anything (by always installing latest).
82-
RUN cabal install --haddock-hoogle \
83-
# fsnotify-0.3.0.1 \
87+
RUN cabal install --haddock-hoogle --minimize-conflict-set \
88+
fsnotify-0.4.1.0 \
8489
haskell-dap-0.0.16.0 \
85-
ghci-dap-0.0.20.0 \
90+
ghci-dap-0.0.22.0 \
8691
haskell-debug-adapter-0.0.39.0 \
87-
hlint-3.5 \
88-
apply-refact-0.11.0.0 \
89-
retrie-1.2.1.1 \
92+
hlint-3.6.1 \
93+
apply-refact-0.14.0.0 \
94+
retrie-1.2.2 \
9095
hoogle-5.0.18.3 \
91-
ormolu-0.5.2.0
96+
ormolu-0.7.2.0
9297

93-
#FROM packages as hoogle
98+
FROM packages as hoogle
9499

95100
# Generate hoogle db
96-
#RUN hoogle generate && stack hoogle
101+
RUN hoogle generate --download --haskell
97102

98103
ENV DEBIAN_FRONTEND=dialog
99104

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"build": {
66
"args": {
77
"USERNAME": "vscode",
8-
"GHC_VERSION": "9.4.4",
8+
"GHC_VERSION": "9.6.3",
99
"STACK_VERSION": "recommended",
10-
"STACK_RESOLVER": "default",
10+
"STACK_RESOLVER": "nightly",
1111
"CABAL_VERSION": "recommended",
1212
"HLS_VERSION": "recommended",
13-
"LLVM_VERSION": "14"
13+
"LLVM_VERSION": "17"
1414
},
1515
"context": "..",
1616
"dockerfile": "Dockerfile"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# (A highly opinionated) Docker image for Haskell development
1+
# A (highly opinionated) Docker image for Haskell development
22

33
**Note**: The way this container setup is very opinionaed, you may want to check out [an official dev containter for Haskell](https://github.com/microsoft/vscode-dev-containers/tree/main/containers/haskell).
44

55
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
66
**Table of Contents**
77

8-
- [(A highly opinionated) Docker image for Haskell development](#a-highly-opinionated-docker-image-for-haskell-development)
8+
- [A (highly opinionated) Docker image for Haskell development](#a-highly-opinionated-docker-image-for-haskell-development)
99
- [Visual Studio Code: DevContainer for Haskell](#visual-studio-code-devcontainer-for-haskell)
1010
- [What is this](#what-is-this)
1111
- [How to use this](#how-to-use-this)

0 commit comments

Comments
 (0)