Compare commits
1 Commits
github-ci
...
better-err
| Author | SHA1 | Date | |
|---|---|---|---|
|
3f968cb1c0
|
20
.cirrus.yml
20
.cirrus.yml
@@ -1,20 +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
|
|
||||||
DISTRO: na
|
|
||||||
GITHUB_WORKSPACE: ${CIRRUS_WORKING_DIR}
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
CIRRUS_CLONE_SUBMODULES: true
|
|
||||||
install_script: pkg install -y ghc hs-cabal-install git bash misc/compat10x misc/compat11x misc/compat12x gmake
|
|
||||||
script:
|
|
||||||
- bash .github/scripts/build.sh
|
|
||||||
- bash .github/scripts/test.sh
|
|
||||||
binaries_artifacts:
|
|
||||||
path: "out/x86_64-portbld-freebsd-ghcup-*"
|
|
||||||
4946
.github/ghc-8.10.3-linux.alpine.files
vendored
4946
.github/ghc-8.10.3-linux.alpine.files
vendored
File diff suppressed because it is too large
Load Diff
8734
.github/ghc-8.10.3-linux.files
vendored
8734
.github/ghc-8.10.3-linux.files
vendored
File diff suppressed because it is too large
Load Diff
10321
.github/ghc-8.10.3-windows.files
vendored
10321
.github/ghc-8.10.3-windows.files
vendored
File diff suppressed because it is too large
Load Diff
37
.github/ghcup-run.files
vendored
37
.github/ghcup-run.files
vendored
@@ -1,37 +0,0 @@
|
|||||||
.
|
|
||||||
./cabal
|
|
||||||
./ghc
|
|
||||||
./ghc-8.10.7
|
|
||||||
./ghc-pkg
|
|
||||||
./ghc-pkg-8.10.7
|
|
||||||
./ghci
|
|
||||||
./ghci-8.10.7
|
|
||||||
./haddock
|
|
||||||
./haddock-8.10.7
|
|
||||||
./haskell-language-server-8.10.6
|
|
||||||
./haskell-language-server-8.10.6~1.6.1.0
|
|
||||||
./haskell-language-server-8.10.7
|
|
||||||
./haskell-language-server-8.10.7~1.6.1.0
|
|
||||||
./haskell-language-server-8.6.5
|
|
||||||
./haskell-language-server-8.6.5~1.6.1.0
|
|
||||||
./haskell-language-server-8.8.4
|
|
||||||
./haskell-language-server-8.8.4~1.6.1.0
|
|
||||||
./haskell-language-server-9.0.1
|
|
||||||
./haskell-language-server-9.0.1~1.6.1.0
|
|
||||||
./haskell-language-server-9.0.2
|
|
||||||
./haskell-language-server-9.0.2~1.6.1.0
|
|
||||||
./haskell-language-server-9.2.1
|
|
||||||
./haskell-language-server-9.2.1~1.6.1.0
|
|
||||||
./haskell-language-server-wrapper
|
|
||||||
./haskell-language-server-wrapper-1.6.1.0
|
|
||||||
./hp2ps
|
|
||||||
./hp2ps-8.10.7
|
|
||||||
./hpc
|
|
||||||
./hpc-8.10.7
|
|
||||||
./hsc2hs
|
|
||||||
./hsc2hs-8.10.7
|
|
||||||
./runghc
|
|
||||||
./runghc-8.10.7
|
|
||||||
./runhaskell
|
|
||||||
./runhaskell-8.10.7
|
|
||||||
./stack
|
|
||||||
31
.github/ghcup-run.files.alpine
vendored
31
.github/ghcup-run.files.alpine
vendored
@@ -1,31 +0,0 @@
|
|||||||
.
|
|
||||||
./cabal
|
|
||||||
./ghc
|
|
||||||
./ghc-8.10.7
|
|
||||||
./ghc-pkg
|
|
||||||
./ghc-pkg-8.10.7
|
|
||||||
./ghci
|
|
||||||
./ghci-8.10.7
|
|
||||||
./haddock
|
|
||||||
./haddock-8.10.7
|
|
||||||
./haskell-language-server-8.10.7
|
|
||||||
./haskell-language-server-8.10.7~1.6.1.0
|
|
||||||
./haskell-language-server-8.8.4
|
|
||||||
./haskell-language-server-8.8.4~1.6.1.0
|
|
||||||
./haskell-language-server-9.0.2
|
|
||||||
./haskell-language-server-9.0.2~1.6.1.0
|
|
||||||
./haskell-language-server-9.2.1
|
|
||||||
./haskell-language-server-9.2.1~1.6.1.0
|
|
||||||
./haskell-language-server-wrapper
|
|
||||||
./haskell-language-server-wrapper-1.6.1.0
|
|
||||||
./hp2ps
|
|
||||||
./hp2ps-8.10.7
|
|
||||||
./hpc
|
|
||||||
./hpc-8.10.7
|
|
||||||
./hsc2hs
|
|
||||||
./hsc2hs-8.10.7
|
|
||||||
./runghc
|
|
||||||
./runghc-8.10.7
|
|
||||||
./runhaskell
|
|
||||||
./runhaskell-8.10.7
|
|
||||||
./stack
|
|
||||||
81
.github/ghcup-run.files.windows
vendored
81
.github/ghcup-run.files.windows
vendored
@@ -1,81 +0,0 @@
|
|||||||
.
|
|
||||||
./cabal.exe
|
|
||||||
./cabal.shim
|
|
||||||
./ghc-8.10.7.exe
|
|
||||||
./ghc-8.10.7.shim
|
|
||||||
./ghc-pkg-8.10.7.exe
|
|
||||||
./ghc-pkg-8.10.7.shim
|
|
||||||
./ghc-pkg.exe
|
|
||||||
./ghc-pkg.shim
|
|
||||||
./ghc.exe
|
|
||||||
./ghc.shim
|
|
||||||
./ghci-8.10.7.exe
|
|
||||||
./ghci-8.10.7.shim
|
|
||||||
./ghci.exe
|
|
||||||
./ghci.shim
|
|
||||||
./ghcii-8.10.7.sh-8.10.7.exe
|
|
||||||
./ghcii-8.10.7.sh-8.10.7.shim
|
|
||||||
./ghcii-8.10.7.sh.exe
|
|
||||||
./ghcii-8.10.7.sh.shim
|
|
||||||
./ghcii.sh-8.10.7.exe
|
|
||||||
./ghcii.sh-8.10.7.shim
|
|
||||||
./ghcii.sh.exe
|
|
||||||
./ghcii.sh.shim
|
|
||||||
./haddock-8.10.7.exe
|
|
||||||
./haddock-8.10.7.shim
|
|
||||||
./haddock.exe
|
|
||||||
./haddock.shim
|
|
||||||
./haskell-language-server-8.10.6.exe
|
|
||||||
./haskell-language-server-8.10.6.shim
|
|
||||||
./haskell-language-server-8.10.6~1.6.1.0.exe
|
|
||||||
./haskell-language-server-8.10.6~1.6.1.0.shim
|
|
||||||
./haskell-language-server-8.10.7.exe
|
|
||||||
./haskell-language-server-8.10.7.shim
|
|
||||||
./haskell-language-server-8.10.7~1.6.1.0.exe
|
|
||||||
./haskell-language-server-8.10.7~1.6.1.0.shim
|
|
||||||
./haskell-language-server-8.6.5.exe
|
|
||||||
./haskell-language-server-8.6.5.shim
|
|
||||||
./haskell-language-server-8.6.5~1.6.1.0.exe
|
|
||||||
./haskell-language-server-8.6.5~1.6.1.0.shim
|
|
||||||
./haskell-language-server-8.8.4.exe
|
|
||||||
./haskell-language-server-8.8.4.shim
|
|
||||||
./haskell-language-server-8.8.4~1.6.1.0.exe
|
|
||||||
./haskell-language-server-8.8.4~1.6.1.0.shim
|
|
||||||
./haskell-language-server-9.0.1.exe
|
|
||||||
./haskell-language-server-9.0.1.shim
|
|
||||||
./haskell-language-server-9.0.1~1.6.1.0.exe
|
|
||||||
./haskell-language-server-9.0.1~1.6.1.0.shim
|
|
||||||
./haskell-language-server-9.0.2.exe
|
|
||||||
./haskell-language-server-9.0.2.shim
|
|
||||||
./haskell-language-server-9.0.2~1.6.1.0.exe
|
|
||||||
./haskell-language-server-9.0.2~1.6.1.0.shim
|
|
||||||
./haskell-language-server-9.2.1.exe
|
|
||||||
./haskell-language-server-9.2.1.shim
|
|
||||||
./haskell-language-server-9.2.1~1.6.1.0.exe
|
|
||||||
./haskell-language-server-9.2.1~1.6.1.0.shim
|
|
||||||
./haskell-language-server-wrapper-1.6.1.0.exe
|
|
||||||
./haskell-language-server-wrapper-1.6.1.0.shim
|
|
||||||
./haskell-language-server-wrapper.exe
|
|
||||||
./haskell-language-server-wrapper.shim
|
|
||||||
./hp2ps-8.10.7.exe
|
|
||||||
./hp2ps-8.10.7.shim
|
|
||||||
./hp2ps.exe
|
|
||||||
./hp2ps.shim
|
|
||||||
./hpc-8.10.7.exe
|
|
||||||
./hpc-8.10.7.shim
|
|
||||||
./hpc.exe
|
|
||||||
./hpc.shim
|
|
||||||
./hsc2hs-8.10.7.exe
|
|
||||||
./hsc2hs-8.10.7.shim
|
|
||||||
./hsc2hs.exe
|
|
||||||
./hsc2hs.shim
|
|
||||||
./runghc-8.10.7.exe
|
|
||||||
./runghc-8.10.7.shim
|
|
||||||
./runghc.exe
|
|
||||||
./runghc.shim
|
|
||||||
./runhaskell-8.10.7.exe
|
|
||||||
./runhaskell-8.10.7.shim
|
|
||||||
./runhaskell.exe
|
|
||||||
./runhaskell.shim
|
|
||||||
./stack.exe
|
|
||||||
./stack.shim
|
|
||||||
16
.github/scripts/bootstrap.sh
vendored
16
.github/scripts/bootstrap.sh
vendored
@@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
|
||||||
|
|
||||||
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
|
||||||
|
|
||||||
git describe --always
|
|
||||||
|
|
||||||
### build
|
|
||||||
|
|
||||||
./scripts/bootstrap/bootstrap-haskell
|
|
||||||
|
|
||||||
[ "$(ghc --numeric-version)" = "${BOOTSTRAP_HASKELL_GHC_VERSION}" ]
|
|
||||||
|
|
||||||
62
.github/scripts/build.sh
vendored
62
.github/scripts/build.sh
vendored
@@ -1,62 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
|
||||||
|
|
||||||
if ! command -v ghcup && [ "${RUNNER_OS}" != "FreeBSD" ] ; then
|
|
||||||
find "$GHCUP_INSTALL_BASE_PREFIX"
|
|
||||||
mkdir -p "$GHCUP_BIN"
|
|
||||||
mkdir -p "$GHCUP_BIN"/../cache
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
|
|
||||||
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
|
|
||||||
GHC="ghc-${GHC_VER}"
|
|
||||||
else
|
|
||||||
GHC="ghc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
git describe --all
|
|
||||||
|
|
||||||
ecabal() {
|
|
||||||
cabal "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
# build
|
|
||||||
ecabal update
|
|
||||||
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
if [ "${ARCH}" = "32" ] ; then
|
|
||||||
ecabal build -w "${GHC}" --ghc-options='-split-sections -optl-static' -ftui
|
|
||||||
elif [ "${ARCH}" = "64" ] ; then
|
|
||||||
ecabal build -w "${GHC}" --ghc-options='-split-sections -optl-static' -ftui
|
|
||||||
else
|
|
||||||
ecabal build -w "${GHC}" -ftui
|
|
||||||
fi
|
|
||||||
elif [ "${RUNNER_OS}" = "FreeBSD" ] ; then
|
|
||||||
ecabal build -w "${GHC}" --ghc-options='-split-sections' --constraint="zlib +bundled-c-zlib" --constraint="zip +disable-zstd" -ftui
|
|
||||||
elif [ "${RUNNER_OS}" = "Windows" ] ; then
|
|
||||||
ecabal build -w "${GHC}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static"
|
|
||||||
else
|
|
||||||
ecabal build -w "${GHC}" --constraint="zlib +bundled-c-zlib" --constraint="lzma +static" -ftui
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir out
|
|
||||||
binary=$(ecabal new-exec -w "${GHC}" --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}"
|
|
||||||
cp ./dist-newstyle/cache/plan.json "out/${ARTIFACT}.plan.json"
|
|
||||||
|
|
||||||
77
.github/scripts/hls.sh
vendored
77
.github/scripts/hls.sh
vendored
@@ -1,77 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
|
||||||
|
|
||||||
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
|
||||||
|
|
||||||
### build
|
|
||||||
|
|
||||||
ecabal() {
|
|
||||||
cabal "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
raw_eghcup() {
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" -v -c "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
eghcup() {
|
|
||||||
if [ "${OS}" = "Windows" ] ; then
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" -v -c -s file:/$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
|
||||||
else
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" -v -c -s file://$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
sha_sum() {
|
|
||||||
if [ "${OS}" = "FreeBSD" ] ; then
|
|
||||||
sha256 "$@"
|
|
||||||
else
|
|
||||||
sha256sum "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "${OS}" = "Windows" ] ; then
|
|
||||||
GHCUP_DIR="${GHCUP_INSTALL_BASE_PREFIX}"/ghcup
|
|
||||||
else
|
|
||||||
GHCUP_DIR="${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf "${GHCUP_DIR}"
|
|
||||||
mkdir -p "${GHCUP_BIN}"
|
|
||||||
|
|
||||||
if [ "${OS}" = "Windows" ] ; then
|
|
||||||
ext=".exe"
|
|
||||||
else
|
|
||||||
ext=''
|
|
||||||
fi
|
|
||||||
ls -lah out
|
|
||||||
find out
|
|
||||||
cp "out/${ARTIFACT}"-* "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
chmod +x "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
echo "$PATH"
|
|
||||||
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" --version
|
|
||||||
eghcup --version
|
|
||||||
sha_sum "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
sha_sum "$(raw_eghcup --offline whereis ghcup)"
|
|
||||||
|
|
||||||
git describe --always
|
|
||||||
|
|
||||||
eghcup install ghc "${GHC_VERSION}"
|
|
||||||
eghcup install cabal
|
|
||||||
|
|
||||||
ecabal update
|
|
||||||
|
|
||||||
eghcup debug-info
|
|
||||||
|
|
||||||
eghcup compile hls -j $(nproc) -g ${HLS_TARGET_VERSION} --ghc ${GHC_VERSION}
|
|
||||||
|
|
||||||
[ `$(eghcup whereis hls ${HLS_TARGET_VERSION}) --numeric-version` = "${HLS_TARGET_VERSION}" ] || [ `$(eghcup whereis hls ${HLS_TARGET_VERSION}) --numeric-version | sed 's/.0$//'` = "${HLS_TARGET_VERSION}" ]
|
|
||||||
|
|
||||||
# nuke
|
|
||||||
eghcup nuke
|
|
||||||
[ ! -e "${GHCUP_DIR}" ]
|
|
||||||
|
|
||||||
76
.github/scripts/prereq.sh
vendored
76
.github/scripts/prereq.sh
vendored
@@ -1,76 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
mkdir -p "$HOME"/.local/bin
|
|
||||||
|
|
||||||
export OS="$RUNNER_OS"
|
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Windows" ] ; then
|
|
||||||
# on windows use pwd to get unix style path
|
|
||||||
CI_PROJECT_DIR="$(pwd)"
|
|
||||||
export CI_PROJECT_DIR
|
|
||||||
export GHCUP_INSTALL_BASE_PREFIX="/c"
|
|
||||||
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin"
|
|
||||||
export PATH="$GHCUP_BIN:$PATH"
|
|
||||||
else
|
|
||||||
export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
|
|
||||||
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
|
||||||
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin"
|
|
||||||
export PATH="$GHCUP_BIN:$PATH"
|
|
||||||
export CABAL_DIR="$CI_PROJECT_DIR/cabal"
|
|
||||||
export CABAL_CACHE="$CI_PROJECT_DIR/cabal-cache"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${RUNNER_OS}" = "Linux" ] ; then
|
|
||||||
if [ "${DISTRO}" = "Alpine" ] ; 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 \
|
|
||||||
diffutils \
|
|
||||||
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
|
|
||||||
elif [ "${DISTRO}" = "Ubuntu" ] ; then
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential
|
|
||||||
fi
|
|
||||||
elif [ "${RUNNER_OS}" = "macOS" ] ; then
|
|
||||||
if ! command -v brew ; then
|
|
||||||
[ -e "$HOME/.brew" ] ||
|
|
||||||
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
|
|
||||||
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
|
|
||||||
brew update
|
|
||||||
fi
|
|
||||||
if ! command -v git ; then
|
|
||||||
brew install git
|
|
||||||
fi
|
|
||||||
if ! command -v realpath ; then
|
|
||||||
brew install coreutils
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
284
.github/scripts/test.sh
vendored
284
.github/scripts/test.sh
vendored
@@ -1,284 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
. .github/scripts/prereq.sh
|
|
||||||
|
|
||||||
ecabal() {
|
|
||||||
cabal "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
raw_eghcup() {
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" -v -c "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
eghcup() {
|
|
||||||
if [ "${OS}" = "Windows" ] ; then
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" -v -c -s file:/$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
|
||||||
else
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" -v -c -s file://$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
sha_sum() {
|
|
||||||
if [ "${OS}" = "FreeBSD" ] ; then
|
|
||||||
sha256 "$@"
|
|
||||||
else
|
|
||||||
sha256sum "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "${OS}" = "Windows" ] ; then
|
|
||||||
GHCUP_DIR="${GHCUP_INSTALL_BASE_PREFIX}"/ghcup
|
|
||||||
else
|
|
||||||
GHCUP_DIR="${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
|
|
||||||
fi
|
|
||||||
|
|
||||||
git describe --always
|
|
||||||
|
|
||||||
|
|
||||||
rm -rf "${GHCUP_DIR}"
|
|
||||||
mkdir -p "${GHCUP_BIN}"
|
|
||||||
|
|
||||||
if [ "${OS}" = "Windows" ] ; then
|
|
||||||
ext=".exe"
|
|
||||||
else
|
|
||||||
ext=''
|
|
||||||
fi
|
|
||||||
ls -lah out
|
|
||||||
find out
|
|
||||||
cp "out/${ARTIFACT}"-* "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
chmod +x "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
echo "$PATH"
|
|
||||||
|
|
||||||
"$GHCUP_BIN/ghcup${ext}" --version
|
|
||||||
eghcup --version
|
|
||||||
sha_sum "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
sha_sum "$(raw_eghcup --offline whereis ghcup)"
|
|
||||||
|
|
||||||
### manual cli based testing
|
|
||||||
|
|
||||||
eghcup --numeric-version
|
|
||||||
|
|
||||||
eghcup install ghc ${GHC_VER}
|
|
||||||
eghcup unset ghc ${GHC_VER}
|
|
||||||
ls -lah "$(eghcup whereis -d ghc ${GHC_VER})"
|
|
||||||
[ "`$(eghcup whereis ghc ${GHC_VER}) --numeric-version`" = "${GHC_VER}" ]
|
|
||||||
[ "`eghcup run --ghc ${GHC_VER} -- ghc --numeric-version`" = "${GHC_VER}" ]
|
|
||||||
[ "`ghcup run --ghc ${GHC_VER} -- ghc -e 'Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath)'`" = "`$(ghcup whereis ghc ${GHC_VER}) -e 'Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath)'`" ]
|
|
||||||
eghcup set ghc ${GHC_VER}
|
|
||||||
eghcup install cabal ${CABAL_VER}
|
|
||||||
[ "`$(eghcup whereis cabal ${CABAL_VER}) --numeric-version`" = "${CABAL_VER}" ]
|
|
||||||
eghcup unset cabal
|
|
||||||
"$GHCUP_BIN"/cabal --version && exit 1 || echo yes
|
|
||||||
|
|
||||||
# make sure no cabal is set when running 'ghcup run' to check that PATH propagages properly
|
|
||||||
# https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/375
|
|
||||||
[ "`eghcup run --cabal ${CABAL_VER} -- cabal --numeric-version`" = "${CABAL_VER}" ]
|
|
||||||
eghcup set cabal ${CABAL_VER}
|
|
||||||
|
|
||||||
[ "`$(eghcup whereis cabal ${CABAL_VER}) --numeric-version`" = "${CABAL_VER}" ]
|
|
||||||
|
|
||||||
if [ "${OS}" != "FreeBSD" ] ; then
|
|
||||||
if [ "${ARCH}" = "64" ] && [ "${DISTRO}" != "Alpine" ] ; then
|
|
||||||
eghcup run --ghc 8.10.7 --cabal 3.4.1.0 --hls 1.6.1.0 --stack 2.7.3 --install --bindir "$(pwd)/.bin"
|
|
||||||
if [ "${OS}" = "Windows" ] ; then
|
|
||||||
cat "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup-run.files.windows" | sort > expected.txt
|
|
||||||
elif [ "${DISTRO}" = "Alpine" ] ; then
|
|
||||||
cat "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup-run.files.alpine" | sort > expected.txt
|
|
||||||
else
|
|
||||||
cat "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup-run.files" | sort > expected.txt
|
|
||||||
fi
|
|
||||||
(cd ".bin" && find . | sort) > actual.txt
|
|
||||||
diff --strip-trailing-cr -w -u actual.txt expected.txt
|
|
||||||
rm actual.txt expected.txt
|
|
||||||
rm -rf .bin
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
cabal --version
|
|
||||||
|
|
||||||
eghcup debug-info
|
|
||||||
|
|
||||||
# also test etags
|
|
||||||
eghcup list
|
|
||||||
eghcup list -t ghc
|
|
||||||
eghcup list -t cabal
|
|
||||||
|
|
||||||
ghc_ver=$(ghc --numeric-version)
|
|
||||||
ghc --version
|
|
||||||
ghc-${ghc_ver} --version
|
|
||||||
if [ "${OS}" != "Windows" ] ; then
|
|
||||||
ghci --version
|
|
||||||
ghci-${ghc_ver} --version
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ "${OS}" = "macOS" ] && [ "${ARCH}" = "ARM64" ] ; then
|
|
||||||
echo
|
|
||||||
else
|
|
||||||
# test installing new ghc doesn't mess with currently set GHC
|
|
||||||
# https://gitlab.haskell.org/haskell/ghcup-hs/issues/7
|
|
||||||
if [ "${OS}" = "Linux" ] ; then
|
|
||||||
eghcup --downloader=wget prefetch ghc 8.10.3
|
|
||||||
eghcup --offline install ghc 8.10.3
|
|
||||||
if [ "${ARCH}" = "64" ] ; then
|
|
||||||
if [ "${DISTRO}" = "Alpine" ] ; then
|
|
||||||
(cat "$( cd "$(dirname "$0")" ; pwd -P )/../ghc-8.10.3-linux.alpine.files" | sort) > expected.txt
|
|
||||||
else
|
|
||||||
(cat "$( cd "$(dirname "$0")" ; pwd -P )/../ghc-8.10.3-linux.files" | sort) > expected.txt
|
|
||||||
fi
|
|
||||||
(cd "${GHCUP_DIR}/ghc/8.10.3/" && find . | sort) > actual.txt
|
|
||||||
# ignore docs
|
|
||||||
sed -i '/share\/doc/d' actual.txt
|
|
||||||
sed -i '/share\/doc/d' expected.txt
|
|
||||||
diff --strip-trailing-cr -w -u actual.txt expected.txt
|
|
||||||
rm actual.txt expected.txt
|
|
||||||
fi
|
|
||||||
elif [ "${OS}" = "Windows" ] ; then
|
|
||||||
eghcup prefetch ghc 8.10.3
|
|
||||||
eghcup --offline install ghc 8.10.3
|
|
||||||
(cat "$( cd "$(dirname "$0")" ; pwd -P )/../ghc-8.10.3-windows.files" | sort) > expected.txt
|
|
||||||
(cd "${GHCUP_DIR}/ghc/8.10.3/" && find . | sort) > actual.txt
|
|
||||||
diff --strip-trailing-cr -w -u actual.txt expected.txt
|
|
||||||
rm actual.txt expected.txt
|
|
||||||
else
|
|
||||||
eghcup prefetch ghc 8.10.3
|
|
||||||
eghcup --offline install ghc 8.10.3
|
|
||||||
fi
|
|
||||||
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
|
||||||
eghcup --offline set 8.10.3
|
|
||||||
eghcup set 8.10.3
|
|
||||||
[ "$(ghc --numeric-version)" = "8.10.3" ]
|
|
||||||
eghcup set ${GHC_VER}
|
|
||||||
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
|
||||||
eghcup unset ghc
|
|
||||||
"$GHCUP_BIN"/ghc --numeric-version && exit 1 || echo yes
|
|
||||||
eghcup set ${GHC_VER}
|
|
||||||
eghcup --offline rm 8.10.3
|
|
||||||
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
|
||||||
|
|
||||||
|
|
||||||
ls -lah "$GHCUP_BIN"
|
|
||||||
|
|
||||||
if [ "${OS}" = "macOS" ] ; then
|
|
||||||
eghcup install hls
|
|
||||||
$(eghcup whereis hls) --version
|
|
||||||
|
|
||||||
eghcup install stack
|
|
||||||
$(eghcup whereis stack) --version
|
|
||||||
elif [ "${OS}" = "Linux" ] ; then
|
|
||||||
if [ "${ARCH}" = "64" ] && [ "${DISTRO}" != "Alpine" ] ; then
|
|
||||||
eghcup install hls
|
|
||||||
haskell-language-server-wrapper --version
|
|
||||||
eghcup unset hls
|
|
||||||
"$GHCUP_BIN"/haskell-language-server-wrapper --version && exit 1 || echo yes
|
|
||||||
|
|
||||||
eghcup install stack
|
|
||||||
stack --version
|
|
||||||
eghcup unset stack
|
|
||||||
"$GHCUP_BIN"/stack --version && exit 1 || echo yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# check that lazy loading works for 'whereis'
|
|
||||||
cp "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml" "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml.bak"
|
|
||||||
echo '**' > "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml"
|
|
||||||
eghcup whereis ghc $(ghc --numeric-version)
|
|
||||||
mv -f "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml.bak" "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml"
|
|
||||||
|
|
||||||
eghcup rm $(ghc --numeric-version)
|
|
||||||
|
|
||||||
# https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/116
|
|
||||||
if [ "${OS}" = "Linux" ] ; then
|
|
||||||
if [ "${ARCH}" = "64" ] ; then
|
|
||||||
eghcup install cabal -u https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.7.0.0-pre20220407/cabal-install-3.7-x86_64-linux-alpine.tar.xz 3.4.0.0-rc4
|
|
||||||
eghcup rm cabal 3.4.0.0-rc4
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
eghcup gc -c
|
|
||||||
|
|
||||||
# test etags
|
|
||||||
rm -f "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml"
|
|
||||||
raw_eghcup -s https://www.haskell.org/ghcup/data/ghcup-${JSON_VERSION}.yaml list
|
|
||||||
# snapshot yaml and etags file
|
|
||||||
etag=$(cat "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml.etags")
|
|
||||||
sha=$(sha_sum "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml")
|
|
||||||
# invalidate access time timer, which is 5minutes, so we re-download
|
|
||||||
touch -a -m -t '199901010101' "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml"
|
|
||||||
# redownload same file with some newlines added
|
|
||||||
raw_eghcup -s https://www.haskell.org/ghcup/exp/ghcup-${JSON_VERSION}.yaml list
|
|
||||||
# snapshot new yaml and etags file
|
|
||||||
etag2=$(cat "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml.etags")
|
|
||||||
sha2=$(sha_sum "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml")
|
|
||||||
# compare
|
|
||||||
[ "${etag}" != "${etag2}" ]
|
|
||||||
[ "${sha}" != "${sha2}" ]
|
|
||||||
# invalidate access time timer, which is 5minutes, but don't expect a re-download
|
|
||||||
touch -a -m -t '199901010101' "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml"
|
|
||||||
# this time, we expect the same hash and etag
|
|
||||||
raw_eghcup -s https://www.haskell.org/ghcup/exp/ghcup-${JSON_VERSION}.yaml list
|
|
||||||
etag3=$(cat "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml.etags")
|
|
||||||
sha3=$(sha_sum "${GHCUP_DIR}/cache/ghcup-${JSON_VERSION}.yaml")
|
|
||||||
[ "${etag2}" = "${etag3}" ]
|
|
||||||
[ "${sha2}" = "${sha3}" ]
|
|
||||||
|
|
||||||
# test isolated installs
|
|
||||||
if [ "${DISTRO}" != "Alpine" ] ; then
|
|
||||||
eghcup install ghc -i "$(pwd)/isolated" 8.10.5
|
|
||||||
[ "$(isolated/bin/ghc --numeric-version)" = "8.10.5" ]
|
|
||||||
! eghcup install ghc -i "$(pwd)/isolated" 8.10.5
|
|
||||||
if [ "${ARCH}" = "64" ] ; then
|
|
||||||
if [ "${OS}" = "Linux" ] || [ "${OS}" = "Windows" ] ; then
|
|
||||||
eghcup install cabal -i "$(pwd)/isolated" 3.4.0.0
|
|
||||||
[ "$(isolated/cabal --numeric-version)" = "3.4.0.0" ]
|
|
||||||
eghcup install stack -i "$(pwd)/isolated" 2.7.3
|
|
||||||
[ "$(isolated/stack --numeric-version)" = "2.7.3" ]
|
|
||||||
eghcup install hls -i "$(pwd)/isolated" 1.3.0
|
|
||||||
[ "$(isolated/haskell-language-server-wrapper --numeric-version)" = "1.3.0" ] ||
|
|
||||||
[ "$(isolated/haskell-language-server-wrapper --numeric-version)" = "1.3.0.0" ]
|
|
||||||
|
|
||||||
# test that isolated installs don't clean up target directory
|
|
||||||
cat <<EOF > "${GHCUP_BIN}/gmake"
|
|
||||||
#!/bin/bash
|
|
||||||
exit 1
|
|
||||||
EOF
|
|
||||||
chmod +x "${GHCUP_BIN}/gmake"
|
|
||||||
mkdir isolated_tainted/
|
|
||||||
touch isolated_tainted/lol
|
|
||||||
|
|
||||||
! eghcup install ghc -i "$(pwd)/isolated_tainted" 8.10.5 --force
|
|
||||||
[ -e "$(pwd)/isolated_tainted/lol" ]
|
|
||||||
rm "${GHCUP_BIN}/gmake"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
eghcup upgrade
|
|
||||||
eghcup upgrade -f
|
|
||||||
|
|
||||||
# restore old ghcup, because we want to test nuke
|
|
||||||
cp "out/${ARTIFACT}"-* "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
chmod +x "$GHCUP_BIN/ghcup${ext}"
|
|
||||||
|
|
||||||
# test that doing fishy symlinks into GHCup dir doesn't cause weird stuff on 'ghcup nuke'
|
|
||||||
mkdir no_nuke/
|
|
||||||
mkdir no_nuke/bar
|
|
||||||
echo 'foo' > no_nuke/file
|
|
||||||
echo 'bar' > no_nuke/bar/file
|
|
||||||
ln -s "$CI_PROJECT_DIR"/no_nuke/ "${GHCUP_DIR}"/cache/no_nuke
|
|
||||||
ln -s "$CI_PROJECT_DIR"/no_nuke/ "${GHCUP_DIR}"/logs/no_nuke
|
|
||||||
|
|
||||||
# nuke
|
|
||||||
eghcup nuke
|
|
||||||
[ ! -e "${GHCUP_DIR}" ]
|
|
||||||
|
|
||||||
# make sure nuke doesn't resolve symlinks
|
|
||||||
[ -e "$CI_PROJECT_DIR"/no_nuke/file ]
|
|
||||||
[ -e "$CI_PROJECT_DIR"/no_nuke/bar/file ]
|
|
||||||
|
|
||||||
46
.github/workflows/bootstrap.yaml
vendored
46
.github/workflows/bootstrap.yaml
vendored
@@ -1,46 +0,0 @@
|
|||||||
name: Bootstrap tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
bootstrap:
|
|
||||||
name: bootstrap
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
|
||||||
BOOTSTRAP_HASKELL_CABAL_VERSION: 3.6.2.0
|
|
||||||
BOOTSTRAP_HASKELL_GHC_VERSION: 8.10.7
|
|
||||||
BOOTSTRAP_HASKELL_NONINTERACTIVE: yes
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
DISTRO: Ubuntu
|
|
||||||
- os: macOS-10.15
|
|
||||||
DISTRO: na
|
|
||||||
- os: windows-latest
|
|
||||||
DISTRO: na
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- if: runner.os != 'Windows'
|
|
||||||
name: Run bootstrap
|
|
||||||
run: sh ./.github/scripts/bootstrap.sh
|
|
||||||
env:
|
|
||||||
DISTRO: ${{ matrix.DISTRO }}
|
|
||||||
|
|
||||||
- if: runner.os == 'Windows'
|
|
||||||
name: Run bootstrap
|
|
||||||
run: ./scripts/bootstrap/bootstrap-haskell.ps1 -InstallDir ${GITHUB_WORKSPACE} -BootstrapUrl ${GITHUB_WORKSPACE}/bootstrap-haskell -InBash
|
|
||||||
shell: pwsh
|
|
||||||
26
.github/workflows/hlint.yaml
vendored
26
.github/workflows/hlint.yaml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: Hlint
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
hlint:
|
|
||||||
name: hlint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- name: Run hlint
|
|
||||||
run: curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s -- -r lib/ test/
|
|
||||||
33
.github/workflows/mkdocs.yaml
vendored
33
.github/workflows/mkdocs.yaml
vendored
@@ -1,33 +0,0 @@
|
|||||||
name: MkDocs
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
mkdocs:
|
|
||||||
name: mkdocs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- name: Install mkdocs deps
|
|
||||||
run: |
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install -y python3-pip
|
|
||||||
sudo pip3 install mkdocs
|
|
||||||
|
|
||||||
- name: Run mkdocs
|
|
||||||
run: |
|
|
||||||
mkdocs build
|
|
||||||
289
.github/workflows/release.yaml
vendored
289
.github/workflows/release.yaml
vendored
@@ -1,224 +1,109 @@
|
|||||||
name: Build and release
|
name: Create Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
draft_release:
|
||||||
name: Build binary
|
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
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
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: ARM64
|
|
||||||
- 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@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- if: matrix.ARCH == '32' && runner.os == 'Linux'
|
- uses: haskell/actions/setup@v1.2
|
||||||
name: Run build (32 bit linux)
|
|
||||||
uses: docker://i386/alpine:3.12
|
|
||||||
with:
|
with:
|
||||||
args: sh .github/scripts/build.sh
|
ghc-version: 8.10.7
|
||||||
env:
|
cabal-version: 3.6.2.0
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
DISTRO: Alpine
|
|
||||||
|
|
||||||
- if: matrix.ARCH == '64' && runner.os == 'Linux'
|
- name: create ~/.local/bin
|
||||||
name: Run build (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/build.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 }}
|
|
||||||
DISTRO: Alpine
|
|
||||||
|
|
||||||
- if: runner.os != 'Linux'
|
|
||||||
name: Run build (windows/mac)
|
|
||||||
run: bash .github/scripts/build.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
DISTRO: na
|
|
||||||
|
|
||||||
- if: always()
|
- if: always()
|
||||||
name: Upload artifact
|
uses: actions/upload-artifact@v2
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: artifacts
|
name: plan.json
|
||||||
path: |
|
path: ./dist-newstyle/cache/plan.json
|
||||||
./out/*
|
|
||||||
|
|
||||||
test:
|
|
||||||
name: Test
|
|
||||||
needs: build
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
|
||||||
CABAL_VER: 3.6.2.0
|
|
||||||
CACHE_VER: 1
|
|
||||||
MACOSX_DEPLOYMENT_TARGET: 10.13
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
ARTIFACT: "i386-linux-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 32
|
|
||||||
DISTRO: Alpine
|
|
||||||
- os: ubuntu-latest
|
|
||||||
ARTIFACT: "x86_64-linux-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
DISTRO: Alpine
|
|
||||||
- os: ubuntu-latest
|
|
||||||
ARTIFACT: "x86_64-linux-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
DISTRO: Ubuntu
|
|
||||||
- os: [self-hosted, macOS, aarch64]
|
|
||||||
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: ARM64
|
|
||||||
DISTRO: na
|
|
||||||
- os: macOS-10.15
|
|
||||||
ARTIFACT: "x86_64-apple-darwin-ghcup"
|
|
||||||
GHC_VER: 9.2.5
|
|
||||||
ARCH: 64
|
|
||||||
DISTRO: na
|
|
||||||
- os: windows-latest
|
|
||||||
ARTIFACT: "x86_64-mingw64-ghcup"
|
|
||||||
GHC_VER: 8.10.7
|
|
||||||
ARCH: 64
|
|
||||||
DISTRO: na
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: ./out
|
|
||||||
|
|
||||||
- if: matrix.ARCH == '32' && runner.os == 'Linux' && matrix.DISTRO == 'Alpine'
|
|
||||||
name: Run build (32 bit linux Alpine)
|
|
||||||
uses: docker://i386/alpine:3.12
|
|
||||||
with:
|
|
||||||
args: sh .github/scripts/test.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
DISTRO: ${{ matrix.DISTRO }}
|
|
||||||
|
|
||||||
- if: matrix.ARCH == '64' && runner.os == 'Linux' && matrix.DISTRO == 'Alpine'
|
|
||||||
name: Run build (64 bit linux Alpine)
|
|
||||||
uses: docker://alpine:3.12
|
|
||||||
with:
|
|
||||||
args: sh .github/scripts/test.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
DISTRO: ${{ matrix.DISTRO }}
|
|
||||||
|
|
||||||
- if: runner.os == 'Linux' && matrix.DISTRO != 'Alpine'
|
|
||||||
name: Run build (64 bit linux)
|
|
||||||
run: sh .github/scripts/test.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
DISTRO: ${{ matrix.DISTRO }}
|
|
||||||
|
|
||||||
- if: runner.os != 'Linux'
|
|
||||||
name: Run build (windows/mac)
|
|
||||||
run: bash .github/scripts/test.sh
|
|
||||||
env:
|
|
||||||
ARTIFACT: ${{ matrix.ARTIFACT }}
|
|
||||||
ARCH: ${{ matrix.ARCH }}
|
|
||||||
GHC_VER: ${{ matrix.GHC_VER }}
|
|
||||||
DISTRO: ${{ matrix.DISTRO }}
|
|
||||||
hls:
|
|
||||||
name: hls
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
GHC_VERSION: "8.10.7"
|
|
||||||
HLS_TARGET_VERSION: "1.8.0.0"
|
|
||||||
CABAL_VERSION: "3.6.2.0"
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
ARTIFACT: "x86_64-linux-ghcup"
|
|
||||||
DISTRO: Ubuntu
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: ./out
|
|
||||||
|
|
||||||
- name: Run hls build
|
|
||||||
run: sh .github/scripts/hls.sh
|
|
||||||
|
|
||||||
release:
|
|
||||||
name: release
|
|
||||||
needs: [build, test, hls]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
steps:
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: artifacts
|
|
||||||
path: ./out
|
|
||||||
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
files: |
|
|
||||||
./out/*
|
|
||||||
|
|||||||
28
.github/workflows/shellcheck.yaml
vendored
28
.github/workflows/shellcheck.yaml
vendored
@@ -1,28 +0,0 @@
|
|||||||
name: Shellcheck
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
shellcheck:
|
|
||||||
name: shellcheck
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
JSON_VERSION: "0.0.7"
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- name: Run shellcheck
|
|
||||||
uses: docker://koalaman/shellcheck-alpine
|
|
||||||
with:
|
|
||||||
args: shellcheck scripts/bootstrap/bootstrap-haskell
|
|
||||||
@@ -74,7 +74,6 @@ data Options = Options
|
|||||||
optVerbose :: Maybe Bool
|
optVerbose :: Maybe Bool
|
||||||
, optCache :: Maybe Bool
|
, optCache :: Maybe Bool
|
||||||
, optMetaCache :: Maybe Integer
|
, optMetaCache :: Maybe Integer
|
||||||
, optPlatform :: Maybe PlatformRequest
|
|
||||||
, optUrlSource :: Maybe URI
|
, optUrlSource :: Maybe URI
|
||||||
, optNoVerify :: Maybe Bool
|
, optNoVerify :: Maybe Bool
|
||||||
, optKeepDirs :: Maybe KeepDirs
|
, optKeepDirs :: Maybe KeepDirs
|
||||||
@@ -117,16 +116,6 @@ opts =
|
|||||||
<$> invertableSwitch "verbose" (Just 'v') False (help "Enable verbosity (default: disabled)")
|
<$> invertableSwitch "verbose" (Just 'v') False (help "Enable verbosity (default: disabled)")
|
||||||
<*> invertableSwitch "cache" (Just 'c') False (help "Cache downloads in ~/.ghcup/cache (default: disabled)")
|
<*> invertableSwitch "cache" (Just 'c') False (help "Cache downloads in ~/.ghcup/cache (default: disabled)")
|
||||||
<*> optional (option auto (long "metadata-caching" <> help "How long the yaml metadata caching interval is (in seconds), 0 to disable" <> internal))
|
<*> optional (option auto (long "metadata-caching" <> help "How long the yaml metadata caching interval is (in seconds), 0 to disable" <> internal))
|
||||||
<*> optional
|
|
||||||
(option
|
|
||||||
(eitherReader platformParser)
|
|
||||||
( short 'p'
|
|
||||||
<> long "platform"
|
|
||||||
<> metavar "PLATFORM"
|
|
||||||
<> help
|
|
||||||
"Override for platform (triple matching ghc tarball names), e.g. x86_64-fedora27-linux"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
<*> optional
|
<*> optional
|
||||||
(option
|
(option
|
||||||
(eitherReader parseUri)
|
(eitherReader parseUri)
|
||||||
|
|||||||
@@ -131,8 +131,7 @@ updateSettings UserSettings{..} Settings{..} =
|
|||||||
urlSource' = fromMaybe urlSource uUrlSource
|
urlSource' = fromMaybe urlSource uUrlSource
|
||||||
noNetwork' = fromMaybe noNetwork uNoNetwork
|
noNetwork' = fromMaybe noNetwork uNoNetwork
|
||||||
gpgSetting' = fromMaybe gpgSetting uGPGSetting
|
gpgSetting' = fromMaybe gpgSetting uGPGSetting
|
||||||
platformOverride' = uPlatformOverride <|> platformOverride
|
in Settings cache' metaCache' noVerify' keepDirs' downloader' verbose' urlSource' noNetwork' gpgSetting' noColor
|
||||||
in Settings cache' metaCache' noVerify' keepDirs' downloader' verbose' urlSource' noNetwork' gpgSetting' noColor platformOverride'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ data InstallCommand = InstallGHC InstallOptions
|
|||||||
|
|
||||||
data InstallOptions = InstallOptions
|
data InstallOptions = InstallOptions
|
||||||
{ instVer :: Maybe ToolVersion
|
{ instVer :: Maybe ToolVersion
|
||||||
|
, instPlatform :: Maybe PlatformRequest
|
||||||
, instBindist :: Maybe URI
|
, instBindist :: Maybe URI
|
||||||
, instSet :: Bool
|
, instSet :: Bool
|
||||||
, isolateDir :: Maybe FilePath
|
, isolateDir :: Maybe FilePath
|
||||||
@@ -175,8 +176,18 @@ Examples:
|
|||||||
|
|
||||||
installOpts :: Maybe Tool -> Parser InstallOptions
|
installOpts :: Maybe Tool -> Parser InstallOptions
|
||||||
installOpts tool =
|
installOpts tool =
|
||||||
(\(u, v) b is f -> InstallOptions v u b is f)
|
(\p (u, v) b is f -> InstallOptions v p u b is f)
|
||||||
<$> ( ( (,)
|
<$> optional
|
||||||
|
(option
|
||||||
|
(eitherReader platformParser)
|
||||||
|
( short 'p'
|
||||||
|
<> long "platform"
|
||||||
|
<> metavar "PLATFORM"
|
||||||
|
<> help
|
||||||
|
"Override for platform (triple matching ghc tarball names), e.g. x86_64-fedora27-linux"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
<*> ( ( (,)
|
||||||
<$> optional
|
<$> optional
|
||||||
(option
|
(option
|
||||||
(eitherReader uriParser)
|
(eitherReader uriParser)
|
||||||
@@ -257,10 +268,11 @@ type InstallEffects = '[ AlreadyInstalled
|
|||||||
|
|
||||||
|
|
||||||
runInstTool :: AppState
|
runInstTool :: AppState
|
||||||
|
-> Maybe PlatformRequest
|
||||||
-> Excepts InstallEffects (ResourceT (ReaderT AppState IO)) a
|
-> Excepts InstallEffects (ResourceT (ReaderT AppState IO)) a
|
||||||
-> IO (VEither InstallEffects a)
|
-> IO (VEither InstallEffects a)
|
||||||
runInstTool appstate' =
|
runInstTool appstate' mInstPlatform =
|
||||||
flip runReaderT appstate'
|
flip runReaderT (maybe appstate' (\x -> appstate'{ pfreq = x } :: AppState) mInstPlatform)
|
||||||
. runResourceT
|
. runResourceT
|
||||||
. runE
|
. runE
|
||||||
@InstallEffects
|
@InstallEffects
|
||||||
@@ -290,10 +302,11 @@ type InstallGHCEffects = '[ AlreadyInstalled
|
|||||||
]
|
]
|
||||||
|
|
||||||
runInstGHC :: AppState
|
runInstGHC :: AppState
|
||||||
|
-> Maybe PlatformRequest
|
||||||
-> Excepts InstallGHCEffects (ResourceT (ReaderT AppState IO)) a
|
-> Excepts InstallGHCEffects (ResourceT (ReaderT AppState IO)) a
|
||||||
-> IO (VEither InstallGHCEffects a)
|
-> IO (VEither InstallGHCEffects a)
|
||||||
runInstGHC appstate' =
|
runInstGHC appstate' mInstPlatform =
|
||||||
flip runReaderT appstate'
|
flip runReaderT (maybe appstate' (\x -> appstate'{ pfreq = x } :: AppState) mInstPlatform)
|
||||||
. runResourceT
|
. runResourceT
|
||||||
. runE
|
. runE
|
||||||
@InstallGHCEffects
|
@InstallGHCEffects
|
||||||
@@ -318,7 +331,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
installGHC InstallOptions{..} = do
|
installGHC InstallOptions{..} = do
|
||||||
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
||||||
(case instBindist of
|
(case instBindist of
|
||||||
Nothing -> runInstGHC s' $ do
|
Nothing -> runInstGHC s' instPlatform $ do
|
||||||
(v, vi) <- liftE $ fromVersion instVer GHC
|
(v, vi) <- liftE $ fromVersion instVer GHC
|
||||||
liftE $ runBothE' (installGHCBin
|
liftE $ runBothE' (installGHCBin
|
||||||
(_tvVersion v)
|
(_tvVersion v)
|
||||||
@@ -329,7 +342,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
$ when instSet $ when (isNothing isolateDir) $ liftE $ void $ setGHC v SetGHCOnly Nothing
|
$ when instSet $ when (isNothing isolateDir) $ liftE $ void $ setGHC v SetGHCOnly Nothing
|
||||||
pure vi
|
pure vi
|
||||||
Just uri -> do
|
Just uri -> do
|
||||||
runInstGHC s'{ settings = settings {noVerify = True}} $ do
|
runInstGHC s'{ settings = settings {noVerify = True}} instPlatform $ do
|
||||||
(v, vi) <- liftE $ fromVersion instVer GHC
|
(v, vi) <- liftE $ fromVersion instVer GHC
|
||||||
liftE $ runBothE' (installGHCBindist
|
liftE $ runBothE' (installGHCBindist
|
||||||
(DownloadInfo uri (Just $ RegexDir "ghc-.*") "")
|
(DownloadInfo uri (Just $ RegexDir "ghc-.*") "")
|
||||||
@@ -390,7 +403,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
installCabal InstallOptions{..} = do
|
installCabal InstallOptions{..} = do
|
||||||
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
||||||
(case instBindist of
|
(case instBindist of
|
||||||
Nothing -> runInstTool s' $ do
|
Nothing -> runInstTool s' instPlatform $ do
|
||||||
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Cabal
|
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Cabal
|
||||||
liftE $ runBothE' (installCabalBin
|
liftE $ runBothE' (installCabalBin
|
||||||
v
|
v
|
||||||
@@ -399,7 +412,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
) $ when instSet $ when (isNothing isolateDir) $ liftE $ setCabal v
|
) $ when instSet $ when (isNothing isolateDir) $ liftE $ setCabal v
|
||||||
pure vi
|
pure vi
|
||||||
Just uri -> do
|
Just uri -> do
|
||||||
runInstTool s'{ settings = settings { noVerify = True}} $ do
|
runInstTool s'{ settings = settings { noVerify = True}} instPlatform $ do
|
||||||
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Cabal
|
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Cabal
|
||||||
liftE $ runBothE' (installCabalBindist
|
liftE $ runBothE' (installCabalBindist
|
||||||
(DownloadInfo uri Nothing "")
|
(DownloadInfo uri Nothing "")
|
||||||
@@ -439,7 +452,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
installHLS InstallOptions{..} = do
|
installHLS InstallOptions{..} = do
|
||||||
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
||||||
(case instBindist of
|
(case instBindist of
|
||||||
Nothing -> runInstTool s' $ do
|
Nothing -> runInstTool s' instPlatform $ do
|
||||||
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer HLS
|
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer HLS
|
||||||
liftE $ runBothE' (installHLSBin
|
liftE $ runBothE' (installHLSBin
|
||||||
v
|
v
|
||||||
@@ -448,7 +461,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
) $ when instSet $ when (isNothing isolateDir) $ liftE $ setHLS v SetHLSOnly Nothing
|
) $ when instSet $ when (isNothing isolateDir) $ liftE $ setHLS v SetHLSOnly Nothing
|
||||||
pure vi
|
pure vi
|
||||||
Just uri -> do
|
Just uri -> do
|
||||||
runInstTool s'{ settings = settings { noVerify = True}} $ do
|
runInstTool s'{ settings = settings { noVerify = True}} instPlatform $ do
|
||||||
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer HLS
|
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer HLS
|
||||||
-- TODO: support legacy
|
-- TODO: support legacy
|
||||||
liftE $ runBothE' (installHLSBindist
|
liftE $ runBothE' (installHLSBindist
|
||||||
@@ -489,7 +502,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
installStack InstallOptions{..} = do
|
installStack InstallOptions{..} = do
|
||||||
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
s'@AppState{ dirs = Dirs{ .. } } <- liftIO getAppState'
|
||||||
(case instBindist of
|
(case instBindist of
|
||||||
Nothing -> runInstTool s' $ do
|
Nothing -> runInstTool s' instPlatform $ do
|
||||||
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Stack
|
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Stack
|
||||||
liftE $ runBothE' (installStackBin
|
liftE $ runBothE' (installStackBin
|
||||||
v
|
v
|
||||||
@@ -498,7 +511,7 @@ install installCommand settings getAppState' runLogger = case installCommand of
|
|||||||
) $ when instSet $ when (isNothing isolateDir) $ liftE $ setStack v
|
) $ when instSet $ when (isNothing isolateDir) $ liftE $ setStack v
|
||||||
pure vi
|
pure vi
|
||||||
Just uri -> do
|
Just uri -> do
|
||||||
runInstTool s'{ settings = settings { noVerify = True}} $ do
|
runInstTool s'{ settings = settings { noVerify = True}} instPlatform $ do
|
||||||
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Stack
|
(_tvVersion -> v, vi) <- liftE $ fromVersion instVer Stack
|
||||||
liftE $ runBothE' (installStackBindist
|
liftE $ runBothE' (installStackBindist
|
||||||
(DownloadInfo uri Nothing "")
|
(DownloadInfo uri Nothing "")
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import Haskus.Utils.Variant.Excepts
|
|||||||
import Options.Applicative hiding ( style )
|
import Options.Applicative hiding ( style )
|
||||||
import Options.Applicative.Help.Pretty ( text )
|
import Options.Applicative.Help.Pretty ( text )
|
||||||
import Prelude hiding ( appendFile )
|
import Prelude hiding ( appendFile )
|
||||||
import System.Environment
|
|
||||||
import System.Exit
|
import System.Exit
|
||||||
import Text.PrettyPrint.HughesPJClass ( prettyShow )
|
import Text.PrettyPrint.HughesPJClass ( prettyShow )
|
||||||
|
|
||||||
@@ -269,13 +268,6 @@ whereis :: ( Monad m
|
|||||||
whereis whereisCommand whereisOptions runAppState leanAppstate runLogger = do
|
whereis whereisCommand whereisOptions runAppState leanAppstate runLogger = do
|
||||||
Dirs{ .. } <- runReaderT getDirs leanAppstate
|
Dirs{ .. } <- runReaderT getDirs leanAppstate
|
||||||
case (whereisCommand, whereisOptions) of
|
case (whereisCommand, whereisOptions) of
|
||||||
(WhereisTool GHCup _, WhereisOptions{..}) -> do
|
|
||||||
loc <- liftIO (getExecutablePath >>= canonicalizePath )
|
|
||||||
if directory
|
|
||||||
then liftIO $ putStr $ takeDirectory loc
|
|
||||||
else liftIO $ putStr loc
|
|
||||||
pure ExitSuccess
|
|
||||||
|
|
||||||
(WhereisTool tool (Just (GHCVersion v)), WhereisOptions{..}) ->
|
(WhereisTool tool (Just (GHCVersion v)), WhereisOptions{..}) ->
|
||||||
runLeanWhereIs leanAppstate (do
|
runLeanWhereIs leanAppstate (do
|
||||||
loc <- liftE $ whereIsTool tool v
|
loc <- liftE $ whereIsTool tool v
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ toSettings options = do
|
|||||||
urlSource = maybe (fromMaybe (Types.urlSource defaultSettings) uUrlSource) (OwnSource . (:[]) . Right) optUrlSource
|
urlSource = maybe (fromMaybe (Types.urlSource defaultSettings) uUrlSource) (OwnSource . (:[]) . Right) optUrlSource
|
||||||
noNetwork = fromMaybe (fromMaybe (Types.noNetwork defaultSettings) uNoNetwork) optNoNetwork
|
noNetwork = fromMaybe (fromMaybe (Types.noNetwork defaultSettings) uNoNetwork) optNoNetwork
|
||||||
gpgSetting = fromMaybe (fromMaybe (Types.gpgSetting defaultSettings) uGPGSetting) optGpg
|
gpgSetting = fromMaybe (fromMaybe (Types.gpgSetting defaultSettings) uGPGSetting) optGpg
|
||||||
platformOverride = optPlatform <|> (uPlatformOverride <|> Types.platformOverride defaultSettings)
|
|
||||||
in (Settings {..}, keyBindings)
|
in (Settings {..}, keyBindings)
|
||||||
#if defined(INTERNAL_DOWNLOADER)
|
#if defined(INTERNAL_DOWNLOADER)
|
||||||
defaultDownloader = Internal
|
defaultDownloader = Internal
|
||||||
@@ -199,9 +198,9 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
|
|
||||||
|
|
||||||
let appState = do
|
let appState = do
|
||||||
pfreq <- case platformOverride settings of
|
pfreq <- (
|
||||||
Just pfreq' -> return pfreq'
|
runLogger . runE @'[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] . liftE $ platformRequest
|
||||||
Nothing -> (runLogger . runE @'[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] . liftE $ platformRequest) >>= \case
|
) >>= \case
|
||||||
VRight r -> pure r
|
VRight r -> pure r
|
||||||
VLeft e -> do
|
VLeft e -> do
|
||||||
runLogger
|
runLogger
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -75,14 +75,3 @@ url-source:
|
|||||||
# AddSource:
|
# AddSource:
|
||||||
# - Right: "file:///home/jule/git/ghcup-hs/ghcup-prereleases.yaml"
|
# - Right: "file:///home/jule/git/ghcup-hs/ghcup-prereleases.yaml"
|
||||||
# - Right: "file:///home/jule/git/ghcup-hs/ghcup-custom.yaml"
|
# - Right: "file:///home/jule/git/ghcup-hs/ghcup-custom.yaml"
|
||||||
|
|
||||||
# This is a way to override platform detection, e.g. when you're running
|
|
||||||
# a Ubuntu derivate based on 18.04, you could do:
|
|
||||||
#
|
|
||||||
# platform-override:
|
|
||||||
# arch: A_64
|
|
||||||
# platform:
|
|
||||||
# contents: Ubuntu
|
|
||||||
# tag: Linux
|
|
||||||
# version: '18.04'
|
|
||||||
platform-override: null
|
|
||||||
|
|||||||
Submodule data/metadata updated: 8f0e82ef06...42f43a6b2d
@@ -71,20 +71,6 @@ explaining all possible configurations can be found in this repo: [config.yaml](
|
|||||||
|
|
||||||
Partial configuration is fine. Command line options always override the config file settings.
|
Partial configuration is fine. Command line options always override the config file settings.
|
||||||
|
|
||||||
## Overriding distro detection
|
|
||||||
|
|
||||||
If you're running e.g. an Ubuntu derivate based on 18.04 and ghcup is picking bindists that
|
|
||||||
don't work well, you could do this in `config.yaml`:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
platform-override:
|
|
||||||
arch: A_64
|
|
||||||
platform:
|
|
||||||
contents: Ubuntu
|
|
||||||
tag: Linux
|
|
||||||
version: '18.04'
|
|
||||||
```
|
|
||||||
|
|
||||||
## Env variables
|
## Env variables
|
||||||
|
|
||||||
This is the complete list of env variables that change GHCup behavior:
|
This is the complete list of env variables that change GHCup behavior:
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ hide:
|
|||||||
<p class="ghcup-intro">GHCup is an installer for the general purpose language <a href="https://www.haskell.org">Haskell</a>.</p>
|
<p class="ghcup-intro">GHCup is an installer for the general purpose language <a href="https://www.haskell.org">Haskell</a>.</p>
|
||||||
|
|
||||||
<div class="text-center main-buttons">
|
<div class="text-center main-buttons">
|
||||||
<a href="install/" class="btn btn-primary" role="button">Installation</a>
|
<a href="install/" class="btn btn-primary" role="button">Getting Started</a>
|
||||||
<a href="steps/" class="btn btn-primary" role="button">First steps</a>
|
<a href="steps/" class="btn btn-primary" role="button">First steps</a>
|
||||||
<a href="guide/" class="btn btn-primary" role="button">User Guide</a>
|
<a href="guide/" class="btn btn-primary" role="button">User Guide</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# Installation
|
# Getting started
|
||||||
|
|
||||||
GHCup makes it easy to install specific versions of GHC on GNU/Linux,
|
GHCup makes it easy to install specific versions of GHC on GNU/Linux,
|
||||||
macOS (aka Darwin), FreeBSD and Windows and can also bootstrap a fresh [Haskell developer environment](./install/#supported-tools) from scratch.
|
macOS (aka Darwin), FreeBSD and Windows and can also bootstrap a fresh [Haskell developer environment](./install/#supported-tools) from scratch.
|
||||||
It follows the UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well). Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [pyenv](https://github.com/pyenv/pyenv) and [jenv](http://www.jenv.be).
|
It follows the UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well). Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [pyenv](https://github.com/pyenv/pyenv) and [jenv](http://www.jenv.be).
|
||||||
|
|
||||||
## How to install
|
## Installation
|
||||||
|
|
||||||
The following commands will download the `ghcup` binary into `~/.ghcup/bin` (or `C:\ghcup\bin` on windows) and then
|
The following commands will download the `ghcup` binary into `~/.ghcup/bin` (or `C:\ghcup\bin` on windows) and then
|
||||||
run it to interactively install the [Haskell Toolchain](#supported-tools). These commands should be run as **non-root/non-admin
|
run it to interactively install the [Haskell Toolchain](#supported-tools). These commands should be run as **non-root/non-admin
|
||||||
@@ -34,45 +34,6 @@ GHCup has two main channels for every tool: **recommended** and **latest**. By d
|
|||||||
|
|
||||||
Also see [tags and shortcuts](../guide/#tags-and-shortcuts) for more information.
|
Also see [tags and shortcuts](../guide/#tags-and-shortcuts) for more information.
|
||||||
|
|
||||||
## System requirements
|
|
||||||
|
|
||||||
### Linux Debian
|
|
||||||
|
|
||||||
The following distro packages are required: `build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5`
|
|
||||||
|
|
||||||
### Linux Ubuntu
|
|
||||||
|
|
||||||
The following distro packages are required: `build-essential curl libffi-dev libffi6 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5`
|
|
||||||
|
|
||||||
### Linux Fedora
|
|
||||||
|
|
||||||
The following distro packages are required: `gcc gcc-c++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl`
|
|
||||||
|
|
||||||
### Linux CentOS
|
|
||||||
|
|
||||||
The following distro packages are required: `gcc gcc-c++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl`
|
|
||||||
|
|
||||||
### Linux Alpine
|
|
||||||
|
|
||||||
The following distro packages are required: `binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz`
|
|
||||||
|
|
||||||
### Linux (generic)
|
|
||||||
|
|
||||||
You need the following packages: curl g++ gcc gmp make ncurses realpath xz-utils. Consult your distro documentation on the exact names of those packages.
|
|
||||||
|
|
||||||
### Darwin
|
|
||||||
|
|
||||||
On OS X, in the course of running ghcup you will be given a dialog box to install the command line tools. Accept and the requirements will be installed for you. You will then need to run the command again.
|
|
||||||
On Darwin M1 you might also need a working llvm installed (e.g. via brew) and have the toolchain exposed in PATH.
|
|
||||||
|
|
||||||
### FreeBSD
|
|
||||||
|
|
||||||
The following distro packages are required: `curl gcc gmp gmake ncurses perl5 libffi libiconv`
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
|
|
||||||
On Windows, msys2 should already have been set up during the installation, so most users should just proceed. If you are installing manually, make sure to have a working mingw64 toolchain and shell.
|
|
||||||
|
|
||||||
## Next steps
|
## Next steps
|
||||||
|
|
||||||
1. Follow the [First steps guide](../steps) on how to build a "Hello world" program, use `ghc`, run an interactive REPL and create a Haskell project
|
1. Follow the [First steps guide](../steps) on how to build a "Hello world" program, use `ghc`, run an interactive REPL and create a Haskell project
|
||||||
@@ -94,17 +55,14 @@ GHCup supports the following tools, which are also known as the **Haskell Toolch
|
|||||||
<table>
|
<table>
|
||||||
<thead><tr><th>GHC Version</th><th>Tags</th></tr></thead>
|
<thead><tr><th>GHC Version</th><th>Tags</th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>9.4.3</td><td><span style="color:blue">latest</span>, base-4.17.0.0</td></tr>
|
<tr><td>9.4.1</td><td><span style="color:blue">latest</span>, base-4.17.0.0</td></tr>
|
||||||
<tr><td>9.4.2</td><td>base-4.17.0.0</td></tr>
|
|
||||||
<tr><td>9.4.1</td><td>base-4.17.0.0</td></tr>
|
|
||||||
<tr><td>9.2.5</td><td><span style="color:green">recommended</span>, base-4.16.4.0</td></tr>
|
|
||||||
<tr><td>9.2.4</td><td>base-4.16.3.0</td></tr>
|
<tr><td>9.2.4</td><td>base-4.16.3.0</td></tr>
|
||||||
<tr><td>9.2.3</td><td>base-4.16.2.0</td></tr>
|
<tr><td>9.2.3</td><td>base-4.16.2.0</td></tr>
|
||||||
<tr><td>9.2.2</td><td>base-4.16.1.0</td></tr>
|
<tr><td>9.2.2</td><td>base-4.16.1.0</td></tr>
|
||||||
<tr><td>9.2.1</td><td>base-4.16.0.0</td></tr>
|
<tr><td>9.2.1</td><td>base-4.16.0.0</td></tr>
|
||||||
<tr><td>9.0.2</td><td>base-4.15.1.0</td></tr>
|
<tr><td>9.0.2</td><td>base-4.15.1.0</td></tr>
|
||||||
<tr><td>9.0.1</td><td>base-4.15.0.0</td></tr>
|
<tr><td>9.0.1</td><td>base-4.15.0.0</td></tr>
|
||||||
<tr><td>8.10.7</td><td>base-4.14.3.0</td></tr>
|
<tr><td>8.10.7</td><td><span style="color:green">recommended</span>, base-4.14.3.0</td></tr>
|
||||||
<tr><td>8.10.6</td><td>base-4.14.3.0</td></tr>
|
<tr><td>8.10.6</td><td>base-4.14.3.0</td></tr>
|
||||||
<tr><td>8.10.5</td><td>base-4.14.2.0</td></tr>
|
<tr><td>8.10.5</td><td>base-4.14.2.0</td></tr>
|
||||||
<tr><td>8.10.4</td><td>base-4.14.1.0</td></tr>
|
<tr><td>8.10.4</td><td>base-4.14.1.0</td></tr>
|
||||||
@@ -135,8 +93,7 @@ GHCup supports the following tools, which are also known as the **Haskell Toolch
|
|||||||
<table>
|
<table>
|
||||||
<thead><tr><th>Cabal Version</th><th>Tags</th></tr></thead>
|
<thead><tr><th>Cabal Version</th><th>Tags</th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>3.8.1.0</td><td><span style="color:blue">latest</span></td></tr>
|
<tr><td>3.6.2.0</td><td><span style="color:blue">latest</span>, <span style="color:green">recommended</span></td></tr>
|
||||||
<tr><td>3.6.2.0</td><td><span style="color:green">recommended</span></td></tr>
|
|
||||||
<tr><td>3.6.0.0</td><td></td></tr>
|
<tr><td>3.6.0.0</td><td></td></tr>
|
||||||
<tr><td>3.4.1.0</td><td></td></tr>
|
<tr><td>3.4.1.0</td><td></td></tr>
|
||||||
<tr><td>3.4.0.0</td><td></td></tr>
|
<tr><td>3.4.0.0</td><td></td></tr>
|
||||||
@@ -151,8 +108,7 @@ GHCup supports the following tools, which are also known as the **Haskell Toolch
|
|||||||
<table>
|
<table>
|
||||||
<thead><tr><th>HLS Version</th><th>Tags</th></tr></thead>
|
<thead><tr><th>HLS Version</th><th>Tags</th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>1.8.0.0</td><td><span style="color:blue">latest</span>, <span style="color:green">recommended</span></td></tr>
|
<tr><td>1.7.0.0</td><td><span style="color:blue">latest</span>, <span style="color:green">recommended</span></td></tr>
|
||||||
<tr><td>1.7.0.0</td><td></td></tr>
|
|
||||||
<tr><td>1.6.1.0</td><td></td></tr>
|
<tr><td>1.6.1.0</td><td></td></tr>
|
||||||
<tr><td>1.6.0.0</td><td></td></tr>
|
<tr><td>1.6.0.0</td><td></td></tr>
|
||||||
<tr><td>1.5.1</td><td></td></tr>
|
<tr><td>1.5.1</td><td></td></tr>
|
||||||
@@ -169,8 +125,7 @@ GHCup supports the following tools, which are also known as the **Haskell Toolch
|
|||||||
<table>
|
<table>
|
||||||
<thead><tr><th>Stack Version</th><th>Tags</th></tr></thead>
|
<thead><tr><th>Stack Version</th><th>Tags</th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>2.9.1</td><td><span style="color:blue">latest</span>, <span style="color:green">recommended</span></td></tr>
|
<tr><td>2.7.5</td><td><span style="color:blue">latest</span>, <span style="color:green">recommended</span></td></tr>
|
||||||
<tr><td>2.7.5</td><td></td></tr>
|
|
||||||
<tr><td>2.7.3</td><td></td></tr>
|
<tr><td>2.7.3</td><td></td></tr>
|
||||||
<tr><td>2.7.1</td><td></td></tr>
|
<tr><td>2.7.1</td><td></td></tr>
|
||||||
<tr><td>2.5.1</td><td></td></tr>
|
<tr><td>2.5.1</td><td></td></tr>
|
||||||
@@ -230,7 +185,7 @@ HLS bindists are experimental.
|
|||||||
|
|
||||||
Lower availability of bindists. Stack and HLS binaries are experimental.
|
Lower availability of bindists. Stack and HLS binaries are experimental.
|
||||||
|
|
||||||
## Manual installation
|
## Manual install
|
||||||
|
|
||||||
Download the binary for your platform at [https://downloads.haskell.org/~ghcup/](https://downloads.haskell.org/~ghcup/)
|
Download the binary for your platform at [https://downloads.haskell.org/~ghcup/](https://downloads.haskell.org/~ghcup/)
|
||||||
and place it into your `PATH` anywhere.
|
and place it into your `PATH` anywhere.
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ A more thorough introduction to GHCi can be found in the
|
|||||||
### Using external packages in ghci
|
### Using external packages in ghci
|
||||||
|
|
||||||
By default, GHCi can only load and use packages that are
|
By default, GHCi can only load and use packages that are
|
||||||
[included with the GHC installation](https://downloads.haskell.org/ghc/9.4.2/docs/users_guide/9.4.2-notes.html#included-libraries).
|
[included with the GHC installation](https://downloads.haskell.org/ghc/latest/docs/html/users_guide/9.2.2-notes.html#included-libraries).
|
||||||
|
|
||||||
However, users of the [cabal-install](https://www.haskell.org/cabal) and
|
However, users of the [cabal-install](https://www.haskell.org/cabal) and
|
||||||
[stack](http://haskellstack.org) build tools can download and load external packages
|
[stack](http://haskellstack.org) build tools can download and load external packages
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ import Prelude hiding ( abs
|
|||||||
import System.Environment
|
import System.Environment
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
import System.IO.Temp
|
|
||||||
import Text.Regex.Posix
|
import Text.Regex.Posix
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
@@ -134,7 +133,6 @@ rmTool :: ( MonadReader env m
|
|||||||
=> ListResult
|
=> ListResult
|
||||||
-> Excepts '[NotInstalled, UninstallFailed] m ()
|
-> Excepts '[NotInstalled, UninstallFailed] m ()
|
||||||
rmTool ListResult {lVer, lTool, lCross} = do
|
rmTool ListResult {lVer, lTool, lCross} = do
|
||||||
logInfo $ "removing " <> T.pack (show lTool) <> " version " <> prettyVer lVer
|
|
||||||
case lTool of
|
case lTool of
|
||||||
GHC ->
|
GHC ->
|
||||||
let ghcTargetVersion = GHCTargetVersion lCross lVer
|
let ghcTargetVersion = GHCTargetVersion lCross lVer
|
||||||
@@ -366,12 +364,11 @@ rmGhcup = do
|
|||||||
if isWindows
|
if isWindows
|
||||||
then do
|
then do
|
||||||
-- since it doesn't seem possible to delete a running exe on windows
|
-- since it doesn't seem possible to delete a running exe on windows
|
||||||
-- we move it to system temp dir, to be deleted at next reboot
|
-- we move it to temp dir, to be deleted at next reboot
|
||||||
tmp <- liftIO $ getCanonicalTemporaryDirectory >>= \t -> createTempDirectory t "ghcup"
|
tempFilepath <- mkGhcupTmpDir
|
||||||
logDebug $ "mv " <> T.pack ghcupFilepath <> " " <> T.pack (tmp </> "ghcup")
|
|
||||||
hideError UnsupportedOperation $
|
hideError UnsupportedOperation $
|
||||||
liftIO $ hideError NoSuchThing $
|
liftIO $ hideError NoSuchThing $
|
||||||
moveFile ghcupFilepath (tmp </> "ghcup")
|
moveFile ghcupFilepath (fromGHCupPath tempFilepath </> "ghcup")
|
||||||
else
|
else
|
||||||
-- delete it.
|
-- delete it.
|
||||||
hideError doesNotExistErrorType $ rmFile ghcupFilepath
|
hideError doesNotExistErrorType $ rmFile ghcupFilepath
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -309,12 +309,11 @@ data UserSettings = UserSettings
|
|||||||
, uUrlSource :: Maybe URLSource
|
, uUrlSource :: Maybe URLSource
|
||||||
, uNoNetwork :: Maybe Bool
|
, uNoNetwork :: Maybe Bool
|
||||||
, uGPGSetting :: Maybe GPGSetting
|
, uGPGSetting :: Maybe GPGSetting
|
||||||
, uPlatformOverride :: Maybe PlatformRequest
|
|
||||||
}
|
}
|
||||||
deriving (Show, GHC.Generic)
|
deriving (Show, GHC.Generic)
|
||||||
|
|
||||||
defaultUserSettings :: UserSettings
|
defaultUserSettings :: UserSettings
|
||||||
defaultUserSettings = UserSettings Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
|
defaultUserSettings = UserSettings Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
|
||||||
|
|
||||||
fromSettings :: Settings -> Maybe KeyBindings -> UserSettings
|
fromSettings :: Settings -> Maybe KeyBindings -> UserSettings
|
||||||
fromSettings Settings{..} Nothing =
|
fromSettings Settings{..} Nothing =
|
||||||
@@ -329,7 +328,6 @@ fromSettings Settings{..} Nothing =
|
|||||||
, uKeyBindings = Nothing
|
, uKeyBindings = Nothing
|
||||||
, uUrlSource = Just urlSource
|
, uUrlSource = Just urlSource
|
||||||
, uGPGSetting = Just gpgSetting
|
, uGPGSetting = Just gpgSetting
|
||||||
, uPlatformOverride = platformOverride
|
|
||||||
}
|
}
|
||||||
fromSettings Settings{..} (Just KeyBindings{..}) =
|
fromSettings Settings{..} (Just KeyBindings{..}) =
|
||||||
let ukb = UserKeyBindings
|
let ukb = UserKeyBindings
|
||||||
@@ -354,7 +352,6 @@ fromSettings Settings{..} (Just KeyBindings{..}) =
|
|||||||
, uKeyBindings = Just ukb
|
, uKeyBindings = Just ukb
|
||||||
, uUrlSource = Just urlSource
|
, uUrlSource = Just urlSource
|
||||||
, uGPGSetting = Just gpgSetting
|
, uGPGSetting = Just gpgSetting
|
||||||
, uPlatformOverride = platformOverride
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data UserKeyBindings = UserKeyBindings
|
data UserKeyBindings = UserKeyBindings
|
||||||
@@ -434,7 +431,6 @@ data Settings = Settings
|
|||||||
, noNetwork :: Bool
|
, noNetwork :: Bool
|
||||||
, gpgSetting :: GPGSetting
|
, gpgSetting :: GPGSetting
|
||||||
, noColor :: Bool -- this also exists in LoggerConfig
|
, noColor :: Bool -- this also exists in LoggerConfig
|
||||||
, platformOverride :: Maybe PlatformRequest
|
|
||||||
}
|
}
|
||||||
deriving (Show, GHC.Generic)
|
deriving (Show, GHC.Generic)
|
||||||
|
|
||||||
@@ -442,7 +438,7 @@ defaultMetaCache :: Integer
|
|||||||
defaultMetaCache = 300 -- 5 minutes
|
defaultMetaCache = 300 -- 5 minutes
|
||||||
|
|
||||||
defaultSettings :: Settings
|
defaultSettings :: Settings
|
||||||
defaultSettings = Settings False defaultMetaCache False Never Curl False GHCupURL False GPGNone False Nothing
|
defaultSettings = Settings False defaultMetaCache False Never Curl False GHCupURL False GPGNone False
|
||||||
|
|
||||||
instance NFData Settings
|
instance NFData Settings
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''Global
|
|||||||
deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''KeepDirs
|
deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''KeepDirs
|
||||||
deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''Downloader
|
deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''Downloader
|
||||||
deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GPGSetting
|
deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''GPGSetting
|
||||||
deriveJSON defaultOptions { fieldLabelModifier = \str' -> maybe str' T.unpack . T.stripPrefix (T.pack "r-") . T.pack . kebab . tail $ str' } ''PlatformRequest
|
|
||||||
|
|
||||||
instance ToJSON Tag where
|
instance ToJSON Tag where
|
||||||
toJSON Latest = String "Latest"
|
toJSON Latest = String "Latest"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ theme:
|
|||||||
|
|
||||||
nav:
|
nav:
|
||||||
- Home: index.md
|
- Home: index.md
|
||||||
- "Installation": install.md
|
- "Getting started": install.md
|
||||||
- "First steps": steps.md
|
- "First steps": steps.md
|
||||||
- "User Guide": guide.md
|
- "User Guide": guide.md
|
||||||
- "Developer Guide": dev.md
|
- "Developer Guide": dev.md
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -136,8 +135,11 @@ _eghcup() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ecabal() {
|
||||||
|
edo _ecabal "$@"
|
||||||
|
}
|
||||||
|
|
||||||
_ecabal() {
|
_ecabal() {
|
||||||
# shellcheck disable=SC2317
|
|
||||||
if [ -n "${CABAL_BIN}" ] ; then
|
if [ -n "${CABAL_BIN}" ] ; then
|
||||||
"${CABAL_BIN}" "$@"
|
"${CABAL_BIN}" "$@"
|
||||||
else
|
else
|
||||||
@@ -146,10 +148,6 @@ _ecabal() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ecabal() {
|
|
||||||
edo _ecabal "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
_done() {
|
_done() {
|
||||||
echo
|
echo
|
||||||
echo "==============================================================================="
|
echo "==============================================================================="
|
||||||
@@ -404,11 +402,7 @@ download_ghcup() {
|
|||||||
find_shell() {
|
find_shell() {
|
||||||
case $SHELL in
|
case $SHELL in
|
||||||
*/zsh) # login shell is zsh
|
*/zsh) # login shell is zsh
|
||||||
if [ -n "$ZDOTDIR" ]; then
|
|
||||||
GHCUP_PROFILE_FILE="$ZDOTDIR/.zshrc"
|
|
||||||
else
|
|
||||||
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
||||||
fi
|
|
||||||
MY_SHELL="zsh" ;;
|
MY_SHELL="zsh" ;;
|
||||||
*/bash) # login shell is bash
|
*/bash) # login shell is bash
|
||||||
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
||||||
@@ -698,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
|
||||||
@@ -752,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
|
||||||
@@ -849,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
|
||||||
|
|||||||
@@ -577,8 +577,8 @@ $Msys2Shell = ('{0}\msys2_shell.cmd' -f $MsysDir)
|
|||||||
# The bootstrap script is always silent, since we ask relevant questions here
|
# The bootstrap script is always silent, since we ask relevant questions here
|
||||||
$SilentExport = 'export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 ;'
|
$SilentExport = 'export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 ;'
|
||||||
|
|
||||||
if (!($InstallStack)) {
|
if ($InstallStack) {
|
||||||
$StackInstallExport = 'export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 ;'
|
$StackInstallExport = 'export BOOTSTRAP_HASKELL_INSTALL_STACK=1 ;'
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($InstallHLS) {
|
if ($InstallHLS) {
|
||||||
|
|||||||
@@ -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