Compare commits
1 Commits
v0.2
...
better-err
| Author | SHA1 | Date | |
|---|---|---|---|
|
3f968cb1c0
|
15
.cirrus.yml
15
.cirrus.yml
@@ -1,15 +0,0 @@
|
|||||||
freebsd_instance:
|
|
||||||
image_family: freebsd-13-1
|
|
||||||
|
|
||||||
task:
|
|
||||||
env:
|
|
||||||
GHC_VER: 9.2.4
|
|
||||||
CABAL_VER: 3.6.2.0
|
|
||||||
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
|
||||||
ARCH: 64
|
|
||||||
RUNNER_OS: FreeBSD
|
|
||||||
install_script: pkg install -y ghc hs-cabal-install git bash
|
|
||||||
script:
|
|
||||||
- bash .github/scripts/release.sh
|
|
||||||
binaries_artifacts:
|
|
||||||
path: "out/x86_64-portbld-freebsd-ghcup-*"
|
|
||||||
101
.github/scripts/release.sh
vendored
101
.github/scripts/release.sh
vendored
@@ -1,101 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
mkdir -p "$HOME"/.local/bin
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "macOS" ] ; then
|
|
||||||
if ! command -v brew ; then
|
|
||||||
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
|
|
||||||
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
|
||||||
brew update
|
|
||||||
fi
|
|
||||||
brew install git
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
apk add --no-cache \
|
|
||||||
curl \
|
|
||||||
gcc \
|
|
||||||
g++ \
|
|
||||||
binutils \
|
|
||||||
binutils-gold \
|
|
||||||
bsd-compat-headers \
|
|
||||||
gmp-dev \
|
|
||||||
ncurses-dev \
|
|
||||||
libffi-dev \
|
|
||||||
make \
|
|
||||||
xz \
|
|
||||||
tar \
|
|
||||||
perl \
|
|
||||||
bash \
|
|
||||||
git
|
|
||||||
|
|
||||||
apk add --no-cache \
|
|
||||||
zlib \
|
|
||||||
zlib-dev \
|
|
||||||
zlib-static \
|
|
||||||
bzip2 \
|
|
||||||
bzip2-dev \
|
|
||||||
bzip2-static \
|
|
||||||
gmp \
|
|
||||||
gmp-dev \
|
|
||||||
openssl-dev \
|
|
||||||
openssl-libs-static \
|
|
||||||
xz \
|
|
||||||
xz-dev \
|
|
||||||
ncurses-static
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v ghcup ; then
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
|
|
||||||
source ~/.ghcup/env
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" != "FreeBSD" ] ; then
|
|
||||||
ghcup install ghc --set --isolate="$HOME/.local" --force "$GHC_VER"
|
|
||||||
ghcup install cabal --isolate="$HOME/.local/bin" --force "$CABAL_VER"
|
|
||||||
ghc --version
|
|
||||||
cabal --version
|
|
||||||
fi
|
|
||||||
|
|
||||||
ecabal() {
|
|
||||||
cabal "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
git describe --all
|
|
||||||
|
|
||||||
# build
|
|
||||||
ecabal update
|
|
||||||
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
if [ "${ARCH}" = "32" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --ghc-options='-split-sections -optl-static' -ftui
|
|
||||||
elif [ "${ARCH}" = "64" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --ghc-options='-split-sections -optl-static' -ftui
|
|
||||||
else
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" -ftui
|
|
||||||
fi
|
|
||||||
elif [ "${RUNNER_OS}" = "FreeBSD" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --ghc-options='-split-sections' --constraint="zlib +bundled-c-zlib" --constraint="zip +disable-zstd" -ftui
|
|
||||||
elif [ "${RUNNER_OS}" = "Windows" ] ; then
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static"
|
|
||||||
else
|
|
||||||
ecabal build -w "ghc-${GHC_VER}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir out
|
|
||||||
binary=$(ecabal new-exec -w "ghc-${GHC_VER}" --verbose=0 --offline sh -- -c 'command -v ghcup')
|
|
||||||
ver=$("${binary}" --numeric-version)
|
|
||||||
if [ "${RUNNER_OS}" = "macOS" ] ; then
|
|
||||||
strip "${binary}"
|
|
||||||
else
|
|
||||||
if [ "${RUNNER_OS}" != "Windows" ] ; then
|
|
||||||
strip -s "${binary}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
cp "${binary}" "out/${ARTIFACT}-${ver}"
|
|
||||||
|
|
||||||
148
.github/workflows/release.yaml
vendored
148
.github/workflows/release.yaml
vendored
@@ -6,80 +6,104 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-linux:
|
draft_release:
|
||||||
name: Create Release x86_64
|
name: Draft Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref }}
|
||||||
|
body: |
|
||||||
|
Changes in this Release
|
||||||
|
- First Change
|
||||||
|
- Second Change
|
||||||
|
draft: true
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
release-mac:
|
||||||
|
name: Create Release
|
||||||
|
needs: draft_release
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
CABAL_VER: 3.6.2.0
|
|
||||||
CACHE_VER: 1
|
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.13
|
MACOSX_DEPLOYMENT_TARGET: 10.13
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
os:
|
||||||
- os: ubuntu-latest
|
- macOS-10.15
|
||||||
ARTIFACT: "i386-linux-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 32
|
|
||||||
- os: ubuntu-latest
|
|
||||||
ARTIFACT: "x86_64-linux-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
- os: [self-hosted, macOS, aarch64]
|
|
||||||
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: 64
|
|
||||||
- os: macOS-10.15
|
|
||||||
ARTIFACT: "x86_64-apple-darwin-ghcup"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: 64
|
|
||||||
- os: windows-latest
|
|
||||||
ARTIFACT: "x86_64-mingw64-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- if: matrix.ARCH == '32' && runner.os == 'Linux'
|
- uses: haskell/actions/setup@v1.2
|
||||||
name: Run release (32 bit linux)
|
|
||||||
uses: docker://i386/alpine:3.12
|
|
||||||
with:
|
with:
|
||||||
args: sh .github/scripts/release.sh
|
ghc-version: 8.10.7
|
||||||
env:
|
cabal-version: 3.6.2.0
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
|
|
||||||
- if: matrix.ARCH == '64' && runner.os == 'Linux'
|
- name: create ~/.local/bin
|
||||||
name: Run release (64 bit linux)
|
run: mkdir -p "$HOME/.local/bin"
|
||||||
uses: docker://alpine:3.12
|
shell: bash
|
||||||
|
|
||||||
|
- name: Add ~/.local/bin to PATH
|
||||||
|
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Update cabal cache
|
||||||
|
run: cabal update
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install cabal dependencies
|
||||||
|
run: cabal build --only-dependencies --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cabal build --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: cp "$(cabal list-bin exe:ghcup)" ~/.local/bin/ghcup
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Strip
|
||||||
|
run: strip ~/.local/bin/ghcup
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: cabal test --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" all
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Install git
|
||||||
|
run: brew install git
|
||||||
|
|
||||||
|
- name: set HOME
|
||||||
|
run: echo "HOME=$HOME" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Set ASSET_PATH
|
||||||
|
run: echo "ASSET_PATH=$HOME/.local/bin/ghcup" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Upload Release Asset
|
||||||
|
id: upload-release-asset
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
args: sh .github/scripts/release.sh
|
upload_url: ${{ needs.draft_release.outputs.upload_url }}
|
||||||
env:
|
asset_path: ${{ env.ASSET_PATH }}
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
asset_name: ghcup-${{ matrix.os }}
|
||||||
ARCH: ${{ matrix.ARCH }}
|
asset_content_type: application/octet-stream
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
|
|
||||||
- if: runner.os != 'Linux'
|
|
||||||
name: Run release (windows/mac)
|
|
||||||
run: bash .github/scripts/release.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
|
|
||||||
- if: always()
|
- if: always()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: artifacts
|
name: plan.json
|
||||||
path: |
|
path: ./dist-newstyle/cache/plan.json
|
||||||
./out/*
|
|
||||||
./dist-newstyle/cache/plan.json
|
|
||||||
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
files: |
|
|
||||||
./out/*
|
|
||||||
./dist-newstyle/cache/plan.json
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ optional-packages: ./vendored/*/*.cabal
|
|||||||
optimization: 2
|
optimization: 2
|
||||||
|
|
||||||
package ghcup
|
package ghcup
|
||||||
|
tests: True
|
||||||
flags: +tui
|
flags: +tui
|
||||||
|
|
||||||
source-repository-package
|
source-repository-package
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ library
|
|||||||
build-depends:
|
build-depends:
|
||||||
, bzlib
|
, bzlib
|
||||||
, process ^>=1.6.11.0
|
, process ^>=1.6.11.0
|
||||||
, Win32 >=2.10
|
, Win32 ^>=2.10
|
||||||
|
|
||||||
else
|
else
|
||||||
other-modules:
|
other-modules:
|
||||||
|
|||||||
@@ -360,13 +360,18 @@ deriving instance Show InstallSetError
|
|||||||
|
|
||||||
|
|
||||||
-- | A build failed.
|
-- | A build failed.
|
||||||
data BuildFailed = forall es . (ToVariantMaybe BuildFailed es, PopVariant BuildFailed es, Pretty (V es), Show (V es)) => BuildFailed FilePath (V es)
|
data BuildFailed = forall es . (ToVariantMaybe BuildFailed es, PopVariant BuildFailed es, Pretty (V es), Show (V es)) => BuildFailed FilePath (V es) (Just Requirements)
|
||||||
|
|
||||||
instance Pretty BuildFailed where
|
instance Pretty BuildFailed where
|
||||||
pPrint (BuildFailed path reason) =
|
pPrint (BuildFailed path reason req) =
|
||||||
case reason of
|
case reason of
|
||||||
VMaybe (_ :: BuildFailed) -> pPrint reason
|
VMaybe (_ :: BuildFailed) -> pPrint reason
|
||||||
_ -> text "BuildFailed failed in dir" <+> text (path <> ":") <+> pPrint reason
|
_ -> text "BuildFailed failed in dir" <+> text (path <> ":") <+> pPrint reason
|
||||||
|
<+> printToolReq'
|
||||||
|
where
|
||||||
|
printToolReq' = case req of
|
||||||
|
Nothing -> T.pack ""
|
||||||
|
Just req' -> prettyRequirementsError req'
|
||||||
|
|
||||||
deriving instance Show BuildFailed
|
deriving instance Show BuildFailed
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,17 @@ prettyRequirements Requirements {..} =
|
|||||||
n = if not . T.null $ _notes then "\n Note: " <> _notes else ""
|
n = if not . T.null $ _notes then "\n Note: " <> _notes else ""
|
||||||
in "System requirements " <> d <> n
|
in "System requirements " <> d <> n
|
||||||
|
|
||||||
|
|
||||||
|
prettyRequirementsError :: Requirements -> T.Text
|
||||||
|
prettyRequirementsError Requirements {..} =
|
||||||
|
let d = if not . null $ _distroPKGs
|
||||||
|
then "\nMake sure the following distro packages "
|
||||||
|
<> "are installed: "
|
||||||
|
<> T.intercalate " " _distroPKGs
|
||||||
|
else ""
|
||||||
|
n = if not . T.null $ _notes then "\nMake sure the following requirements are met: " <> _notes else ""
|
||||||
|
in d <> n
|
||||||
|
|
||||||
rawRequirements :: Requirements -> T.Text
|
rawRequirements :: Requirements -> T.Text
|
||||||
rawRequirements Requirements {..} =
|
rawRequirements Requirements {..} =
|
||||||
if not . null $ _distroPKGs
|
if not . null $ _distroPKGs
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
# * BOOTSTRAP_HASKELL_VERBOSE - any nonzero value for more verbose installation
|
# * BOOTSTRAP_HASKELL_VERBOSE - any nonzero value for more verbose installation
|
||||||
# * BOOTSTRAP_HASKELL_GHC_VERSION - the ghc version to install
|
# * BOOTSTRAP_HASKELL_GHC_VERSION - the ghc version to install
|
||||||
# * BOOTSTRAP_HASKELL_CABAL_VERSION - the cabal version to install
|
# * BOOTSTRAP_HASKELL_CABAL_VERSION - the cabal version to install
|
||||||
# * BOOTSTRAP_HASKELL_INSTALL_NO_STACK - disable installation of stack
|
# * BOOTSTRAP_HASKELL_INSTALL_STACK - whether to install latest stack
|
||||||
# * BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK - disable installation stack ghcup hook
|
|
||||||
# * BOOTSTRAP_HASKELL_INSTALL_HLS - whether to install latest hls
|
# * BOOTSTRAP_HASKELL_INSTALL_HLS - whether to install latest hls
|
||||||
# * BOOTSTRAP_HASKELL_ADJUST_BASHRC - whether to adjust PATH in bashrc (prepend)
|
# * 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_ADJUST_CABAL_CONFIG - whether to adjust mingw paths in cabal.config on windows
|
||||||
@@ -693,44 +692,40 @@ ask_hls() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ask_stack() {
|
ask_stack() {
|
||||||
if [ -n "${BOOTSTRAP_HASKELL_INSTALL_NO_STACK}" ] ; then
|
if [ -n "${BOOTSTRAP_HASKELL_INSTALL_STACK}" ] ; then
|
||||||
return 0
|
|
||||||
elif [ -n "${BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK}" ] ; then
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
||||||
echo "-------------------------------------------------------------------------------"
|
echo "-------------------------------------------------------------------------------"
|
||||||
|
|
||||||
warn "Do you want to enable better integration of stack with GHCup?"
|
warn "Do you want to install stack?"
|
||||||
warn "This means that stack won't install its own GHC versions, but uses GHCup's."
|
warn "Stack is a haskell build tool similar to cabal that is used by some projects."
|
||||||
warn "For more information see:"
|
warn "Also see https://docs.haskellstack.org/"
|
||||||
warn " https://docs.haskellstack.org/en/stable/yaml_configuration/#ghc-installation-customisation-experimental"
|
|
||||||
warn "If you want to keep stacks vanilla behavior, answer 'No'."
|
|
||||||
warn ""
|
warn ""
|
||||||
warn "[Y] Yes [N] No [?] Help (default is \"Y\")."
|
warn "[Y] Yes [N] No [?] Help (default is \"N\")."
|
||||||
warn ""
|
warn ""
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -r stack_answer </dev/tty
|
read -r stack_answer </dev/tty
|
||||||
|
|
||||||
case $stack_answer in
|
case $stack_answer in
|
||||||
[Yy]* | "")
|
[Yy]*)
|
||||||
return 2 ;;
|
|
||||||
[Nn]*)
|
|
||||||
return 1 ;;
|
return 1 ;;
|
||||||
|
[Nn]* | "")
|
||||||
|
return 0 ;;
|
||||||
*)
|
*)
|
||||||
echo "Possible choices are:"
|
echo "Possible choices are:"
|
||||||
echo
|
echo
|
||||||
echo "Y - Yes, enable better integration (default)"
|
echo "Y - Yes, install stack"
|
||||||
echo "N - No, keep stacks vanilla behavior"
|
echo "N - No, don't install anything more (default)"
|
||||||
echo
|
echo
|
||||||
echo "Please make your choice and press ENTER."
|
echo "Please make your choice and press ENTER."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
return 2
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset stack_answer
|
unset stack_answer
|
||||||
@@ -747,7 +742,7 @@ echo "This script can download and install the following binaries:"
|
|||||||
echo " * ghcup - The Haskell toolchain installer"
|
echo " * ghcup - The Haskell toolchain installer"
|
||||||
echo " * ghc - The Glasgow Haskell Compiler"
|
echo " * ghc - The Glasgow Haskell Compiler"
|
||||||
echo " * cabal - The Cabal build tool for managing Haskell software"
|
echo " * cabal - The Cabal build tool for managing Haskell software"
|
||||||
echo " * stack - A cross-platform program for developing Haskell projects (similar to cabal)"
|
echo " * stack - (optional) A cross-platform program for developing Haskell projects"
|
||||||
echo " * hls - (optional) A language server for developers to integrate with their editor/IDE"
|
echo " * hls - (optional) A language server for developers to integrate with their editor/IDE"
|
||||||
echo
|
echo
|
||||||
if [ -z "${GHCUP_USE_XDG_DIRS}" ] ; then
|
if [ -z "${GHCUP_USE_XDG_DIRS}" ] ; then
|
||||||
@@ -844,35 +839,7 @@ esac
|
|||||||
|
|
||||||
case $ask_stack_answer in
|
case $ask_stack_answer in
|
||||||
1)
|
1)
|
||||||
_eghcup --cache install stack || die "Stack installation failed"
|
_eghcup --cache install stack || warn "Stack installation failed, continuing anyway"
|
||||||
;;
|
|
||||||
2)
|
|
||||||
_eghcup --cache install stack || die "Stack installation failed"
|
|
||||||
edo mkdir -p "${STACK_ROOOT:-$HOME/.stack}"/hooks
|
|
||||||
hook_exe="${STACK_ROOOT:-$HOME/.stack}"/hooks/ghc-install.sh
|
|
||||||
hook_url="https://www.haskell.org/ghcup/sh/hooks/stack/ghc-install.sh"
|
|
||||||
|
|
||||||
if [ -e "${hook_exe}" ] ; then
|
|
||||||
warn "$hook_exe already exists, skipping hook installation."
|
|
||||||
warn "If you want to reinstall the hook, delete it manually and re-run"
|
|
||||||
warn "this script!"
|
|
||||||
else
|
|
||||||
case "${BOOTSTRAP_HASKELL_DOWNLOADER}" in
|
|
||||||
"curl")
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
edo curl -Lf ${GHCUP_CURL_OPTS} "${hook_url}" > "${hook_exe}"
|
|
||||||
;;
|
|
||||||
"wget")
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
edo wget -O /dev/stdout ${GHCUP_WGET_OPTS} "${hook_url}" > "${hook_exe}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
die "Unknown downloader: ${BOOTSTRAP_HASKELL_DOWNLOADER}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
edo chmod +x "${hook_exe}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# !! KEEP THIS SCRIPT POSIX COMPLIANT !!
|
|
||||||
|
|
||||||
# see https://docs.haskellstack.org/en/stable/yaml_configuration/#ghc-installation-customisation-experimental
|
|
||||||
# for documentation about hooks
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
case $HOOK_GHC_TYPE in
|
|
||||||
bindist)
|
|
||||||
ghcdir=$(ghcup whereis --directory ghc "$HOOK_GHC_VERSION" || ghcup run --ghc "$HOOK_GHC_VERSION" --install) || exit 3
|
|
||||||
printf "%s/ghc" "${ghcdir}"
|
|
||||||
;;
|
|
||||||
git)
|
|
||||||
# TODO: should be somewhat possible
|
|
||||||
>&2 echo "Hook doesn't support installing from source"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
>&2 echo "Unsupported GHC installation type: $HOOK_GHC_TYPE"
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
Reference in New Issue
Block a user