Compare commits
28 Commits
monday-imp
...
disable-ca
| Author | SHA1 | Date | |
|---|---|---|---|
| 2850f343b9 | |||
| 55030d83da | |||
| c680a9f33b | |||
| df192ee18e | |||
|
|
008def2ff4 | ||
|
|
3976daddb7 | ||
| 524cdbbeb1 | |||
| a01c5acfe2 | |||
|
|
6689312ac5 | ||
| e214695a3e | |||
| 3cea6ef97c | |||
| 3b0f131a65 | |||
|
|
e0a3020e34 | ||
|
|
0e46b9509a | ||
|
|
d3474d0cd9 | ||
|
|
5c3dad1bb9 | ||
|
|
987cdaf313 | ||
|
|
835352428a | ||
|
|
8f4246e716 | ||
|
|
1353a2fd20 | ||
|
|
aa9fbdbfc2 | ||
| 3a8cdf9967 | |||
| 2caf491e9d | |||
| d277e56121 | |||
| 335099ad19 | |||
| b1106985ec | |||
| dee54445bf | |||
|
|
2df59fd1b3 |
File diff suppressed because it is too large
Load Diff
@@ -107,7 +107,6 @@ toSettings options = do
|
||||
, bSet = fromMaybe bSet kSet
|
||||
, bChangelog = fromMaybe bChangelog kChangelog
|
||||
, bShowAllVersions = fromMaybe bShowAllVersions kShowAll
|
||||
, bShowAllTools = fromMaybe bShowAllTools kShowAllTools
|
||||
}
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
@@ -508,6 +507,9 @@ libraries, this may need some tweaking of `build.mk` or configure args.
|
||||
See `ghcup compile ghc --help` for further information.
|
||||
|
||||
Since ghcup version 0.1.20.0, we provide cross bindists for GHC JS and WASM. These can be installed conveniently.
|
||||
However, these are intended as a developer preview only. By using these GHC variants, you are implicitly signing up to participate in GHC development!
|
||||
If you run into bugs or missing behavior, join the dev chat at https://matrix.to/#/#GHC:matrix.org.
|
||||
|
||||
First, add the cross release channel:
|
||||
|
||||
```sh
|
||||
@@ -516,7 +518,7 @@ ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup
|
||||
|
||||
The next sections explain how to install each cross bindist.
|
||||
|
||||
### GHC JS cross bindists
|
||||
### GHC JS cross bindists (experimental)
|
||||
|
||||
You need the required emscripten JS toolchain:
|
||||
|
||||
@@ -546,7 +548,7 @@ javascript-unknown-ghcjs-ghc -fforce-recomp hello.hs
|
||||
|
||||
You can follow the instructions [here](https://gitlab.haskell.org/ghc/ghc/-/wikis/javascript-backend/building#compiling-hello-world).
|
||||
|
||||
### GHC WASM cross bindists
|
||||
### GHC WASM cross bindists (experimental)
|
||||
|
||||
You need the required wasm toolchain:
|
||||
|
||||
@@ -554,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
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -29,6 +29,7 @@ import Data.Maybe
|
||||
import Options.Applicative hiding ( style )
|
||||
import Prelude hiding ( appendFile )
|
||||
import System.Exit
|
||||
import System.Process ( system )
|
||||
import Text.PrettyPrint.HughesPJClass ( prettyShow )
|
||||
|
||||
import qualified Data.Text as T
|
||||
@@ -128,21 +129,22 @@ changelog ChangeLogOptions{..} runAppState runLogger = do
|
||||
Just uri -> do
|
||||
pfreq <- runAppState getPlatformReq
|
||||
let uri' = T.unpack . decUTF8Safe . serializeURIRef' $ uri
|
||||
cmd = case _rPlatform pfreq of
|
||||
Darwin -> "open"
|
||||
Linux _ -> "xdg-open"
|
||||
FreeBSD -> "xdg-open"
|
||||
Windows -> "start"
|
||||
|
||||
if clOpen
|
||||
then do
|
||||
runAppState $
|
||||
exec cmd
|
||||
[T.unpack $ decUTF8Safe $ serializeURIRef' uri]
|
||||
Nothing
|
||||
Nothing
|
||||
case _rPlatform pfreq of
|
||||
Darwin -> exec "open" [T.unpack $ decUTF8Safe $ serializeURIRef' uri] Nothing Nothing
|
||||
Linux _ -> exec "xdg-open" [T.unpack $ decUTF8Safe $ serializeURIRef' uri] Nothing Nothing
|
||||
FreeBSD -> exec "xdg-open" [T.unpack $ decUTF8Safe $ serializeURIRef' uri] Nothing Nothing
|
||||
Windows -> do
|
||||
let args = "start \"\" " ++ (T.unpack $ decUTF8Safe $ serializeURIRef' uri)
|
||||
c <- liftIO $ system $ args
|
||||
case c of
|
||||
(ExitFailure xi) -> pure $ Left $ NonZeroExit xi "cmd.exe" [args]
|
||||
ExitSuccess -> pure $ Right ()
|
||||
>>= \case
|
||||
Right _ -> pure ExitSuccess
|
||||
Left e -> logError (T.pack $ prettyHFError e)
|
||||
>> pure (ExitFailure 13)
|
||||
else liftIO $ putStrLn uri' >> pure ExitSuccess
|
||||
|
||||
|
||||
@@ -149,7 +149,6 @@ updateSettings usl usr =
|
||||
, kSet = kSet kbl <|> kSet kbr
|
||||
, kChangelog = kChangelog kbl <|> kChangelog kbr
|
||||
, kShowAll = kShowAll kbl <|> kShowAll kbr
|
||||
, kShowAllTools = kShowAllTools kbl <|> kShowAllTools kbr
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -152,6 +152,9 @@ getLinuxDistro = do
|
||||
| hasWord name ["exherbo"] -> Exherbo
|
||||
| hasWord name ["gentoo"] -> Gentoo
|
||||
| hasWord name ["amazonlinux", "Amazon Linux"] -> AmazonLinux
|
||||
| hasWord name ["rocky", "Rocky Linux"] -> Rocky
|
||||
-- https://github.com/void-linux/void-packages/blob/master/srcpkgs/base-files/files/os-release
|
||||
| hasWord name ["void", "Void Linux"] -> Void
|
||||
| otherwise -> UnknownLinux
|
||||
pure (distro, parsedVer)
|
||||
where
|
||||
|
||||
@@ -80,7 +80,7 @@ logInternal logLevel msg = do
|
||||
Info -> style' "[ Info ]"
|
||||
Warn -> style' "[ Warn ]"
|
||||
Error -> style' "[ Error ]"
|
||||
let strs = T.split (== '\n') msg
|
||||
let strs = T.split (== '\n') . T.dropWhileEnd (`elem` ("\n\r" :: String)) $ msg
|
||||
let out = case strs of
|
||||
[] -> T.empty
|
||||
(x:xs) ->
|
||||
|
||||
@@ -422,7 +422,6 @@ fromSettings Settings{..} (Just KeyBindings{..}) =
|
||||
, kSet = Just bSet
|
||||
, kChangelog = Just bChangelog
|
||||
, kShowAll = Just bShowAllVersions
|
||||
, kShowAllTools = Just bShowAllTools
|
||||
}
|
||||
in UserSettings {
|
||||
uCache = Just cache
|
||||
@@ -449,7 +448,6 @@ data UserKeyBindings = UserKeyBindings
|
||||
, kSet :: Maybe KeyCombination
|
||||
, kChangelog :: Maybe KeyCombination
|
||||
, kShowAll :: Maybe KeyCombination
|
||||
, kShowAllTools :: Maybe KeyCombination
|
||||
}
|
||||
deriving (Show, GHC.Generic, Eq)
|
||||
|
||||
@@ -462,7 +460,6 @@ data KeyBindings = KeyBindings
|
||||
, bSet :: KeyCombination
|
||||
, bChangelog :: KeyCombination
|
||||
, bShowAllVersions :: KeyCombination
|
||||
, bShowAllTools :: KeyCombination
|
||||
}
|
||||
deriving (Show, GHC.Generic)
|
||||
|
||||
@@ -485,7 +482,6 @@ defaultKeyBindings = KeyBindings
|
||||
, bSet = KeyCombination { key = KChar 's', mods = [] }
|
||||
, bChangelog = KeyCombination { key = KChar 'c', mods = [] }
|
||||
, bShowAllVersions = KeyCombination { key = KChar 'a', mods = [] }
|
||||
, bShowAllTools = KeyCombination { key = KChar 't', mods = [] }
|
||||
}
|
||||
|
||||
data AppState = AppState
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# * BOOTSTRAP_HASKELL_VERBOSE - any nonzero value for more verbose installation
|
||||
# * BOOTSTRAP_HASKELL_GHC_VERSION - the ghc version to install
|
||||
# * BOOTSTRAP_HASKELL_CABAL_VERSION - the cabal version to install
|
||||
# * BOOTSTRAP_HASKELL_CABAL_XDG - don't disable the XDG logic (this doesn't force XDG though, because cabal is confusing)
|
||||
# * BOOTSTRAP_HASKELL_INSTALL_NO_STACK - disable installation of stack
|
||||
# * BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK - disable installation stack ghcup hook
|
||||
# * BOOTSTRAP_HASKELL_INSTALL_HLS - whether to install latest hls
|
||||
@@ -35,7 +36,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 +73,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 +89,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 +105,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 +161,7 @@ _done() {
|
||||
echo
|
||||
echo "==============================================================================="
|
||||
case "${plat}" in
|
||||
MSYS*|MINGW*)
|
||||
MSYS*|MINGW*|CYGWIN*)
|
||||
green
|
||||
green "All done!"
|
||||
green
|
||||
@@ -313,7 +314,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 +327,7 @@ download_ghcup() {
|
||||
;;
|
||||
esac
|
||||
case "${plat}" in
|
||||
MSYS*|MINGW*)
|
||||
MSYS*|MINGW*|CYGWIN*)
|
||||
case "${BOOTSTRAP_HASKELL_DOWNLOADER}" in
|
||||
"curl")
|
||||
# shellcheck disable=SC2086
|
||||
@@ -545,7 +546,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 +596,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 +637,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 +757,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")"
|
||||
;;
|
||||
*)
|
||||
@@ -820,10 +821,19 @@ if [ -z "${BOOTSTRAP_HASKELL_MINIMAL}" ] ; then
|
||||
|
||||
do_cabal_config_init $ask_cabal_config_init_answer
|
||||
|
||||
if [ -z "${BOOTSTRAP_HASKELL_CABAL_XDG}" ] ; then
|
||||
# disable XDG if we can
|
||||
if [ -e "${XDG_CONFIG_HOME:-"$HOME/.config"}/cabal" ] || [ -n "${CABAL_DIR}" ] || [ -n "${CABAL_CONFIG}" ] ; then
|
||||
:
|
||||
else
|
||||
edo mkdir -p "${HOME}/.cabal"
|
||||
fi
|
||||
fi
|
||||
|
||||
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)"
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user