Compare commits
8 Commits
v0.1.17.7-
...
issue-354
| Author | SHA1 | Date | |
|---|---|---|---|
|
9daca301a0
|
|||
|
9ad1f7cb97
|
|||
|
0856a96738
|
|||
|
ee9801a8c2
|
|||
|
cfecc11b43
|
|||
|
3d36348563
|
|||
|
dcbee9c7dc
|
|||
|
2d88b1197e
|
@@ -1,5 +1,9 @@
|
|||||||
# Revision history for ghcup
|
# Revision history for ghcup
|
||||||
|
|
||||||
|
## 0.1.17.7 -- 2022-04-21
|
||||||
|
|
||||||
|
* Fix `ghcup run` on windows wrt [#345](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/345)
|
||||||
|
|
||||||
## 0.1.17.6 -- 2022-03-18
|
## 0.1.17.6 -- 2022-03-18
|
||||||
|
|
||||||
* Vastly improve shell completions wrt [#242](https://gitlab.haskell.org/haskell/ghcup-hs/-/merge_requests/242)
|
* Vastly improve shell completions wrt [#242](https://gitlab.haskell.org/haskell/ghcup-hs/-/merge_requests/242)
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ source-repository-package
|
|||||||
|
|
||||||
constraints: http-io-streams -brotli,
|
constraints: http-io-streams -brotli,
|
||||||
any.Cabal ==3.6.2.0,
|
any.Cabal ==3.6.2.0,
|
||||||
any.aeson >= 2.0.1.0
|
any.aeson >= 2.0.1.0,
|
||||||
|
-- https://github.com/typeable/generic-arbitrary/issues/14
|
||||||
|
any.generic-arbitrary < 0.2.1
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
flags: -system-libarchive
|
flags: -system-libarchive
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cabal-version: 3.0
|
cabal-version: 3.0
|
||||||
name: ghcup
|
name: ghcup
|
||||||
version: 0.1.17.6
|
version: 0.1.17.7
|
||||||
license: LGPL-3.0-only
|
license: LGPL-3.0-only
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
copyright: Julian Ospald 2020
|
copyright: Julian Ospald 2020
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ recyclePathForcibly fp
|
|||||||
liftIO (moveFile fp dest)
|
liftIO (moveFile fp dest)
|
||||||
`catch`
|
`catch`
|
||||||
(\e -> if | isDoesNotExistError e -> pure ()
|
(\e -> if | isDoesNotExistError e -> pure ()
|
||||||
| isPermissionError e {- EXDEV on windows -} -> recover (liftIO $ removePathForcibly fp)
|
| isPermissionError e || ioeGetErrorType e == UnsupportedOperation {- EXDEV on windows -} -> recover (liftIO $ removePathForcibly fp)
|
||||||
| otherwise -> throwIO e)
|
| otherwise -> throwIO e)
|
||||||
`finally`
|
`finally`
|
||||||
liftIO (handleIO (\_ -> pure ()) $ removePathForcibly tmp)
|
liftIO (handleIO (\_ -> pure ()) $ removePathForcibly tmp)
|
||||||
@@ -515,7 +515,7 @@ recycleFile fp
|
|||||||
let dest = tmp </> takeFileName fp
|
let dest = tmp </> takeFileName fp
|
||||||
liftIO (moveFile fp dest)
|
liftIO (moveFile fp dest)
|
||||||
`catch`
|
`catch`
|
||||||
(\e -> if isPermissionError e {- EXDEV on windows -} then recover (liftIO $ removePathForcibly fp) else throwIO e)
|
(\e -> if isPermissionError e || ioeGetErrorType e == UnsupportedOperation {- EXDEV on windows -} then recover (liftIO $ removePathForcibly fp) else throwIO e)
|
||||||
`finally`
|
`finally`
|
||||||
liftIO (handleIO (\_ -> pure ()) $ removePathForcibly tmp)
|
liftIO (handleIO (\_ -> pure ()) $ removePathForcibly tmp)
|
||||||
| otherwise = liftIO $ removeFile fp
|
| otherwise = liftIO $ removeFile fp
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
# * 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
|
||||||
|
# * GHCUP_BASE_URL - the base url for ghcup binary download (use this to overwrite https://downloads.haskell.org/~ghcup with a mirror)
|
||||||
|
|
||||||
# License: LGPL-3.0
|
# License: LGPL-3.0
|
||||||
|
|
||||||
@@ -25,8 +26,8 @@
|
|||||||
|
|
||||||
plat="$(uname -s)"
|
plat="$(uname -s)"
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
ghver="0.1.17.6"
|
ghver="0.1.17.7"
|
||||||
base_url="https://downloads.haskell.org/~ghcup"
|
: "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}"
|
||||||
|
|
||||||
export GHCUP_SKIP_UPDATE_CHECK=yes
|
export GHCUP_SKIP_UPDATE_CHECK=yes
|
||||||
|
|
||||||
@@ -125,10 +126,10 @@ _eghcup() {
|
|||||||
fi
|
fi
|
||||||
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
|
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
"${GHCUP_BIN}/ghcup" ${args} "$@"
|
"ghcup" ${args} "$@"
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
"${GHCUP_BIN}/ghcup" ${args} --verbose "$@"
|
"ghcup" ${args} --verbose "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,99 +228,100 @@ posix_realpath() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
download_ghcup() {
|
download_ghcup() {
|
||||||
|
if ! command -V "ghcup" >/dev/null 2>&1 ; then
|
||||||
|
case "${plat}" in
|
||||||
|
"linux"|"Linux")
|
||||||
|
case "${arch}" in
|
||||||
|
x86_64|amd64)
|
||||||
|
# we could be in a 32bit docker container, in which
|
||||||
|
# case uname doesn't give us what we want
|
||||||
|
if [ "$(getconf LONG_BIT)" = "32" ] ; then
|
||||||
|
_url=${GHCUP_BASE_URL}/${ghver}/i386-linux-ghcup-${ghver}
|
||||||
|
elif [ "$(getconf LONG_BIT)" = "64" ] ; then
|
||||||
|
_url=${GHCUP_BASE_URL}/${ghver}/x86_64-linux-ghcup-${ghver}
|
||||||
|
else
|
||||||
|
die "Unknown long bit size: $(getconf LONG_BIT)"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
i*86)
|
||||||
|
_url=${GHCUP_BASE_URL}/${ghver}/i386-linux-ghcup-${ghver}
|
||||||
|
;;
|
||||||
|
armv7*|*armv8l*)
|
||||||
|
_url=${GHCUP_BASE_URL}/${ghver}/armv7-linux-ghcup-${ghver}
|
||||||
|
;;
|
||||||
|
aarch64|arm64)
|
||||||
|
# we could be in a 32bit docker container, in which
|
||||||
|
# case uname doesn't give us what we want
|
||||||
|
if [ "$(getconf LONG_BIT)" = "32" ] ; then
|
||||||
|
_url=${GHCUP_BASE_URL}/${ghver}/armv7-linux-ghcup-${ghver}
|
||||||
|
elif [ "$(getconf LONG_BIT)" = "64" ] ; then
|
||||||
|
_url=${GHCUP_BASE_URL}/${ghver}/aarch64-linux-ghcup-${ghver}
|
||||||
|
else
|
||||||
|
die "Unknown long bit size: $(getconf LONG_BIT)"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*) die "Unknown architecture: ${arch}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"FreeBSD"|"freebsd")
|
||||||
|
if freebsd-version | grep -E '^12.*' ; then
|
||||||
|
freebsd_ver=12
|
||||||
|
elif freebsd-version | grep -E '^13.*' ; then
|
||||||
|
freebsd_ver=13
|
||||||
|
else
|
||||||
|
die "Unsupported FreeBSD version! Please report a bug at https://gitlab.haskell.org/haskell/ghcup-hs/-/issues"
|
||||||
|
fi
|
||||||
|
|
||||||
case "${plat}" in
|
case "${arch}" in
|
||||||
"linux"|"Linux")
|
x86_64|amd64)
|
||||||
case "${arch}" in
|
;;
|
||||||
x86_64|amd64)
|
i*86)
|
||||||
# we could be in a 32bit docker container, in which
|
die "i386 currently not supported!"
|
||||||
# case uname doesn't give us what we want
|
;;
|
||||||
if [ "$(getconf LONG_BIT)" = "32" ] ; then
|
*) die "Unknown architecture: ${arch}"
|
||||||
_url=${base_url}/${ghver}/i386-linux-ghcup-${ghver}
|
;;
|
||||||
elif [ "$(getconf LONG_BIT)" = "64" ] ; then
|
esac
|
||||||
_url=${base_url}/${ghver}/x86_64-linux-ghcup-${ghver}
|
_url=${GHCUP_BASE_URL}/${ghver}/x86_64-freebsd${freebsd_ver}-ghcup-${ghver}
|
||||||
else
|
;;
|
||||||
die "Unknown long bit size: $(getconf LONG_BIT)"
|
"Darwin"|"darwin")
|
||||||
fi
|
case "${arch}" in
|
||||||
;;
|
x86_64|amd64)
|
||||||
i*86)
|
_url=${GHCUP_BASE_URL}/${ghver}/x86_64-apple-darwin-ghcup-${ghver}
|
||||||
_url=${base_url}/${ghver}/i386-linux-ghcup-${ghver}
|
;;
|
||||||
;;
|
aarch64|arm64|armv8l)
|
||||||
armv7*|*armv8l*)
|
_url=${GHCUP_BASE_URL}/${ghver}/aarch64-apple-darwin-ghcup-${ghver}
|
||||||
_url=${base_url}/${ghver}/armv7-linux-ghcup-${ghver}
|
;;
|
||||||
;;
|
i*86)
|
||||||
aarch64|arm64)
|
die "i386 currently not supported!"
|
||||||
# we could be in a 32bit docker container, in which
|
;;
|
||||||
# case uname doesn't give us what we want
|
*) die "Unknown architecture: ${arch}"
|
||||||
if [ "$(getconf LONG_BIT)" = "32" ] ; then
|
;;
|
||||||
_url=${base_url}/${ghver}/armv7-linux-ghcup-${ghver}
|
esac
|
||||||
elif [ "$(getconf LONG_BIT)" = "64" ] ; then
|
;;
|
||||||
_url=${base_url}/${ghver}/aarch64-linux-ghcup-${ghver}
|
MSYS*|MINGW*)
|
||||||
else
|
case "${arch}" in
|
||||||
die "Unknown long bit size: $(getconf LONG_BIT)"
|
x86_64|amd64)
|
||||||
fi
|
_url=${GHCUP_BASE_URL}/${ghver}/x86_64-mingw64-ghcup-${ghver}.exe
|
||||||
;;
|
;;
|
||||||
*) die "Unknown architecture: ${arch}"
|
*) die "Unknown architecture: ${arch}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
"FreeBSD"|"freebsd")
|
*) die "Unknown platform: ${plat}"
|
||||||
if freebsd-version | grep -E '^12.*' ; then
|
;;
|
||||||
freebsd_ver=12
|
esac
|
||||||
elif freebsd-version | grep -E '^13.*' ; then
|
case "${plat}" in
|
||||||
freebsd_ver=13
|
MSYS*|MINGW*)
|
||||||
else
|
edo curl -Lf "${_url}" > "${GHCUP_BIN}"/ghcup.exe
|
||||||
die "Unsupported FreeBSD version! Please report a bug at https://gitlab.haskell.org/haskell/ghcup-hs/-/issues"
|
edo chmod +x "${GHCUP_BIN}"/ghcup.exe
|
||||||
fi
|
;;
|
||||||
|
*)
|
||||||
case "${arch}" in
|
edo curl -Lf "${_url}" > "${GHCUP_BIN}"/ghcup
|
||||||
x86_64|amd64)
|
edo chmod +x "${GHCUP_BIN}"/ghcup
|
||||||
;;
|
;;
|
||||||
i*86)
|
esac
|
||||||
die "i386 currently not supported!"
|
fi
|
||||||
;;
|
|
||||||
*) die "Unknown architecture: ${arch}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
_url=${base_url}/${ghver}/x86_64-freebsd${freebsd_ver}-ghcup-${ghver}
|
|
||||||
;;
|
|
||||||
"Darwin"|"darwin")
|
|
||||||
case "${arch}" in
|
|
||||||
x86_64|amd64)
|
|
||||||
_url=${base_url}/${ghver}/x86_64-apple-darwin-ghcup-${ghver}
|
|
||||||
;;
|
|
||||||
aarch64|arm64|armv8l)
|
|
||||||
_url=${base_url}/${ghver}/aarch64-apple-darwin-ghcup-${ghver}
|
|
||||||
;;
|
|
||||||
i*86)
|
|
||||||
die "i386 currently not supported!"
|
|
||||||
;;
|
|
||||||
*) die "Unknown architecture: ${arch}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
MSYS*|MINGW*)
|
|
||||||
case "${arch}" in
|
|
||||||
x86_64|amd64)
|
|
||||||
_url=${base_url}/${ghver}/x86_64-mingw64-ghcup-${ghver}.exe
|
|
||||||
;;
|
|
||||||
*) die "Unknown architecture: ${arch}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
*) die "Unknown platform: ${plat}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case "${plat}" in
|
|
||||||
MSYS*|MINGW*)
|
|
||||||
edo curl -Lf "${_url}" > "${GHCUP_BIN}"/ghcup.exe
|
|
||||||
edo chmod +x "${GHCUP_BIN}"/ghcup.exe
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
edo curl -Lf "${_url}" > "${GHCUP_BIN}"/ghcup
|
|
||||||
edo chmod +x "${GHCUP_BIN}"/ghcup
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
edo mkdir -p "${GHCUP_DIR}"
|
edo mkdir -p "${GHCUP_DIR}"
|
||||||
|
|
||||||
@@ -343,7 +345,9 @@ download_ghcup() {
|
|||||||
|
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
edo . "${GHCUP_DIR}"/env
|
edo . "${GHCUP_DIR}"/env
|
||||||
eghcup upgrade
|
if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then
|
||||||
|
ghcup upgrade || yellow "Failed to upgrade ghcup, continuing anyway"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Figures out the users login shell and sets
|
# Figures out the users login shell and sets
|
||||||
@@ -732,13 +736,7 @@ fi
|
|||||||
|
|
||||||
edo mkdir -p "${GHCUP_BIN}"
|
edo mkdir -p "${GHCUP_BIN}"
|
||||||
|
|
||||||
if command -V "ghcup" >/dev/null 2>&1 ; then
|
download_ghcup
|
||||||
if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then
|
|
||||||
_eghcup upgrade || download_ghcup
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
download_ghcup
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
if [ -n "${BOOTSTRAP_HASKELL_YAML}" ] ; then (>&2 ghcup -s "${BOOTSTRAP_HASKELL_YAML}" tool-requirements) ; else (>&2 ghcup tool-requirements) ; fi
|
if [ -n "${BOOTSTRAP_HASKELL_YAML}" ] ; then (>&2 ghcup -s "${BOOTSTRAP_HASKELL_YAML}" tool-requirements) ; else (>&2 ghcup tool-requirements) ; fi
|
||||||
|
|||||||
Reference in New Issue
Block a user