Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
48c54bf374
|
|||
|
51da1578f4
|
|||
|
|
488f25aed6 | ||
|
d355c46250
|
|||
|
787c927de6
|
|||
|
d15ff7bc67
|
|||
|
7c5c35f1b0
|
|||
|
001b090bc6
|
|||
|
db8207f8b9
|
|||
|
e5918de7af
|
|||
|
d2346a543a
|
|||
|
c057b4ae5c
|
|||
|
b962bf4af9
|
|||
|
c54dc05d92
|
|||
|
8c72bf697e
|
|||
|
cc8cf3d12a
|
|||
|
9bdf6bde17
|
|||
|
8363495843
|
|||
|
bc80b1048f
|
|||
|
d61981bc1b
|
|||
|
4ccdc5dd6c
|
|||
|
3240118226
|
|||
|
254989d63d
|
|||
|
283f2a6e46
|
|||
|
94637dfbab
|
@@ -103,7 +103,7 @@ variables:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 2 week
|
expire_in: 2 week
|
||||||
paths:
|
paths:
|
||||||
- golden
|
- test/golden
|
||||||
- dist-newstyle/cache/
|
- dist-newstyle/cache/
|
||||||
when: on_failure
|
when: on_failure
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ test:linux:bootstrap_script:
|
|||||||
test:windows:bootstrap_powershell_script:
|
test:windows:bootstrap_powershell_script:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- ./bootstrap-haskell.ps1 -InstallDir $CI_PROJECT_DIR -BootstrapUrl $CI_PROJECT_DIR/bootstrap-haskell -InBash
|
- ./scripts/bootstrap/bootstrap-haskell.ps1 -InstallDir $CI_PROJECT_DIR -BootstrapUrl $CI_PROJECT_DIR/bootstrap-haskell -InBash
|
||||||
after_script:
|
after_script:
|
||||||
- "[Environment]::SetEnvironmentVariable('GHCUP_INSTALL_BASE_PREFIX', $null, [System.EnvironmentVariableTarget]::User)"
|
- "[Environment]::SetEnvironmentVariable('GHCUP_INSTALL_BASE_PREFIX', $null, [System.EnvironmentVariableTarget]::User)"
|
||||||
- "[Environment]::SetEnvironmentVariable('GHCUP_MSYS2', $null, [System.EnvironmentVariableTarget]::User)"
|
- "[Environment]::SetEnvironmentVariable('GHCUP_MSYS2', $null, [System.EnvironmentVariableTarget]::User)"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export BOOTSTRAP_HASKELL_NONINTERACTIVE=yes
|
|||||||
export BOOTSTRAP_HASKELL_GHC_VERSION=$GHC_VERSION
|
export BOOTSTRAP_HASKELL_GHC_VERSION=$GHC_VERSION
|
||||||
export BOOTSTRAP_HASKELL_CABAL_VERSION=$CABAL_VERSION
|
export BOOTSTRAP_HASKELL_CABAL_VERSION=$CABAL_VERSION
|
||||||
|
|
||||||
./bootstrap-haskell
|
./scripts/bootstrap/bootstrap-haskell
|
||||||
|
|
||||||
[ "$(ghc --numeric-version)" = "${GHC_VERSION}" ]
|
[ "$(ghc --numeric-version)" = "${GHC_VERSION}" ]
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ ecabal() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
eghcup() {
|
eghcup() {
|
||||||
ghcup -v -c -s file://$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml "$@"
|
ghcup -v -c -s file://$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
git describe --always
|
git describe --always
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ ecabal() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
eghcup() {
|
eghcup() {
|
||||||
ghcup -v -c -s file://$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml "$@"
|
ghcup -v -c -s file://$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
git describe --always
|
git describe --always
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ raw_eghcup() {
|
|||||||
|
|
||||||
eghcup() {
|
eghcup() {
|
||||||
if [ "${OS}" = "WINDOWS" ] ; then
|
if [ "${OS}" = "WINDOWS" ] ; then
|
||||||
ghcup -v -c -s file:/$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml "$@"
|
ghcup -v -c -s file:/$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
||||||
else
|
else
|
||||||
ghcup -v -c -s file://$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml "$@"
|
ghcup -v -c -s file://$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ rm -rf "${GHCUP_DIR}"
|
|||||||
### manual cli based testing
|
### manual cli based testing
|
||||||
|
|
||||||
|
|
||||||
ghcup-gen check -f ghcup-${JSON_VERSION}.yaml
|
ghcup-gen check -f data/metadata/ghcup-${JSON_VERSION}.yaml
|
||||||
|
|
||||||
eghcup --numeric-version
|
eghcup --numeric-version
|
||||||
|
|
||||||
@@ -172,10 +172,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# check that lazy loading works for 'whereis'
|
# check that lazy loading works for 'whereis'
|
||||||
cp "$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml" "$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml.bak"
|
cp "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml" "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml.bak"
|
||||||
echo '**' > "$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml"
|
echo '**' > "$CI_PROJECT_DIR/data/metadata/ghcup-${JSON_VERSION}.yaml"
|
||||||
eghcup whereis ghc $(ghc --numeric-version)
|
eghcup whereis ghc $(ghc --numeric-version)
|
||||||
mv -f "$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml.bak" "$CI_PROJECT_DIR/ghcup-${JSON_VERSION}.yaml"
|
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)
|
eghcup rm $(ghc --numeric-version)
|
||||||
|
|
||||||
|
|||||||
82
README.md
82
README.md
@@ -19,7 +19,7 @@ Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [p
|
|||||||
* [Configuration](#configuration)
|
* [Configuration](#configuration)
|
||||||
* [Manpages](#manpages)
|
* [Manpages](#manpages)
|
||||||
* [Shell-completion](#shell-completion)
|
* [Shell-completion](#shell-completion)
|
||||||
* [Cross support](#cross-support)
|
* [Compiling GHC from source](#compiling-ghc-from-source)
|
||||||
* [XDG support](#xdg-support)
|
* [XDG support](#xdg-support)
|
||||||
* [Env variables](#env-variables)
|
* [Env variables](#env-variables)
|
||||||
* [Installing custom bindists](#installing-custom-bindists)
|
* [Installing custom bindists](#installing-custom-bindists)
|
||||||
@@ -91,7 +91,7 @@ handles your haskell packages and can demand that [a specific version](https://c
|
|||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
A configuration file can be put in `~/.ghcup/config.yaml`. The default config file
|
A configuration file can be put in `~/.ghcup/config.yaml`. The default config file
|
||||||
explaining all possible configurations can be found in this repo: [config.yaml](./config.yaml).
|
explaining all possible configurations can be found in this repo: [config.yaml](./data/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.
|
||||||
|
|
||||||
@@ -102,14 +102,26 @@ For man pages to work you need [man-db](http://man-db.nongnu.org/) as your `man`
|
|||||||
|
|
||||||
### Shell-completion
|
### Shell-completion
|
||||||
|
|
||||||
Shell completions are in `shell-completions`.
|
Shell completions are in [scripts/shell-completions](./scripts/shell-completions) directory of this repository.
|
||||||
|
|
||||||
For bash: install `shell-completions/bash`
|
For bash: install `shell-completions/bash`
|
||||||
as e.g. `/etc/bash_completion.d/ghcup` (depending on distro)
|
as e.g. `/etc/bash_completion.d/ghcup` (depending on distro)
|
||||||
and make sure your bashrc sources the startup script
|
and make sure your bashrc sources the startup script
|
||||||
(`/usr/share/bash-completion/bash_completion` on some distros).
|
(`/usr/share/bash-completion/bash_completion` on some distros).
|
||||||
|
|
||||||
### Cross support
|
### Compiling GHC from source
|
||||||
|
|
||||||
|
Compiling from source is supported for both source tarballs and arbitrary git refs. See `ghcup compile ghc --help`
|
||||||
|
for a list of all available options.
|
||||||
|
|
||||||
|
If you need to overwrite the existing `build.mk`, check the default files
|
||||||
|
in [data/build_mk](./data/build_mk), copy them somewhere, adjust them and
|
||||||
|
pass `--config path/to/build.mk` to `ghcup compile ghc`.
|
||||||
|
Common `build.mk` options are explained [here](https://gitlab.haskell.org/ghc/ghc/-/wikis/building/using#build-configuration).
|
||||||
|
|
||||||
|
Make sure your system meets all the [prerequisites](https://gitlab.haskell.org/ghc/ghc/-/wikis/building/preparation).
|
||||||
|
|
||||||
|
#### Cross support
|
||||||
|
|
||||||
ghcup can compile and install a cross GHC for any target. However, this
|
ghcup can compile and install a cross GHC for any target. However, this
|
||||||
requires that the build host has a complete cross toolchain and various
|
requires that the build host has a complete cross toolchain and various
|
||||||
@@ -241,14 +253,15 @@ jobs:
|
|||||||
name: Install ghcup on windows
|
name: Install ghcup on windows
|
||||||
run: Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $false,$true,$true,$false,$false,$false,$false,"C:\"
|
run: Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $false,$true,$true,$false,$false,$false,$false,"C:\"
|
||||||
|
|
||||||
|
- if: matrix.os == 'windows-latest'
|
||||||
|
name: Add ghcup to PATH
|
||||||
|
run: echo "/c/ghcup/bin" >> $GITHUB_PATH
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- if: matrix.os != 'windows-latest'
|
- if: matrix.os != 'windows-latest'
|
||||||
name: Install ghcup on non-windows
|
name: Install ghcup on non-windows
|
||||||
run: curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
|
run: curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
|
||||||
|
|
||||||
- if: matrix.os == 'windows-latest'
|
|
||||||
run: echo "/c/ghcup/bin" >> $GITHUB_PATH
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install ghc/cabal
|
- name: Install ghc/cabal
|
||||||
run: |
|
run: |
|
||||||
ghcup install ghc ${{ matrix.ghc }}
|
ghcup install ghc ${{ matrix.ghc }}
|
||||||
@@ -266,50 +279,6 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cabal test
|
run: cabal test
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Run benches
|
|
||||||
run: cabal bench
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
build-stack:
|
|
||||||
name: Stack ${{ matrix.stack }} ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
|
||||||
stack: ['latest']
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- if: matrix.os == 'windows-latest'
|
|
||||||
name: Install ghcup on windows
|
|
||||||
run: Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $false,$true,$true,$false,$false,$false,$false,"C:\"
|
|
||||||
|
|
||||||
- if: matrix.os != 'windows-latest'
|
|
||||||
name: Install ghcup on non-windows
|
|
||||||
run: curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh
|
|
||||||
|
|
||||||
- if: matrix.os == 'windows-latest'
|
|
||||||
run: echo "/c/ghcup/bin" >> $GITHUB_PATH
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install stack
|
|
||||||
run: ghcup install stack ${{ matrix.stack }}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: stack build
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: stack test
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Run benches
|
|
||||||
run: stack bench
|
|
||||||
shell: bash
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tips and tricks
|
### Tips and tricks
|
||||||
@@ -387,8 +356,13 @@ In addition this script can also install `cabal-install`.
|
|||||||
|
|
||||||
## Known users
|
## Known users
|
||||||
|
|
||||||
* Github action [haskell/actions/setup](https://github.com/haskell/actions/tree/main/setup)
|
* Github actions:
|
||||||
* [vabal](https://github.com/Franciman/vabal)
|
- [actions/virtual-environments](https://github.com/actions/virtual-environments)
|
||||||
|
- [haskell/actions/setup](https://github.com/haskell/actions/tree/main/setup)
|
||||||
|
* mirrors:
|
||||||
|
- [sjtug](https://mirror.sjtu.edu.cn/docs/ghcup)
|
||||||
|
* tools:
|
||||||
|
- [vabal](https://github.com/Franciman/vabal)
|
||||||
|
|
||||||
## Known problems
|
## Known problems
|
||||||
|
|
||||||
|
|||||||
19
RELEASING.md
19
RELEASING.md
@@ -1,19 +0,0 @@
|
|||||||
# RELEASING
|
|
||||||
|
|
||||||
1. update `GHCup.Version` module. `ghcupURL` must only be updated if we change the `_toolRequirements` type or the YAML representation of it. The version of the YAML represents the change increments. `ghcUpVer` is the current application version.
|
|
||||||
|
|
||||||
2. Update version in ghcup.cabal
|
|
||||||
|
|
||||||
3. Add ChangeLog entry
|
|
||||||
|
|
||||||
4. Add/fix downloads in `ghcup-<ver>.yaml`, then verify with `ghcup-gen check -f ghcup-<ver>.yaml`
|
|
||||||
|
|
||||||
5. Commit and git push with tag. Wait for tests to succeed and release artifacts to build.
|
|
||||||
|
|
||||||
6. Download release artifacts and upload them `downloads.haskell.org/ghcup`
|
|
||||||
|
|
||||||
7. Add release artifacts to yaml file (see point 4.)
|
|
||||||
|
|
||||||
8. Upload the final `ghcup-<ver>.yaml` to `webhost.haskell.org/ghcup/data/`.
|
|
||||||
|
|
||||||
9. Update bootstrap-haskell and symlinks on `downloads.haskell.org/ghcup`
|
|
||||||
@@ -57,6 +57,7 @@ import Data.Void
|
|||||||
import GHC.IO.Encoding
|
import GHC.IO.Encoding
|
||||||
import Haskus.Utils.Variant.Excepts
|
import Haskus.Utils.Variant.Excepts
|
||||||
import Language.Haskell.TH
|
import Language.Haskell.TH
|
||||||
|
import Language.Haskell.TH.Syntax ( Quasi(qAddDependentFile) )
|
||||||
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 )
|
||||||
@@ -205,6 +206,11 @@ data ChangeLogOptions = ChangeLogOptions
|
|||||||
|
|
||||||
|
|
||||||
data WhereisCommand = WhereisTool Tool (Maybe ToolVersion)
|
data WhereisCommand = WhereisTool Tool (Maybe ToolVersion)
|
||||||
|
| WhereisBaseDir
|
||||||
|
| WhereisBinDir
|
||||||
|
| WhereisCacheDir
|
||||||
|
| WhereisLogsDir
|
||||||
|
| WhereisConfDir
|
||||||
|
|
||||||
data WhereisOptions = WhereisOptions {
|
data WhereisOptions = WhereisOptions {
|
||||||
directory :: Bool
|
directory :: Bool
|
||||||
@@ -330,7 +336,7 @@ com =
|
|||||||
( Install
|
( Install
|
||||||
<$> info
|
<$> info
|
||||||
(installParser <**> helper)
|
(installParser <**> helper)
|
||||||
( progDesc "Install or update GHC/cabal/HLS"
|
( progDesc "Install or update GHC/cabal/HLS/stack"
|
||||||
<> footerDoc (Just $ text installToolFooter)
|
<> footerDoc (Just $ text installToolFooter)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -346,7 +352,7 @@ com =
|
|||||||
"rm"
|
"rm"
|
||||||
(info
|
(info
|
||||||
(Rm <$> rmParser <**> helper)
|
(Rm <$> rmParser <**> helper)
|
||||||
( progDesc "Remove a GHC/cabal/HLS version"
|
( progDesc "Remove a GHC/cabal/HLS/stack version"
|
||||||
<> footerDoc (Just $ text rmFooter)
|
<> footerDoc (Just $ text rmFooter)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -446,20 +452,20 @@ com =
|
|||||||
installToolFooter = [s|Discussion:
|
installToolFooter = [s|Discussion:
|
||||||
Installs GHC or cabal. When no command is given, installs GHC
|
Installs GHC or cabal. When no command is given, installs GHC
|
||||||
with the specified version/tag.
|
with the specified version/tag.
|
||||||
It is recommended to always specify a subcommand (ghc/cabal/hls).|]
|
It is recommended to always specify a subcommand (ghc/cabal/hls/stack).|]
|
||||||
|
|
||||||
setFooter :: String
|
setFooter :: String
|
||||||
setFooter = [s|Discussion:
|
setFooter = [s|Discussion:
|
||||||
Sets the currently active GHC or cabal version. When no command is given,
|
Sets the currently active GHC or cabal version. When no command is given,
|
||||||
defaults to setting GHC with the specified version/tag (if no tag
|
defaults to setting GHC with the specified version/tag (if no tag
|
||||||
is given, sets GHC to 'recommended' version).
|
is given, sets GHC to 'recommended' version).
|
||||||
It is recommended to always specify a subcommand (ghc/cabal/hls).|]
|
It is recommended to always specify a subcommand (ghc/cabal/hls/stack).|]
|
||||||
|
|
||||||
rmFooter :: String
|
rmFooter :: String
|
||||||
rmFooter = [s|Discussion:
|
rmFooter = [s|Discussion:
|
||||||
Remove the given GHC or cabal version. When no command is given,
|
Remove the given GHC or cabal version. When no command is given,
|
||||||
defaults to removing GHC with the specified version.
|
defaults to removing GHC with the specified version.
|
||||||
It is recommended to always specify a subcommand (ghc/cabal/hls).|]
|
It is recommended to always specify a subcommand (ghc/cabal/hls/stack).|]
|
||||||
|
|
||||||
changeLogFooter :: String
|
changeLogFooter :: String
|
||||||
changeLogFooter = [s|Discussion:
|
changeLogFooter = [s|Discussion:
|
||||||
@@ -540,7 +546,7 @@ installParser =
|
|||||||
( InstallHLS
|
( InstallHLS
|
||||||
<$> info
|
<$> info
|
||||||
(installOpts (Just HLS) <**> helper)
|
(installOpts (Just HLS) <**> helper)
|
||||||
( progDesc "Install haskell-languge-server"
|
( progDesc "Install haskell-language-server"
|
||||||
<> footerDoc (Just $ text installHLSFooter)
|
<> footerDoc (Just $ text installHLSFooter)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -833,7 +839,8 @@ configP = subparser
|
|||||||
|
|
||||||
whereisP :: Parser WhereisCommand
|
whereisP :: Parser WhereisCommand
|
||||||
whereisP = subparser
|
whereisP = subparser
|
||||||
( command
|
(commandGroup "Tools locations:" <>
|
||||||
|
command
|
||||||
"ghc"
|
"ghc"
|
||||||
(WhereisTool GHC <$> info
|
(WhereisTool GHC <$> info
|
||||||
( optional (toolVersionArgument Nothing (Just GHC)) <**> helper )
|
( optional (toolVersionArgument Nothing (Just GHC)) <**> helper )
|
||||||
@@ -868,6 +875,37 @@ whereisP = subparser
|
|||||||
command
|
command
|
||||||
"ghcup"
|
"ghcup"
|
||||||
(WhereisTool GHCup <$> info ( (pure Nothing) <**> helper ) ( progDesc "Get ghcup location" ))
|
(WhereisTool GHCup <$> info ( (pure Nothing) <**> helper ) ( progDesc "Get ghcup location" ))
|
||||||
|
) <|> subparser ( commandGroup "Directory locations:"
|
||||||
|
<>
|
||||||
|
command
|
||||||
|
"basedir"
|
||||||
|
(info (pure WhereisBaseDir <**> helper)
|
||||||
|
( progDesc "Get ghcup base directory location" )
|
||||||
|
)
|
||||||
|
<>
|
||||||
|
command
|
||||||
|
"bindir"
|
||||||
|
(info (pure WhereisBinDir <**> helper)
|
||||||
|
( progDesc "Get ghcup binary directory location" )
|
||||||
|
)
|
||||||
|
<>
|
||||||
|
command
|
||||||
|
"cachedir"
|
||||||
|
(info (pure WhereisCacheDir <**> helper)
|
||||||
|
( progDesc "Get ghcup cache directory location" )
|
||||||
|
)
|
||||||
|
<>
|
||||||
|
command
|
||||||
|
"logsdir"
|
||||||
|
(info (pure WhereisLogsDir <**> helper)
|
||||||
|
( progDesc "Get ghcup logs directory location" )
|
||||||
|
)
|
||||||
|
<>
|
||||||
|
command
|
||||||
|
"confdir"
|
||||||
|
(info (pure WhereisConfDir <**> helper)
|
||||||
|
( progDesc "Get ghcup config directory location" )
|
||||||
|
)
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
whereisGHCFooter = [s|Discussion:
|
whereisGHCFooter = [s|Discussion:
|
||||||
@@ -1008,7 +1046,7 @@ ghcCompileOpts =
|
|||||||
(option
|
(option
|
||||||
str
|
str
|
||||||
(short 'p' <> long "patchdir" <> metavar "PATCH_DIR" <> help
|
(short 'p' <> long "patchdir" <> metavar "PATCH_DIR" <> help
|
||||||
"Absolute path to patch directory (applied in order, uses -p1)"
|
"Absolute path to patch directory (applies all .patch and .diff files in order using -p1)"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
<*> optional
|
<*> optional
|
||||||
@@ -1365,14 +1403,14 @@ describe_result = $( LitE . StringL <$>
|
|||||||
)
|
)
|
||||||
|
|
||||||
plan_json :: String
|
plan_json :: String
|
||||||
plan_json = $( LitE . StringL <$>
|
plan_json = $( do
|
||||||
runIO (handleIO (\_ -> pure "") $ do
|
(fp, c) <- runIO (handleIO (\_ -> pure ("", "")) $ do
|
||||||
fp <- findPlanJson (ProjectRelativeToDir ".")
|
fp <- findPlanJson (ProjectRelativeToDir ".")
|
||||||
c <- B.readFile fp
|
c <- B.readFile fp
|
||||||
(Just res) <- pure $ decodeStrict' @Value c
|
(Just res) <- pure $ decodeStrict' @Value c
|
||||||
pure $ T.unpack $ decUTF8Safe' $ encodePretty res
|
pure (fp, T.unpack $ decUTF8Safe' $ encodePretty res))
|
||||||
)
|
when (not . null $ fp ) $ qAddDependentFile fp
|
||||||
)
|
pure . LitE . StringL $ c)
|
||||||
|
|
||||||
formatConfig :: UserSettings -> String
|
formatConfig :: UserSettings -> String
|
||||||
formatConfig settings
|
formatConfig settings
|
||||||
@@ -2136,6 +2174,26 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
runLogger $ logError $ T.pack $ prettyShow e
|
runLogger $ logError $ T.pack $ prettyShow e
|
||||||
pure $ ExitFailure 30
|
pure $ ExitFailure 30
|
||||||
|
|
||||||
|
Whereis _ WhereisBaseDir -> do
|
||||||
|
putStr baseDir
|
||||||
|
pure ExitSuccess
|
||||||
|
|
||||||
|
Whereis _ WhereisBinDir -> do
|
||||||
|
putStr binDir
|
||||||
|
pure ExitSuccess
|
||||||
|
|
||||||
|
Whereis _ WhereisCacheDir -> do
|
||||||
|
putStr cacheDir
|
||||||
|
pure ExitSuccess
|
||||||
|
|
||||||
|
Whereis _ WhereisLogsDir -> do
|
||||||
|
putStr logsDir
|
||||||
|
pure ExitSuccess
|
||||||
|
|
||||||
|
Whereis _ WhereisConfDir -> do
|
||||||
|
putStr confDir
|
||||||
|
pure ExitSuccess
|
||||||
|
|
||||||
Upgrade uOpts force' -> do
|
Upgrade uOpts force' -> do
|
||||||
target <- case uOpts of
|
target <- case uOpts of
|
||||||
UpgradeInplace -> Just <$> liftIO getExecutablePath
|
UpgradeInplace -> Just <$> liftIO getExecutablePath
|
||||||
|
|||||||
9
data/build_mk/cross
Normal file
9
data/build_mk/cross
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
V=0
|
||||||
|
BUILD_MAN = NO
|
||||||
|
BUILD_SPHINX_HTML = NO
|
||||||
|
BUILD_SPHINX_PDF = NO
|
||||||
|
HADDOCK_DOCS = NO
|
||||||
|
ifneq "$(BuildFlavour)" ""
|
||||||
|
include mk/flavours/$(BuildFlavour).mk
|
||||||
|
endif
|
||||||
|
Stage1Only = YES
|
||||||
8
data/build_mk/default
Normal file
8
data/build_mk/default
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
V=0
|
||||||
|
BUILD_MAN = NO
|
||||||
|
BUILD_SPHINX_HTML = NO
|
||||||
|
BUILD_SPHINX_PDF = NO
|
||||||
|
HADDOCK_DOCS = YES
|
||||||
|
ifneq "$(BuildFlavour)" ""
|
||||||
|
include mk/flavours/$(BuildFlavour).mk
|
||||||
|
endif
|
||||||
21
docs/RELEASING.md
Normal file
21
docs/RELEASING.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# RELEASING
|
||||||
|
|
||||||
|
1. Update version in `ghcup.cabal` and `boostrap-haskell` (`ghver` variable at the top of the script)
|
||||||
|
|
||||||
|
2. Update `GHCup.Version` module. `ghcupURL` must only be updated if we change the `GHCupInfo` type or the YAML representation of it. The version of the YAML represents the change increments. `ghcUpVer` is the current application version, read from `ghcup.cabal`.
|
||||||
|
|
||||||
|
3. Add ChangeLog entry
|
||||||
|
|
||||||
|
4. Add/fix downloads in `ghcup-<ver>.yaml` (under `data/metadata`), then verify with `ghcup-gen check -f ghcup-<ver>.yaml` and possibly (example only) `ghcup-gen check-tarballs -f ghcup-<ver>.yaml -u 'ghc-8.10.7'`. Generally, new GHC/cabal/stack/hls versions are only added to the latest yaml file. New GHCup versions are added to all (great care must be taken here to not break the parser... e.g. ARM platforms don't parse in all older formats).
|
||||||
|
|
||||||
|
5. Commit and git push with tag. Wait for tests to succeed and release artifacts to build.
|
||||||
|
|
||||||
|
6. Download release artifacts and upload them `downloads.haskell.org/ghcup` along with checksum files (`sha256sum --tag * > SHA256SUMS && gpg --detach-sign -u <your-email> SHA256SUMS`)
|
||||||
|
|
||||||
|
7. Add ghcup release artifacts to ALL yaml files (see point 4.)
|
||||||
|
|
||||||
|
8. Upload the final `ghcup-<ver>.yaml` to `webhost.haskell.org/ghcup/data/`.
|
||||||
|
|
||||||
|
9. Update `bootstrap-haskell` and `bootstrap-haskell.ps1` to `webhost.haskell.org/ghcup/sh/`
|
||||||
|
|
||||||
|
10. Update the ghcup symlinks at `downloads.haskell.org/ghcup`
|
||||||
20
ghcup.cabal
20
ghcup.cabal
@@ -16,15 +16,19 @@ description:
|
|||||||
category: System
|
category: System
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
extra-doc-files:
|
extra-doc-files:
|
||||||
CHANGELOG.md
|
|
||||||
config.yaml
|
|
||||||
ghcup-0.0.4.yaml
|
|
||||||
ghcup-0.0.5.yaml
|
|
||||||
ghcup-0.0.6.yaml
|
|
||||||
ghcup-0.0.7.yaml
|
|
||||||
HACKING.md
|
|
||||||
README.md
|
README.md
|
||||||
RELEASING.md
|
docs/CHANGELOG.md
|
||||||
|
docs/HACKING.md
|
||||||
|
docs/RELEASING.md
|
||||||
|
data/config.yaml
|
||||||
|
data/metadata/ghcup-0.0.4.yaml
|
||||||
|
data/metadata/ghcup-0.0.5.yaml
|
||||||
|
data/metadata/ghcup-0.0.6.yaml
|
||||||
|
data/metadata/ghcup-0.0.7.yaml
|
||||||
|
|
||||||
|
extra-source-files:
|
||||||
|
data/build_mk/default
|
||||||
|
data/build_mk/cross
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
|
|||||||
29
lib/GHCup.hs
29
lib/GHCup.hs
@@ -65,9 +65,10 @@ import Data.Time.Format.ISO8601
|
|||||||
import Data.Versions
|
import Data.Versions
|
||||||
import GHC.IO.Exception
|
import GHC.IO.Exception
|
||||||
import Haskus.Utils.Variant.Excepts
|
import Haskus.Utils.Variant.Excepts
|
||||||
|
import Language.Haskell.TH
|
||||||
|
import Language.Haskell.TH.Syntax ( Quasi(qAddDependentFile) )
|
||||||
import Optics
|
import Optics
|
||||||
import Prelude hiding ( abs
|
import Prelude hiding ( abs
|
||||||
, readFile
|
|
||||||
, writeFile
|
, writeFile
|
||||||
)
|
)
|
||||||
import Safe hiding ( at )
|
import Safe hiding ( at )
|
||||||
@@ -1922,26 +1923,12 @@ compileGHC targetGhc ov bstrap jobs mbuildConfig patchdir aargs buildFlavour had
|
|||||||
pure tver
|
pure tver
|
||||||
|
|
||||||
where
|
where
|
||||||
defaultConf = case targetGhc of
|
defaultConf =
|
||||||
Left (GHCTargetVersion (Just _) _) -> [s|
|
let cross_mk = $(LitE . StringL <$> (qAddDependentFile "data/build_mk/cross" >> runIO (readFile "data/build_mk/cross")))
|
||||||
V=0
|
default_mk = $(LitE . StringL <$> (qAddDependentFile "data/build_mk/default" >> runIO (readFile "data/build_mk/default")))
|
||||||
BUILD_MAN = NO
|
in case targetGhc of
|
||||||
BUILD_SPHINX_HTML = NO
|
Left (GHCTargetVersion (Just _) _) -> cross_mk
|
||||||
BUILD_SPHINX_PDF = NO
|
_ -> default_mk
|
||||||
HADDOCK_DOCS = NO
|
|
||||||
ifneq "$(BuildFlavour)" ""
|
|
||||||
include mk/flavours/$(BuildFlavour).mk
|
|
||||||
endif
|
|
||||||
Stage1Only = YES|]
|
|
||||||
_ -> [s|
|
|
||||||
V=0
|
|
||||||
BUILD_MAN = NO
|
|
||||||
BUILD_SPHINX_HTML = NO
|
|
||||||
BUILD_SPHINX_PDF = NO
|
|
||||||
HADDOCK_DOCS = YES
|
|
||||||
ifneq "$(BuildFlavour)" ""
|
|
||||||
include mk/flavours/$(BuildFlavour).mk
|
|
||||||
endif|]
|
|
||||||
|
|
||||||
compileHadrianBindist :: ( MonadReader env m
|
compileHadrianBindist :: ( MonadReader env m
|
||||||
, HasDirs env
|
, HasDirs env
|
||||||
|
|||||||
@@ -165,17 +165,17 @@ getBase :: ( MonadReader env m
|
|||||||
, MonadMask m
|
, MonadMask m
|
||||||
)
|
)
|
||||||
=> URI
|
=> URI
|
||||||
-> Excepts '[JSONError] m GHCupInfo
|
-> Excepts '[JSONError, FileDoesNotExistError] m GHCupInfo
|
||||||
getBase uri = do
|
getBase uri = do
|
||||||
Settings { noNetwork } <- lift getSettings
|
Settings { noNetwork, downloader } <- lift getSettings
|
||||||
|
|
||||||
-- try to download yaml... usually this writes it into cache dir,
|
-- try to download yaml... usually this writes it into cache dir,
|
||||||
-- but in some cases not (e.g. when using file://), so we honour
|
-- but in some cases not (e.g. when using file://), so we honour
|
||||||
-- the return filepath, if any
|
-- the return filepath, if any
|
||||||
mYaml <- if noNetwork && view (uriSchemeL' % schemeBSL') uri /= "file" -- for file://, let it fall through
|
mYaml <- if noNetwork && view (uriSchemeL' % schemeBSL') uri /= "file" -- for file://, let it fall through
|
||||||
then pure Nothing
|
then pure Nothing
|
||||||
else handleIO (\e -> warnCache (displayException e) >> pure Nothing)
|
else handleIO (\e -> lift (warnCache (displayException e) downloader) >> pure Nothing)
|
||||||
. catchE @_ @_ @'[] (\e@(DownloadFailed _) -> warnCache (prettyShow e) >> pure Nothing)
|
. catchE @_ @_ @'[] (\e@(DownloadFailed _) -> lift (warnCache (prettyShow e) downloader) >> pure Nothing)
|
||||||
. reThrowAll @_ @_ @'[DownloadFailed] DownloadFailed
|
. reThrowAll @_ @_ @'[DownloadFailed] DownloadFailed
|
||||||
. fmap Just
|
. fmap Just
|
||||||
. smartDl
|
. smartDl
|
||||||
@@ -183,7 +183,7 @@ getBase uri = do
|
|||||||
|
|
||||||
-- if we didn't get a filepath from the download, use the cached yaml
|
-- if we didn't get a filepath from the download, use the cached yaml
|
||||||
actualYaml <- maybe (lift $ yamlFromCache uri) pure mYaml
|
actualYaml <- maybe (lift $ yamlFromCache uri) pure mYaml
|
||||||
yamlContents <- liftIO $ L.readFile actualYaml
|
yamlContents <- liftIOException doesNotExistErrorType (FileDoesNotExistError actualYaml) $ liftIO $ L.readFile actualYaml
|
||||||
lift $ logDebug $ "Decoding yaml at: " <> T.pack actualYaml
|
lift $ logDebug $ "Decoding yaml at: " <> T.pack actualYaml
|
||||||
|
|
||||||
liftE
|
liftE
|
||||||
@@ -201,9 +201,19 @@ getBase uri = do
|
|||||||
handleIO (\e -> logWarn $ "Couldn't remove file " <> T.pack efp <> ", error was: " <> T.pack (displayException e))
|
handleIO (\e -> logWarn $ "Couldn't remove file " <> T.pack efp <> ", error was: " <> T.pack (displayException e))
|
||||||
(hideError doesNotExistErrorType $ rmFile efp)
|
(hideError doesNotExistErrorType $ rmFile efp)
|
||||||
liftIO $ hideError doesNotExistErrorType $ setAccessTime fp (posixSecondsToUTCTime (fromIntegral @Int 0))
|
liftIO $ hideError doesNotExistErrorType $ setAccessTime fp (posixSecondsToUTCTime (fromIntegral @Int 0))
|
||||||
warnCache s = do
|
|
||||||
lift $ logWarn "Could not get download info, trying cached version (this may not be recent!)"
|
warnCache :: (MonadReader env m, HasLog env, MonadMask m, MonadCatch m, MonadIO m) => FilePath -> Downloader -> m ()
|
||||||
lift $ logDebug $ "Error was: " <> T.pack s
|
warnCache s downloader' = do
|
||||||
|
let tryDownloder = case downloader' of
|
||||||
|
Curl -> "Wget"
|
||||||
|
Wget -> "Curl"
|
||||||
|
#if defined(INTERNAL_DOWNLOADER)
|
||||||
|
Internal -> "Curl"
|
||||||
|
#endif
|
||||||
|
logWarn $ "Could not get download info, trying cached version (this may not be recent!)" <> "\n" <>
|
||||||
|
"If this problem persists, consider switching downloader via: " <> "\n " <>
|
||||||
|
"ghcup config set downloader " <> tryDownloder
|
||||||
|
logDebug $ "Error was: " <> T.pack s
|
||||||
|
|
||||||
-- First check if the json file is in the ~/.ghcup/cache dir
|
-- First check if the json file is in the ~/.ghcup/cache dir
|
||||||
-- and check it's access time. If it has been accessed within the
|
-- and check it's access time. If it has been accessed within the
|
||||||
|
|||||||
@@ -285,31 +285,37 @@ instance Pretty HadrianNotFound where
|
|||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
-- | A download failed. The underlying error is encapsulated.
|
-- | A download failed. The underlying error is encapsulated.
|
||||||
data DownloadFailed = forall x xs . (Show x, Show (V xs), Pretty x, Pretty (V xs)) => DownloadFailed (V (x ': xs))
|
data DownloadFailed = forall xs . (ToVariantMaybe DownloadFailed xs, PopVariant DownloadFailed xs, Show (V xs), Pretty (V xs)) => DownloadFailed (V xs)
|
||||||
|
|
||||||
instance Pretty DownloadFailed where
|
instance Pretty DownloadFailed where
|
||||||
pPrint (DownloadFailed reason) =
|
pPrint (DownloadFailed reason) =
|
||||||
text "Download failed:" <+> pPrint reason
|
case reason of
|
||||||
|
VMaybe (_ :: DownloadFailed) -> pPrint reason
|
||||||
|
_ -> text "Download failed:" <+> pPrint reason
|
||||||
|
|
||||||
deriving instance Show DownloadFailed
|
deriving instance Show DownloadFailed
|
||||||
|
|
||||||
|
|
||||||
-- | A build failed.
|
-- | A build failed.
|
||||||
data BuildFailed = forall 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)
|
||||||
|
|
||||||
instance Pretty BuildFailed where
|
instance Pretty BuildFailed where
|
||||||
pPrint (BuildFailed path reason) =
|
pPrint (BuildFailed path reason) =
|
||||||
text "BuildFailed failed in dir" <+> text (path <> ":") <+> pPrint reason
|
case reason of
|
||||||
|
VMaybe (_ :: BuildFailed) -> pPrint reason
|
||||||
|
_ -> text "BuildFailed failed in dir" <+> text (path <> ":") <+> pPrint reason
|
||||||
|
|
||||||
deriving instance Show BuildFailed
|
deriving instance Show BuildFailed
|
||||||
|
|
||||||
|
|
||||||
-- | Setting the current GHC version failed.
|
-- | Setting the current GHC version failed.
|
||||||
data GHCupSetError = forall es . (Show (V es), Pretty (V es)) => GHCupSetError (V es)
|
data GHCupSetError = forall es . (ToVariantMaybe GHCupSetError es, PopVariant GHCupSetError es, Show (V es), Pretty (V es)) => GHCupSetError (V es)
|
||||||
|
|
||||||
instance Pretty GHCupSetError where
|
instance Pretty GHCupSetError where
|
||||||
pPrint (GHCupSetError reason) =
|
pPrint (GHCupSetError reason) =
|
||||||
text "Setting the current GHC version failed:" <+> pPrint reason
|
case reason of
|
||||||
|
VMaybe (_ :: GHCupSetError) -> pPrint reason
|
||||||
|
_ -> text "Setting the current GHC version failed:" <+> pPrint reason
|
||||||
|
|
||||||
deriving instance Show GHCupSetError
|
deriving instance Show GHCupSetError
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ rmMajorSymlinks tv@GHCTargetVersion{..} = do
|
|||||||
forM_ files $ \f -> do
|
forM_ files $ \f -> do
|
||||||
let f_xy = f <> "-" <> T.unpack v' <> exeExt
|
let f_xy = f <> "-" <> T.unpack v' <> exeExt
|
||||||
let fullF = binDir </> f_xy
|
let fullF = binDir </> f_xy
|
||||||
lift $ logDebug "rm -f #{fullF}"
|
lift $ logDebug ("rm -f " <> T.pack fullF)
|
||||||
lift $ hideError doesNotExistErrorType $ rmLink fullF
|
lift $ hideError doesNotExistErrorType $ rmLink fullF
|
||||||
|
|
||||||
|
|
||||||
@@ -791,7 +791,12 @@ applyPatches :: (MonadReader env m, HasDirs env, HasLog env, MonadIO m)
|
|||||||
-> FilePath -- ^ dir to apply patches in
|
-> FilePath -- ^ dir to apply patches in
|
||||||
-> Excepts '[PatchFailed] m ()
|
-> Excepts '[PatchFailed] m ()
|
||||||
applyPatches pdir ddir = do
|
applyPatches pdir ddir = do
|
||||||
patches <- (fmap . fmap) (pdir </>) $ liftIO $ listDirectory pdir
|
patches <- (fmap . fmap) (pdir </>) $ liftIO $ findFiles
|
||||||
|
pdir
|
||||||
|
(makeRegexOpts compExtended
|
||||||
|
execBlank
|
||||||
|
([s|.+\.(patch|diff)$|] :: ByteString)
|
||||||
|
)
|
||||||
forM_ (sort patches) $ \patch' -> do
|
forM_ (sort patches) $ \patch' -> do
|
||||||
lift $ logInfo $ "Applying patch " <> T.pack patch'
|
lift $ logInfo $ "Applying patch " <> T.pack patch'
|
||||||
fmap (either (const Nothing) Just)
|
fmap (either (const Nothing) Just)
|
||||||
@@ -829,6 +834,8 @@ getChangeLog dls tool (Right tag) =
|
|||||||
-- 2. the install destination, depending on whether the build failed
|
-- 2. the install destination, depending on whether the build failed
|
||||||
runBuildAction :: ( Pretty (V e)
|
runBuildAction :: ( Pretty (V e)
|
||||||
, Show (V e)
|
, Show (V e)
|
||||||
|
, PopVariant BuildFailed e
|
||||||
|
, ToVariantMaybe BuildFailed e
|
||||||
, MonadReader env m
|
, MonadReader env m
|
||||||
, HasDirs env
|
, HasDirs env
|
||||||
, HasSettings env
|
, HasSettings env
|
||||||
@@ -1035,7 +1042,7 @@ ensureGlobalTools = do
|
|||||||
let dl = downloadCached' shimDownload (Just "gs.exe") Nothing
|
let dl = downloadCached' shimDownload (Just "gs.exe") Nothing
|
||||||
void $ (\(DigestError _ _) -> do
|
void $ (\(DigestError _ _) -> do
|
||||||
lift $ logWarn "Digest doesn't match, redownloading gs.exe..."
|
lift $ logWarn "Digest doesn't match, redownloading gs.exe..."
|
||||||
lift $ logDebug "rm -f #{shimDownload}"
|
lift $ logDebug ("rm -f " <> T.pack (cacheDir dirs </> "gs.exe"))
|
||||||
lift $ hideError doesNotExistErrorType $ recycleFile (cacheDir dirs </> "gs.exe")
|
lift $ hideError doesNotExistErrorType $ recycleFile (cacheDir dirs </> "gs.exe")
|
||||||
liftE @'[DigestError , DownloadFailed] $ dl
|
liftE @'[DigestError , DownloadFailed] $ dl
|
||||||
) `catchE` (liftE @'[DigestError , DownloadFailed] dl)
|
) `catchE` (liftE @'[DigestError , DownloadFailed] dl)
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ data ProcessError = NonZeroExit Int FilePath [String]
|
|||||||
|
|
||||||
instance Pretty ProcessError where
|
instance Pretty ProcessError where
|
||||||
pPrint (NonZeroExit e exe args) =
|
pPrint (NonZeroExit e exe args) =
|
||||||
text "Process " <+> pPrint exe <+> text " with arguments " <+> text (show args) <+> text " failed with exit code " <+> text (show e) <+> "."
|
text "Process" <+> pPrint exe <+> text "with arguments" <+> pPrint args <+> text "failed with exit code" <+> text (show e <> ".")
|
||||||
pPrint (PTerminated exe args) =
|
pPrint (PTerminated exe args) =
|
||||||
text "Process " <+> pPrint exe <+> text " with arguments " <+> text (show args) <+> text " terminated."
|
text "Process" <+> pPrint exe <+> text "with arguments" <+> pPrint args <+> text "terminated."
|
||||||
pPrint (PStopped exe args) =
|
pPrint (PStopped exe args) =
|
||||||
text "Process " <+> pPrint exe <+> text " with arguments " <+> text (show args) <+> text " stopped."
|
text "Process" <+> pPrint exe <+> text "with arguments" <+> pPrint args <+> text "stopped."
|
||||||
pPrint (NoSuchPid exe args) =
|
pPrint (NoSuchPid exe args) =
|
||||||
text "Could not find PID for process running " <+> pPrint exe <+> text " with arguments " <+> text (show args) <+> text "."
|
text "Could not find PID for process running " <+> pPrint exe <+> text " with arguments " <+> text (show args) <+> text "."
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ import qualified Data.List.NonEmpty as NE
|
|||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
|
|
||||||
-- | This reflects the API version of the YAML.
|
-- | This reflects the API version of the YAML.
|
||||||
|
--
|
||||||
|
-- Note that when updating this, CI requires that the file exsists AND the same file exists at
|
||||||
|
-- 'https://www.haskell.org/ghcup/exp/ghcup-<ver>.yaml' with some newlines added.
|
||||||
ghcupURL :: URI
|
ghcupURL :: URI
|
||||||
ghcupURL = [uri|https://www.haskell.org/ghcup/data/ghcup-0.0.7.yaml|]
|
ghcupURL = [uri|https://www.haskell.org/ghcup/data/ghcup-0.0.7.yaml|]
|
||||||
|
|
||||||
|
|||||||
@@ -293,16 +293,7 @@ ask_bashrc() {
|
|||||||
|
|
||||||
read -r bashrc_answer </dev/tty
|
read -r bashrc_answer </dev/tty
|
||||||
else
|
else
|
||||||
# On windows .bashrc isn't an important user config, so we adjust it
|
return 0
|
||||||
# always. On other platforms, let's be a bit more conservative.
|
|
||||||
case "${plat}" in
|
|
||||||
MSYS*|MINGW*)
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
case $bashrc_answer in
|
case $bashrc_answer in
|
||||||
[Pp]* | "")
|
[Pp]* | "")
|
||||||
16
stack.yaml
16
stack.yaml
@@ -10,18 +10,18 @@ extra-deps:
|
|||||||
- git: https://github.com/hasufell/libarchive
|
- git: https://github.com/hasufell/libarchive
|
||||||
commit: 8587aab78dd515928024ecd82c8f215e06db85cd
|
commit: 8587aab78dd515928024ecd82c8f215e06db85cd
|
||||||
|
|
||||||
- brick-0.64@sha256:f03fa14607c22cf48af99e24c44f79a0fb073f7ec229f15e969fed9ff73c93f6,16530
|
|
||||||
- IfElse-0.85@sha256:6939b94acc6a55f545f63a168a349dd2fbe4b9a7cca73bf60282db5cc6aa47d2,445
|
- IfElse-0.85@sha256:6939b94acc6a55f545f63a168a349dd2fbe4b9a7cca73bf60282db5cc6aa47d2,445
|
||||||
- ascii-string-1.0.1.4@sha256:fa34f1d9ba57e8e89c0d4c9cef5e01ba32cb2d4373d13f92dcc0b531a6c6749b,2582
|
- ascii-string-1.0.1.4@sha256:fa34f1d9ba57e8e89c0d4c9cef5e01ba32cb2d4373d13f92dcc0b531a6c6749b,2582
|
||||||
- base16-bytestring-0.1.1.7@sha256:0021256a9628971c08da95cb8f4d0d72192f3bb8a7b30b55c080562d17c43dd3,2231
|
- base16-bytestring-0.1.1.7@sha256:0021256a9628971c08da95cb8f4d0d72192f3bb8a7b30b55c080562d17c43dd3,2231
|
||||||
|
- brick-0.64@sha256:f03fa14607c22cf48af99e24c44f79a0fb073f7ec229f15e969fed9ff73c93f6,16530
|
||||||
- brotli-0.0.0.0@sha256:2bf383a4cd308745740986be0b18381c5a0784393fe69b91456aacb2d603de46,2964
|
- brotli-0.0.0.0@sha256:2bf383a4cd308745740986be0b18381c5a0784393fe69b91456aacb2d603de46,2964
|
||||||
- brotli-streams-0.0.0.0@sha256:1af1e22f67b8bfd6ad0d05e61825e7a178d738f689ebbb21c1aab5f1bbcae176,2331
|
- brotli-streams-0.0.0.0@sha256:1af1e22f67b8bfd6ad0d05e61825e7a178d738f689ebbb21c1aab5f1bbcae176,2331
|
||||||
- chs-cabal-0.1.1.0@sha256:20ec6a9fb5ab6991f1a4adf157c537bd5d3b98d08d3c09c387c954c7c50bd011,1153
|
- chs-cabal-0.1.1.0@sha256:20ec6a9fb5ab6991f1a4adf157c537bd5d3b98d08d3c09c387c954c7c50bd011,1153
|
||||||
- chs-deps-0.1.0.0@sha256:0cdada6d2c682c41b20331b8c63c2ecfc7e806928585195fd544c9d41f3074fd,2496
|
- chs-deps-0.1.0.0@sha256:0cdada6d2c682c41b20331b8c63c2ecfc7e806928585195fd544c9d41f3074fd,2496
|
||||||
- composition-prelude-3.0.0.2@sha256:1ffed216bd28d810fce0b5be83a661e2a892696d73b3f8de5c0f5edb9b5f0090,1216
|
- composition-prelude-3.0.0.2@sha256:1ffed216bd28d810fce0b5be83a661e2a892696d73b3f8de5c0f5edb9b5f0090,1216
|
||||||
- haskus-utils-data-1.3@sha256:f62c4e49021b463185d043f7b69c727b63af641a71d7edd582d9f4f98e80e500,1466
|
- haskus-utils-data-1.4@sha256:bfa94363b94b14779edd6834fbd59dbb847c3d7b8f48e3844f456ffdc077da4a,1466
|
||||||
- haskus-utils-types-1.5.1@sha256:991c472f4e751e2f0d7aab6ad4220ef151d6160876dcf0511bbf876bbd432020,1298
|
- haskus-utils-types-1.5.1@sha256:991c472f4e751e2f0d7aab6ad4220ef151d6160876dcf0511bbf876bbd432020,1298
|
||||||
- haskus-utils-variant-3.0@sha256:8d51e45d3b664e61ccc25a58b37c0ccc4ee7537138b9fee21cd15c356906dd34,2159
|
- haskus-utils-variant-3.1@sha256:e602dd23e068c98d03c1027af20503addef8df6368577622453f44ccabea2a5b,2159
|
||||||
- hpath-filepath-0.10.4@sha256:e9e44fb5fdbade7f30b5b5451257dbee15b6ef1aae4060034d73008bb3b5d878,1269
|
- hpath-filepath-0.10.4@sha256:e9e44fb5fdbade7f30b5b5451257dbee15b6ef1aae4060034d73008bb3b5d878,1269
|
||||||
- hpath-posix-0.13.3@sha256:abe472cf16bccd3a8b8814865ed3551a728fde0f3a2baea2acc03023bec6c565,1615
|
- hpath-posix-0.13.3@sha256:abe472cf16bccd3a8b8814865ed3551a728fde0f3a2baea2acc03023bec6c565,1615
|
||||||
- hspec-2.7.10@sha256:c9e82c90086acebac576552a06f3cabd249bba048edd1667c7fae0b1313d5bce,1712
|
- hspec-2.7.10@sha256:c9e82c90086acebac576552a06f3cabd249bba048edd1667c7fae0b1313d5bce,1712
|
||||||
@@ -30,11 +30,11 @@ extra-deps:
|
|||||||
- hspec-golden-aeson-0.9.0.0@sha256:aa17274114026661ba4dfc9c60c230673c8f408bd86482fd611d2d5cb6aff996,2179
|
- hspec-golden-aeson-0.9.0.0@sha256:aa17274114026661ba4dfc9c60c230673c8f408bd86482fd611d2d5cb6aff996,2179
|
||||||
- http-io-streams-0.1.6.0@sha256:53f5bab177efb52cd65ec396fd04ed59b93e5f919fb3700cd7dacd6cfce6f06d,3582
|
- http-io-streams-0.1.6.0@sha256:53f5bab177efb52cd65ec396fd04ed59b93e5f919fb3700cd7dacd6cfce6f06d,3582
|
||||||
- lzma-static-5.2.5.3@sha256:2758ee58c35992fcf7db78e98684c357a16a82fa2a4e7c352a6c210c08c555d8,7308
|
- lzma-static-5.2.5.3@sha256:2758ee58c35992fcf7db78e98684c357a16a82fa2a4e7c352a6c210c08c555d8,7308
|
||||||
- os-release-1.0.1@sha256:1281c62081f438fc3f0874d3bae6a4887d5964ac25261ba06e29d368ab173467,2716
|
|
||||||
- optics-0.4@sha256:9fb69bf0195b8d8f1f8cd0098000946868b8a3c3ffb51e5b64f79fc600c3eb4c,6568
|
- optics-0.4@sha256:9fb69bf0195b8d8f1f8cd0098000946868b8a3c3ffb51e5b64f79fc600c3eb4c,6568
|
||||||
- optics-core-0.4@sha256:59e04aebca536bd011ae50c781937f45af4c1456af1eb9fb578f9a69eee293cd,4995
|
- optics-core-0.4@sha256:59e04aebca536bd011ae50c781937f45af4c1456af1eb9fb578f9a69eee293cd,4995
|
||||||
- optics-extra-0.4@sha256:b9914f38aa7d5c92f231060d9168447f9f5a367c07df9bf47a003e3e786d5e05,3432
|
- optics-extra-0.4@sha256:b9914f38aa7d5c92f231060d9168447f9f5a367c07df9bf47a003e3e786d5e05,3432
|
||||||
- optics-th-0.4@sha256:7c838b5b1d6998133bf8f0641c36197ed6cb468dc69515e1952f33f0bbe8e11d,2009
|
- optics-th-0.4@sha256:7c838b5b1d6998133bf8f0641c36197ed6cb468dc69515e1952f33f0bbe8e11d,2009
|
||||||
|
- os-release-1.0.1@sha256:1281c62081f438fc3f0874d3bae6a4887d5964ac25261ba06e29d368ab173467,2716
|
||||||
- primitive-0.7.1.0@sha256:29de6bfd0cf8ba023ceb806203dfbec0e51e3524e75ffe41056f70b4229c6f0f,2728
|
- primitive-0.7.1.0@sha256:29de6bfd0cf8ba023ceb806203dfbec0e51e3524e75ffe41056f70b4229c6f0f,2728
|
||||||
- regex-posix-clib-2.7
|
- regex-posix-clib-2.7
|
||||||
- streamly-0.7.3@sha256:ad2a488fe802692ed47cab9fd0416c2904aac9e51cf2d8aafd1c3a40064c42f5,27421
|
- streamly-0.7.3@sha256:ad2a488fe802692ed47cab9fd0416c2904aac9e51cf2d8aafd1c3a40064c42f5,27421
|
||||||
@@ -63,3 +63,11 @@ ghc-options:
|
|||||||
"$locals": -O2
|
"$locals": -O2
|
||||||
streamly: -O2 -fspec-constr-recursive=16 -fmax-worker-args=16
|
streamly: -O2 -fspec-constr-recursive=16 -fmax-worker-args=16
|
||||||
ghcup: -O2 -fspec-constr-recursive=16 -fmax-worker-args=16
|
ghcup: -O2 -fspec-constr-recursive=16 -fmax-worker-args=16
|
||||||
|
|
||||||
|
build:
|
||||||
|
test: true
|
||||||
|
test-arguments:
|
||||||
|
no-run-tests: true
|
||||||
|
bench: true
|
||||||
|
benchmark-opts:
|
||||||
|
no-run-benchmarks: true
|
||||||
|
|||||||
@@ -13,4 +13,5 @@ import Test.Hspec
|
|||||||
|
|
||||||
spec :: Spec
|
spec :: Spec
|
||||||
spec = do
|
spec = do
|
||||||
roundtripAndGoldenSpecs (Proxy @GHCupInfo)
|
roundtripAndGoldenSpecsWithSettings (defaultSettings { goldenDirectoryOption = CustomDirectoryName "test/golden" }) (Proxy @GHCupInfo)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user