-
Notifications
You must be signed in to change notification settings - Fork 491
Add a feature for Haskell (GHC) #470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
GHCUP_VERSION="0.1.19.2" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, please use the bootstrap script to always get the latest ghcup. Pinning ghcup version is not recommended. |
||
GHCUP_BIN="x86_64-linux-ghcup-${GHCUP_VERSION}" | ||
brendandburns marked this conversation as resolved.
Show resolved
Hide resolved
|
||
BOOTSTRAP_HASKELL_GHC_VERSION="${VERSION:-"recommended "}" | ||
|
||
# Maybe install curl, gcc, make | ||
for x in curl gcc make; do | ||
which $x > /dev/null || (apt update && apt install $x -y -qq) | ||
done | ||
|
||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh | ||
|
||
GHCUP_DIR=~/.ghcup/bin | ||
brendandburns marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mkdir -p $GHCUP_DIR | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should add a new user group Ref: https://github.com/devcontainers/features/blob/main/src/ruby/install.sh#LL206-L209C7 & There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where
We have https://github.com/devcontainers/features/blob/main/src/ruby/install.sh#L39-L59 to automatically figure out the USERNAME There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure it's necessary, this will land in the home directory, but it doesn't really need a different username imho. |
||
curl https://downloads.haskell.org/~ghcup/${GHCUP_VERSION}/x86_64-linux-ghcup-${GHCUP_VERSION} --output ${GHCUP_BIN} | ||
brendandburns marked this conversation as resolved.
Show resolved
Hide resolved
|
||
echo "25b7fc417c1a811dd7ff439b67ea647a59cf5b8d71b274f97e917d50b2150d5b ${GHCUP_BIN}" | sha256sum --check --status | ||
|
||
mv ${GHCUP_BIN} $GHCUP_DIR/ghcup | ||
chmod a+x $GHCUP_DIR/ghcup | ||
|
||
${GHCUP_DIR}/ghcup install ghc $BOOTSTRAP_HASKELL_GHC_VERSION | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to not do all this manually, but use the bootstrap script, which allows fine grained control via env vars. E.g. curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_CABAL_VERSION=$CABALVERSION BOOTSTRAP_HASKELL_INSTALL_HLS=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=1 sh This will also try do adjust shell config to add Right now the bootstrap script assumes you want latest of stack and HLS, but I can add environment variables to control that as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh and the bootstrap script also creates a |
||
${GHCUP_DIR}/ghcup install cabal $CABAL_VERSION | ||
${GHCUP_DIR}/ghcup install hls $HLS_VERSION | ||
${GHCUP_DIR}/ghcup install stack $STACK_VERSION | ||
${GHCUP_DIR}/ghcup install cabal $CABALVERSION | ||
${GHCUP_DIR}/ghcup install hls $HLSVERSION | ||
${GHCUP_DIR}/ghcup install stack $STACKVERSION | ||
|
||
${GHCUP_DIR}/ghcup set ghc $BOOTSTRAP_HASKELL_GHC_VERSION | ||
${GHCUP_DIR}/ghcup set cabal $CABAL_VERSION | ||
${GHCUP_DIR}/ghcup set hls $HLS_VERSION | ||
${GHCUP_DIR}/ghcup set stack $STACK_VERSION | ||
${GHCUP_DIR}/ghcup set cabal $CABALVERSION | ||
${GHCUP_DIR}/ghcup set hls $HLSVERSION | ||
${GHCUP_DIR}/ghcup set stack $STACKVERSION | ||
brendandburns marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,7 @@ | |
"default_version": { | ||
"image": "ubuntu:jammy", | ||
"features": { | ||
"haskell": { | ||
} | ||
"haskell": {} | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.