Compare commits

..

21 Commits

Author SHA1 Message Date
16e20ed474 Set LD=ld.bfd on Alpine linux during bindist configure 2024-01-04 20:53:21 +08:00
55030d83da Merge branch 'issue-958' 2024-01-01 21:40:36 +08:00
c680a9f33b Support cygwin in bootstrap-haskell too
Fixes #958
2023-12-29 19:56:38 +08:00
df192ee18e Merge remote-tracking branch 'origin/pr/956' 2023-12-26 21:41:40 +08:00
Rune K. Svendsen
008def2ff4 Add comment about why we ignore this error 2023-12-20 10:26:42 +01:00
Rune K. Svendsen
3976daddb7 bootstrap-haskell.ps1: don't exit if tmp file removal fails 2023-12-20 10:21:22 +01:00
524cdbbeb1 Merge remote-tracking branch 'origin/pr/953' 2023-12-15 23:53:59 +08:00
a01c5acfe2 Update submodules 2023-12-15 23:53:41 +08:00
Rune K. Svendsen
6689312ac5 docs: remove "TUI not supported on Windows"
TUI works on Windows since v0.1.20.0 (cf. https://github.com/haskell/ghcup-hs/pull/912)
2023-12-15 16:49:55 +01:00
e214695a3e Merge remote-tracking branch 'origin/pr/850' 2023-12-02 18:42:22 +08:00
3cea6ef97c Merge remote-tracking branch 'origin/pr/937' 2023-11-28 21:25:12 +08:00
3b0f131a65 Merge remote-tracking branch 'origin/pr/940' 2023-11-28 21:08:49 +08:00
konsumlamm
e0a3020e34 Update WASM install instructions 2023-11-28 13:55:52 +01:00
Luis Morillo
0e46b9509a complete tutorial. remove show all tools from widgets. resolve some conflicts. 2023-11-23 16:05:12 +01:00
Luis Morillo
d3474d0cd9 add KeyInfo handler and widget. Improve tutorial 2023-11-23 15:32:23 +01:00
Luis Morillo
5c3dad1bb9 reorganize code by sections 2023-11-23 15:31:33 +01:00
Luis Morillo
987cdaf313 factor out attr names. Add windows symbols to tutotial widget. Improve tutorial aesthetics and text 2023-11-23 15:28:21 +01:00
Luis Morillo
835352428a simplify rendering for better ux 2023-11-23 15:28:19 +01:00
Luis Morillo
8f4246e716 Use proper Name type and Modal type. Create tutorial Widget 2023-11-23 15:27:33 +01:00
Luis Morillo
1353a2fd20 use map-like data structure 2023-11-23 15:26:49 +01:00
Luis Morillo
aa9fbdbfc2 Use MonadState Instance to simplify install', del', set' and changelog'. Lensify the app 2023-11-23 15:24:24 +01:00
7 changed files with 597 additions and 265 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@ This is a more in-depth guide specific to GHCup. `ghcup --help` is your friend.
## 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
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:
1. `ghcup tui` is only available on non-windows platforms
2. legacy subcommands `ghcup install` (without a tool identifier) and `ghcup install-cabal` may be removed in the future
1. legacy subcommands `ghcup install` (without a tool identifier) and `ghcup install-cabal` may be removed in the future
# Configuration
@@ -557,7 +556,7 @@ You need the required wasm toolchain:
git clone https://gitlab.haskell.org/ghc/ghc-wasm-meta.git
cd ghc-wasm-meta/
export SKIP_GHC=yes
sh setup.sh
./setup.sh
source ~/.ghc-wasm/env
```

View File

@@ -327,6 +327,8 @@ executable ghcup
, brick ^>=2.1
, transformers ^>=0.5
, vty ^>=6.0
, unix ^>=2.7
, optics ^>=0.4
if os(windows)
cpp-options: -DIS_WINDOWS

View File

@@ -449,13 +449,30 @@ installUnpackedGHC path inst tver forceInstall addConfArgs
= []
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"
("./configure" : ("--prefix=" <> fromInstallDir inst)
: (maybe mempty (\x -> ["--target=" <> T.unpack x]) (_tvTarget tver) <> ldOverride <> (T.unpack <$> addConfArgs))
)
(Just $ fromGHCupPath path)
"ghc-configure"
Nothing
env
tmpInstallDest <- lift withGHCupTmpDir
lEM $ make ["DESTDIR=" <> fromGHCupPath tmpInstallDest, "install"] (Just $ fromGHCupPath path)
liftE $ catchWarn $ lEM @_ @'[ProcessError] $ darwinNotarization _rPlatform (fromGHCupPath tmpInstallDest)

View File

@@ -35,7 +35,7 @@ export GHCUP_SKIP_UPDATE_CHECK=yes
: "${BOOTSTRAP_HASKELL_DOWNLOADER:=curl}"
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
: "${GHCUP_INSTALL_BASE_PREFIX:=/c}"
GHCUP_DIR=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup")
GHCUP_BIN=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin")
@@ -72,7 +72,7 @@ warn() {
printf "%s\\n" "$1"
else
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
# shellcheck disable=SC3037
echo -e "\\033[0;35m$1\\033[0m"
;;
@@ -88,7 +88,7 @@ yellow() {
printf "%s\\n" "$1"
else
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
# shellcheck disable=SC3037
echo -e "\\033[0;33m$1\\033[0m"
;;
@@ -104,7 +104,7 @@ green() {
printf "%s\\n" "$1"
else
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
# shellcheck disable=SC3037
echo -e "\\033[0;32m$1\\033[0m"
;;
@@ -160,7 +160,7 @@ _done() {
echo
echo "==============================================================================="
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
green
green "All done!"
green
@@ -313,7 +313,7 @@ download_ghcup() {
;;
esac
;;
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
case "${arch}" in
x86_64|amd64)
_url=${GHCUP_BASE_URL}/${ghver}/x86_64-mingw64-ghcup-${ghver}.exe
@@ -326,7 +326,7 @@ download_ghcup() {
;;
esac
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
case "${BOOTSTRAP_HASKELL_DOWNLOADER}" in
"curl")
# shellcheck disable=SC2086
@@ -545,7 +545,7 @@ adjust_bashrc() {
printf "\n%s" "[[ -f ~/.bashrc ]] && source ~/.bashrc # ghcup-env" >> "${HOME}/.bash_profile"
fi
;;
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
if [ ! -e "${HOME}/.bash_profile" ] ; then
echo '# generated by ghcup' > "${HOME}/.bash_profile"
echo 'test -f ~/.profile && . ~/.profile' >> "${HOME}/.bash_profile"
@@ -595,7 +595,7 @@ adjust_cabal_config() {
ask_cabal_config_init() {
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
if [ -n "${BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG}" ] ; then
return 1
fi
@@ -636,7 +636,7 @@ ask_cabal_config_init() {
do_cabal_config_init() {
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
case $1 in
1)
adjust_cabal_config
@@ -756,7 +756,7 @@ if [ -z "${GHCUP_USE_XDG_DIRS}" ] ; then
echo "ghcup installs only into the following directory,"
echo "which can be removed anytime:"
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
echo " $(cygpath -w "$GHCUP_DIR")"
;;
*)
@@ -823,7 +823,7 @@ if [ -z "${BOOTSTRAP_HASKELL_MINIMAL}" ] ; then
edo cabal update --ignore-project
else # don't install ghc and cabal
case "${plat}" in
MSYS*|MINGW*)
MSYS*|MINGW*|CYGWIN*)
# need to bootstrap cabal to initialize config on windows
# we'll remove it afterwards
tmp_dir="$(mktemp -d)"

View File

@@ -476,7 +476,9 @@ if (!(Test-Path -Path ('{0}' -f $MsysDir))) {
Print-Msg -msg 'Extracting Msys2 archive...'
$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...'
Exec "$Bash" '-lc' 'exit'