Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16e20ed474 | |||
| 55030d83da | |||
| c680a9f33b | |||
| df192ee18e | |||
|
|
008def2ff4 | ||
|
|
3976daddb7 | ||
| 524cdbbeb1 | |||
| a01c5acfe2 | |||
|
|
6689312ac5 | ||
| e214695a3e | |||
| 3cea6ef97c | |||
| 3b0f131a65 | |||
|
|
e0a3020e34 | ||
|
|
0e46b9509a | ||
|
|
d3474d0cd9 | ||
|
|
5c3dad1bb9 | ||
|
|
987cdaf313 | ||
|
|
835352428a | ||
|
|
8f4246e716 | ||
|
|
1353a2fd20 | ||
|
|
aa9fbdbfc2 |
File diff suppressed because it is too large
Load Diff
Submodule data/metadata updated: 0239166c31...7e1a50cfff
@@ -4,7 +4,7 @@ This is a more in-depth guide specific to GHCup. `ghcup --help` is your friend.
|
|||||||
|
|
||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
||||||
For the simple, interactive, text-based user interface (TUI) (not available on windows), run:
|
For the simple, interactive, text-based user interface (TUI), run:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ghcup tui
|
ghcup tui
|
||||||
@@ -67,8 +67,7 @@ and make sure your bashrc sources the startup script
|
|||||||
|
|
||||||
`ghcup` is very portable. There are a few exceptions though:
|
`ghcup` is very portable. There are a few exceptions though:
|
||||||
|
|
||||||
1. `ghcup tui` is only available on non-windows platforms
|
1. legacy subcommands `ghcup install` (without a tool identifier) and `ghcup install-cabal` may be removed in the future
|
||||||
2. legacy subcommands `ghcup install` (without a tool identifier) and `ghcup install-cabal` may be removed in the future
|
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
|
|
||||||
@@ -557,7 +556,7 @@ You need the required wasm toolchain:
|
|||||||
git clone https://gitlab.haskell.org/ghc/ghc-wasm-meta.git
|
git clone https://gitlab.haskell.org/ghc/ghc-wasm-meta.git
|
||||||
cd ghc-wasm-meta/
|
cd ghc-wasm-meta/
|
||||||
export SKIP_GHC=yes
|
export SKIP_GHC=yes
|
||||||
sh setup.sh
|
./setup.sh
|
||||||
source ~/.ghc-wasm/env
|
source ~/.ghc-wasm/env
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -327,6 +327,8 @@ executable ghcup
|
|||||||
, brick ^>=2.1
|
, brick ^>=2.1
|
||||||
, transformers ^>=0.5
|
, transformers ^>=0.5
|
||||||
, vty ^>=6.0
|
, vty ^>=6.0
|
||||||
|
, unix ^>=2.7
|
||||||
|
, optics ^>=0.4
|
||||||
|
|
||||||
if os(windows)
|
if os(windows)
|
||||||
cpp-options: -DIS_WINDOWS
|
cpp-options: -DIS_WINDOWS
|
||||||
|
|||||||
@@ -449,13 +449,30 @@ installUnpackedGHC path inst tver forceInstall addConfArgs
|
|||||||
= []
|
= []
|
||||||
|
|
||||||
lift $ logInfo "Installing GHC (this may take a while)"
|
lift $ logInfo "Installing GHC (this may take a while)"
|
||||||
|
env <- case _rPlatform of
|
||||||
|
-- https://github.com/haskell/ghcup-hs/issues/967
|
||||||
|
Linux Alpine
|
||||||
|
-- lets not touch LD for cross targets
|
||||||
|
| Nothing <- _tvTarget tver -> do
|
||||||
|
cEnv <- liftIO getEnvironment
|
||||||
|
spaths <- liftIO getSearchPath
|
||||||
|
has_ld_bfd <- isJust <$> liftIO (searchPath spaths "ld.bfd")
|
||||||
|
let ldSet = isJust $ lookup "LD" cEnv
|
||||||
|
-- only set LD if ld.bfd exists in PATH and LD is not set
|
||||||
|
-- already
|
||||||
|
if has_ld_bfd && not ldSet
|
||||||
|
then do
|
||||||
|
lift $ logInfo "Detected alpine linux... setting LD=ld.bfd"
|
||||||
|
pure $ Just (("LD", "ld.bfd") : cEnv)
|
||||||
|
else pure Nothing
|
||||||
|
_ -> pure Nothing
|
||||||
lEM $ execLogged "sh"
|
lEM $ execLogged "sh"
|
||||||
("./configure" : ("--prefix=" <> fromInstallDir inst)
|
("./configure" : ("--prefix=" <> fromInstallDir inst)
|
||||||
: (maybe mempty (\x -> ["--target=" <> T.unpack x]) (_tvTarget tver) <> ldOverride <> (T.unpack <$> addConfArgs))
|
: (maybe mempty (\x -> ["--target=" <> T.unpack x]) (_tvTarget tver) <> ldOverride <> (T.unpack <$> addConfArgs))
|
||||||
)
|
)
|
||||||
(Just $ fromGHCupPath path)
|
(Just $ fromGHCupPath path)
|
||||||
"ghc-configure"
|
"ghc-configure"
|
||||||
Nothing
|
env
|
||||||
tmpInstallDest <- lift withGHCupTmpDir
|
tmpInstallDest <- lift withGHCupTmpDir
|
||||||
lEM $ make ["DESTDIR=" <> fromGHCupPath tmpInstallDest, "install"] (Just $ fromGHCupPath path)
|
lEM $ make ["DESTDIR=" <> fromGHCupPath tmpInstallDest, "install"] (Just $ fromGHCupPath path)
|
||||||
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform (fromGHCupPath tmpInstallDest)
|
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform (fromGHCupPath tmpInstallDest)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export GHCUP_SKIP_UPDATE_CHECK=yes
|
|||||||
: "${BOOTSTRAP_HASKELL_DOWNLOADER:=curl}"
|
: "${BOOTSTRAP_HASKELL_DOWNLOADER:=curl}"
|
||||||
|
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
: "${GHCUP_INSTALL_BASE_PREFIX:=/c}"
|
: "${GHCUP_INSTALL_BASE_PREFIX:=/c}"
|
||||||
GHCUP_DIR=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup")
|
GHCUP_DIR=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup")
|
||||||
GHCUP_BIN=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin")
|
GHCUP_BIN=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin")
|
||||||
@@ -72,7 +72,7 @@ warn() {
|
|||||||
printf "%s\\n" "$1"
|
printf "%s\\n" "$1"
|
||||||
else
|
else
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
# shellcheck disable=SC3037
|
# shellcheck disable=SC3037
|
||||||
echo -e "\\033[0;35m$1\\033[0m"
|
echo -e "\\033[0;35m$1\\033[0m"
|
||||||
;;
|
;;
|
||||||
@@ -88,7 +88,7 @@ yellow() {
|
|||||||
printf "%s\\n" "$1"
|
printf "%s\\n" "$1"
|
||||||
else
|
else
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
# shellcheck disable=SC3037
|
# shellcheck disable=SC3037
|
||||||
echo -e "\\033[0;33m$1\\033[0m"
|
echo -e "\\033[0;33m$1\\033[0m"
|
||||||
;;
|
;;
|
||||||
@@ -104,7 +104,7 @@ green() {
|
|||||||
printf "%s\\n" "$1"
|
printf "%s\\n" "$1"
|
||||||
else
|
else
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
# shellcheck disable=SC3037
|
# shellcheck disable=SC3037
|
||||||
echo -e "\\033[0;32m$1\\033[0m"
|
echo -e "\\033[0;32m$1\\033[0m"
|
||||||
;;
|
;;
|
||||||
@@ -160,7 +160,7 @@ _done() {
|
|||||||
echo
|
echo
|
||||||
echo "==============================================================================="
|
echo "==============================================================================="
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
green
|
green
|
||||||
green "All done!"
|
green "All done!"
|
||||||
green
|
green
|
||||||
@@ -313,7 +313,7 @@ download_ghcup() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
case "${arch}" in
|
case "${arch}" in
|
||||||
x86_64|amd64)
|
x86_64|amd64)
|
||||||
_url=${GHCUP_BASE_URL}/${ghver}/x86_64-mingw64-ghcup-${ghver}.exe
|
_url=${GHCUP_BASE_URL}/${ghver}/x86_64-mingw64-ghcup-${ghver}.exe
|
||||||
@@ -326,7 +326,7 @@ download_ghcup() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
case "${BOOTSTRAP_HASKELL_DOWNLOADER}" in
|
case "${BOOTSTRAP_HASKELL_DOWNLOADER}" in
|
||||||
"curl")
|
"curl")
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
@@ -545,7 +545,7 @@ adjust_bashrc() {
|
|||||||
printf "\n%s" "[[ -f ~/.bashrc ]] && source ~/.bashrc # ghcup-env" >> "${HOME}/.bash_profile"
|
printf "\n%s" "[[ -f ~/.bashrc ]] && source ~/.bashrc # ghcup-env" >> "${HOME}/.bash_profile"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
if [ ! -e "${HOME}/.bash_profile" ] ; then
|
if [ ! -e "${HOME}/.bash_profile" ] ; then
|
||||||
echo '# generated by ghcup' > "${HOME}/.bash_profile"
|
echo '# generated by ghcup' > "${HOME}/.bash_profile"
|
||||||
echo 'test -f ~/.profile && . ~/.profile' >> "${HOME}/.bash_profile"
|
echo 'test -f ~/.profile && . ~/.profile' >> "${HOME}/.bash_profile"
|
||||||
@@ -595,7 +595,7 @@ adjust_cabal_config() {
|
|||||||
|
|
||||||
ask_cabal_config_init() {
|
ask_cabal_config_init() {
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
if [ -n "${BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG}" ] ; then
|
if [ -n "${BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG}" ] ; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -636,7 +636,7 @@ ask_cabal_config_init() {
|
|||||||
|
|
||||||
do_cabal_config_init() {
|
do_cabal_config_init() {
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
case $1 in
|
case $1 in
|
||||||
1)
|
1)
|
||||||
adjust_cabal_config
|
adjust_cabal_config
|
||||||
@@ -756,7 +756,7 @@ if [ -z "${GHCUP_USE_XDG_DIRS}" ] ; then
|
|||||||
echo "ghcup installs only into the following directory,"
|
echo "ghcup installs only into the following directory,"
|
||||||
echo "which can be removed anytime:"
|
echo "which can be removed anytime:"
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
echo " $(cygpath -w "$GHCUP_DIR")"
|
echo " $(cygpath -w "$GHCUP_DIR")"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -823,7 +823,7 @@ if [ -z "${BOOTSTRAP_HASKELL_MINIMAL}" ] ; then
|
|||||||
edo cabal update --ignore-project
|
edo cabal update --ignore-project
|
||||||
else # don't install ghc and cabal
|
else # don't install ghc and cabal
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*|CYGWIN*)
|
||||||
# need to bootstrap cabal to initialize config on windows
|
# need to bootstrap cabal to initialize config on windows
|
||||||
# we'll remove it afterwards
|
# we'll remove it afterwards
|
||||||
tmp_dir="$(mktemp -d)"
|
tmp_dir="$(mktemp -d)"
|
||||||
|
|||||||
@@ -476,7 +476,9 @@ if (!(Test-Path -Path ('{0}' -f $MsysDir))) {
|
|||||||
|
|
||||||
Print-Msg -msg 'Extracting Msys2 archive...'
|
Print-Msg -msg 'Extracting Msys2 archive...'
|
||||||
$null = & "$archivePath" '-y' ('-o{0}' -f $GhcupDir) # Extract
|
$null = & "$archivePath" '-y' ('-o{0}' -f $GhcupDir) # Extract
|
||||||
Remove-Item -Path "$archivePath"
|
# We ignore errors because we don't want the installation script to fail just because a temporary file can't be removed.
|
||||||
|
# Relevant issue: https://github.com/haskell/ghcup-hs/issues/952
|
||||||
|
Remove-Item -Path "$archivePath" -ErrorAction Continue
|
||||||
|
|
||||||
Print-Msg -msg 'Processing MSYS2 bash for first time use...'
|
Print-Msg -msg 'Processing MSYS2 bash for first time use...'
|
||||||
Exec "$Bash" '-lc' 'exit'
|
Exec "$Bash" '-lc' 'exit'
|
||||||
|
|||||||
Reference in New Issue
Block a user