Skip to content
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

Allow control of version for hls and stack during bootstrap #1104

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions scripts/bootstrap/bootstrap-haskell
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
# * BOOTSTRAP_HASKELL_CABAL_XDG - don't disable the XDG logic (this doesn't force XDG though, because cabal is confusing)
# * BOOTSTRAP_HASKELL_INSTALL_NO_STACK - disable installation of stack
# * BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK - disable installation stack ghcup hook
# * BOOTSTRAP_HASKELL_INSTALL_HLS - whether to install latest hls
# * BOOTSTRAP_HASKELL_STACK_VERSION - the stack version to install
# * BOOTSTRAP_HASKELL_INSTALL_HLS - whether to install hls
# * BOOTSTRAP_HASKELL_HLS_VERSION - the hls version to install
# * BOOTSTRAP_HASKELL_ADJUST_BASHRC - whether to adjust PATH in bashrc (prepend)
# * BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG - whether to adjust mingw paths in cabal.config on windows
# * BOOTSTRAP_HASKELL_DOWNLOADER - which downloader to use (default: curl)
Expand Down Expand Up @@ -100,8 +102,8 @@ esac

: "${BOOTSTRAP_HASKELL_GHC_VERSION:=recommended}"
: "${BOOTSTRAP_HASKELL_CABAL_VERSION:=recommended}"


: "${BOOTSTRAP_HASKELL_STACK_VERSION:=recommended}"
: "${BOOTSTRAP_HASKELL_HLS_VERSION:=recommended}"

warn() {
if [ -n "${NO_COLOR}" ] ; then
Expand Down Expand Up @@ -897,17 +899,20 @@ fi

case $ask_hls_answer in
1)
(_eghcup --cache install hls) || warn "HLS installation failed, continuing anyway"
(_eghcup --cache install hls "${BOOTSTRAP_HASKELL_HLS_VERSION}") ||
warn "HLS installation failed, continuing anyway"
;;
*) ;;
esac

case $ask_stack_answer in
1)
(_eghcup --cache install stack) || die "Stack installation failed"
(_eghcup --cache install stack "${BOOTSTRAP_HASKELL_STACK_VERSION}") ||
die "Stack installation failed"
;;
2)
(_eghcup --cache install stack) || die "Stack installation failed"
(_eghcup --cache install stack "${BOOTSTRAP_HASKELL_STACK_VERSION}") ||
die "Stack installation failed"
stack_root="$(find_stack_root)"
edo mkdir -p "${stack_root}"/hooks
hook_exe="${stack_root}"/hooks/ghc-install.sh
Expand Down
Loading