Compare commits
122 Commits
update
...
issue-160-
| Author | SHA1 | Date | |
|---|---|---|---|
|
24880616a0
|
|||
|
b862ca52a9
|
|||
|
59e1eee8ce
|
|||
|
57c8ffda35
|
|||
|
171ebd213d
|
|||
|
2a240cbd09
|
|||
|
068fa3454c
|
|||
|
6b2bcbf2ce
|
|||
|
19e46dac18
|
|||
|
e96c863120
|
|||
|
a30b3c84d7
|
|||
|
0ad5dc4583
|
|||
|
7189998f3b
|
|||
|
b6b24b8e0b
|
|||
|
8e820c6e89
|
|||
|
c74784a37c
|
|||
|
3d940cffcf
|
|||
|
0df044b284
|
|||
|
f576b9fb20
|
|||
|
5e00264119
|
|||
|
|
05eeba32fa | ||
|
|
61019ecd49 | ||
|
|
bed06d1334 | ||
|
|
f09f4bd1b7 | ||
|
|
a3b11f21bb | ||
|
|
69a461d9c3 | ||
|
|
1dfe5cfecf | ||
|
|
8e4550657e | ||
|
|
aee7fa52c3 | ||
|
|
d166cc84a1 | ||
|
|
bb7229d224 | ||
|
|
708cd5ead9 | ||
|
|
f7986cb4da | ||
|
|
395aeb415d | ||
|
|
830fb70492 | ||
|
|
6379a26afb | ||
|
|
2277013c76 | ||
|
|
8934e0e6bd | ||
|
|
59519febbc | ||
|
|
46fcdd356c | ||
|
|
9f343c45e8 | ||
|
|
931904f388 | ||
|
|
a40d0cbb5c | ||
|
|
9f5df9db10 | ||
|
|
d26ddf7015 | ||
|
|
9515065407 | ||
|
|
82a8c61cf6 | ||
|
|
3fae516ce4 | ||
|
|
33eaa765d7 | ||
|
|
3b3dde8413 | ||
|
|
118a2744fe | ||
|
|
2e3dceecf8 | ||
|
|
07fb04bb74 | ||
|
|
8a1dbe9dbb | ||
|
|
4ef3622616 | ||
|
|
82a704ab44 | ||
|
|
0cb22945fe | ||
|
|
d09adf9159 | ||
|
|
0b959c56fb | ||
|
|
ec29332657 | ||
|
|
0f6381e67b | ||
|
|
877b55e21d | ||
|
|
fa11ca665f | ||
|
d9d196439f
|
|||
|
a34fc4ad4f
|
|||
|
b4d52b88c1
|
|||
|
3fc3d27361
|
|||
|
56b86add38
|
|||
|
a608a105e3
|
|||
|
2e3e413f6c
|
|||
|
dfb6c09133
|
|||
|
9636276c17
|
|||
|
41783ff027
|
|||
|
08b0ecd057
|
|||
|
7e31798446
|
|||
|
534afa6e8d
|
|||
|
b56c44a210
|
|||
|
ef0c94fddd
|
|||
|
f14c281841
|
|||
|
b40cefee35
|
|||
|
ff32ccfb50
|
|||
|
581108ab65
|
|||
|
54e8e3efb0
|
|||
|
4dcc63606e
|
|||
|
a396b6044d
|
|||
|
94e5d2e19f
|
|||
|
a0976eee70
|
|||
|
61494d8c4b
|
|||
|
2b34c2dd69
|
|||
|
afc30b87dd
|
|||
|
|
ed0a63eb0c | ||
|
9ba590dd90
|
|||
|
d4bffd2c4a
|
|||
|
650f0a3e4e
|
|||
|
fd6ccf8f0a
|
|||
|
d9fe4b8723
|
|||
|
da2e7e0411
|
|||
|
79d6a50e44
|
|||
|
a13a5e5d20
|
|||
|
82743dda2b
|
|||
|
|
6f80dd1fcc | ||
|
1325dce493
|
|||
|
ac21c19b7e
|
|||
|
2b4088d068
|
|||
|
d86dc9b1d7
|
|||
|
9982311c87
|
|||
|
40c88d0b66
|
|||
|
e0ee1c2f94
|
|||
|
b4fa2780eb
|
|||
|
df86183e97
|
|||
|
f7868dc646
|
|||
|
e742be7693
|
|||
|
924bc8698d
|
|||
|
5214c35b20
|
|||
|
700e04535a
|
|||
|
fedc0bbef6
|
|||
|
468fc5ade9
|
|||
|
2c077db36b
|
|||
|
f80638bba4
|
|||
|
860aa0dafd
|
|||
|
27510b3b51
|
|||
|
96bcbbeeec
|
125
.gitlab-ci.yml
125
.gitlab-ci.yml
@@ -7,7 +7,7 @@ variables:
|
|||||||
GIT_SSL_NO_VERIFY: "1"
|
GIT_SSL_NO_VERIFY: "1"
|
||||||
|
|
||||||
# Commit of ghc/ci-images repository from which to pull Docker images
|
# Commit of ghc/ci-images repository from which to pull Docker images
|
||||||
DOCKER_REV: 1ac7f435c9312f10422a82d304194778378e2a1a
|
DOCKER_REV: 8d0224e6b2a08157649651e69302380b2bd24e11
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# CI Step
|
# CI Step
|
||||||
@@ -41,7 +41,7 @@ variables:
|
|||||||
CABAL_DIR: "$CI_PROJECT_DIR/cabal"
|
CABAL_DIR: "$CI_PROJECT_DIR/cabal"
|
||||||
|
|
||||||
.linux:armv7:
|
.linux:armv7:
|
||||||
image: "arm32v7/fedora"
|
image: "registry.gitlab.haskell.org/ghc/ci-images/armv7-linux-deb10:$DOCKER_REV"
|
||||||
tags:
|
tags:
|
||||||
- armv7-linux
|
- armv7-linux
|
||||||
variables:
|
variables:
|
||||||
@@ -50,7 +50,7 @@ variables:
|
|||||||
CABAL_DIR: "$CI_PROJECT_DIR/cabal"
|
CABAL_DIR: "$CI_PROJECT_DIR/cabal"
|
||||||
|
|
||||||
.linux:aarch64:
|
.linux:aarch64:
|
||||||
image: "arm64v8/fedora"
|
image: "registry.gitlab.haskell.org/ghc/ci-images/aarch64-linux-deb10:$DOCKER_REV"
|
||||||
tags:
|
tags:
|
||||||
- aarch64-linux
|
- aarch64-linux
|
||||||
variables:
|
variables:
|
||||||
@@ -124,14 +124,14 @@ variables:
|
|||||||
- .test_ghcup_version
|
- .test_ghcup_version
|
||||||
- .linux:armv7
|
- .linux:armv7
|
||||||
before_script:
|
before_script:
|
||||||
- ./.gitlab/before_script/linux/install_deps_manual.sh
|
- ./.gitlab/before_script/linux/install_deps.sh
|
||||||
|
|
||||||
.test_ghcup_version:aarch64:
|
.test_ghcup_version:aarch64:
|
||||||
extends:
|
extends:
|
||||||
- .test_ghcup_version
|
- .test_ghcup_version
|
||||||
- .linux:aarch64
|
- .linux:aarch64
|
||||||
before_script:
|
before_script:
|
||||||
- ./.gitlab/before_script/linux/install_deps_manual.sh
|
- ./.gitlab/before_script/linux/install_deps.sh
|
||||||
|
|
||||||
.test_ghcup_version:darwin:
|
.test_ghcup_version:darwin:
|
||||||
extends:
|
extends:
|
||||||
@@ -146,8 +146,26 @@ variables:
|
|||||||
- .test_ghcup_version
|
- .test_ghcup_version
|
||||||
- .darwin:aarch64
|
- .darwin:aarch64
|
||||||
- .root_cleanup
|
- .root_cleanup
|
||||||
before_script:
|
script: |
|
||||||
- ./.gitlab/before_script/darwin/install_deps.sh
|
set -Eeuo pipefail
|
||||||
|
function runInNixShell() {
|
||||||
|
time nix-shell $CI_PROJECT_DIR/.gitlab/shell.nix \
|
||||||
|
-I nixpkgs=https://github.com/angerman/nixpkgs/archive/75f7281738b.tar.gz \
|
||||||
|
--argstr system "aarch64-darwin" \
|
||||||
|
--pure \
|
||||||
|
--keep CI_PROJECT_DIR \
|
||||||
|
--keep MACOSX_DEPLOYMENT_TARGET \
|
||||||
|
--keep JSON_VERSION \
|
||||||
|
--keep ARTIFACT \
|
||||||
|
--keep OS \
|
||||||
|
--keep ARCH \
|
||||||
|
--keep CABAL_DIR \
|
||||||
|
--keep GHC_VERSION \
|
||||||
|
--keep CABAL_VERSION \
|
||||||
|
--run "$1" 2>&1
|
||||||
|
}
|
||||||
|
runInNixShell ./.gitlab/before_script/darwin/install_deps.sh 2>&1
|
||||||
|
runInNixShell ./.gitlab/script/ghcup_version.sh 2>&1
|
||||||
|
|
||||||
.test_ghcup_version:freebsd:
|
.test_ghcup_version:freebsd:
|
||||||
extends:
|
extends:
|
||||||
@@ -199,10 +217,27 @@ test:linux:bootstrap_script:
|
|||||||
script:
|
script:
|
||||||
- ./.gitlab/script/ghcup_bootstrap.sh
|
- ./.gitlab/script/ghcup_bootstrap.sh
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
extends:
|
extends:
|
||||||
- .debian
|
- .debian
|
||||||
|
- .root_cleanup
|
||||||
|
needs: []
|
||||||
|
|
||||||
|
test:windows:bootstrap_powershell_script:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- ./bootstrap-haskell.ps1 -InstallDir $CI_PROJECT_DIR -BootstrapUrl $CI_PROJECT_DIR/bootstrap-haskell -InBash
|
||||||
|
after_script:
|
||||||
|
- "[Environment]::SetEnvironmentVariable('GHCUP_INSTALL_BASE_PREFIX', $null, [System.EnvironmentVariableTarget]::User)"
|
||||||
|
- "[Environment]::SetEnvironmentVariable('GHCUP_MSYS2', $null, [System.EnvironmentVariableTarget]::User)"
|
||||||
|
- "[Environment]::SetEnvironmentVariable('CABAL_DIR', $null, [System.EnvironmentVariableTarget]::User)"
|
||||||
|
- bash ./.gitlab/after_script.sh
|
||||||
|
variables:
|
||||||
|
GHC_VERSION: "8.10.5"
|
||||||
|
CABAL_VERSION: "3.4.0.0"
|
||||||
|
extends:
|
||||||
|
- .windows
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
######## linux test ########
|
######## linux test ########
|
||||||
@@ -211,7 +246,7 @@ test:linux:recommended:
|
|||||||
stage: test
|
stage: test
|
||||||
extends: .test_ghcup_version:linux
|
extends: .test_ghcup_version:linux
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
@@ -219,7 +254,7 @@ test:linux:latest:
|
|||||||
stage: test
|
stage: test
|
||||||
extends: .test_ghcup_version:linux
|
extends: .test_ghcup_version:linux
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "9.0.1"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
@@ -229,7 +264,7 @@ test:linux:recommended:32bit:
|
|||||||
stage: test
|
stage: test
|
||||||
extends: .test_ghcup_version:linux32
|
extends: .test_ghcup_version:linux32
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.2.0.0"
|
CABAL_VERSION: "3.2.0.0"
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
@@ -267,7 +302,7 @@ test:mac:latest:
|
|||||||
stage: test
|
stage: test
|
||||||
extends: .test_ghcup_version:darwin
|
extends: .test_ghcup_version:darwin
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "9.0.1"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
@@ -278,6 +313,7 @@ test:mac:recommended:aarch64:
|
|||||||
GHC_VERSION: "8.10.5"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
needs: []
|
needs: []
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
|
||||||
######## freebsd test ########
|
######## freebsd test ########
|
||||||
@@ -292,23 +328,13 @@ test:freebsd:recommended:
|
|||||||
when: manual
|
when: manual
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
test:freebsd:latest:
|
|
||||||
stage: test
|
|
||||||
extends: .test_ghcup_version:freebsd
|
|
||||||
variables:
|
|
||||||
GHC_VERSION: "8.10.4"
|
|
||||||
CABAL_VERSION: "3.4.0.0"
|
|
||||||
allow_failure: true # freebsd runners are unreliable
|
|
||||||
when: manual
|
|
||||||
needs: []
|
|
||||||
|
|
||||||
######## windows test ########
|
######## windows test ########
|
||||||
|
|
||||||
test:windows:recommended:
|
test:windows:recommended:
|
||||||
stage: test
|
stage: test
|
||||||
extends: .test_ghcup_version:windows
|
extends: .test_ghcup_version:windows
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
needs: []
|
needs: []
|
||||||
|
|
||||||
@@ -324,7 +350,7 @@ release:linux:64bit:
|
|||||||
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
||||||
variables:
|
variables:
|
||||||
ARTIFACT: "x86_64-linux-ghcup"
|
ARTIFACT: "x86_64-linux-ghcup"
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
|
|
||||||
|
|
||||||
@@ -338,7 +364,7 @@ release:linux:32bit:
|
|||||||
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
||||||
variables:
|
variables:
|
||||||
ARTIFACT: "i386-linux-ghcup"
|
ARTIFACT: "i386-linux-ghcup"
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.2.0.0"
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
release:linux:armv7:
|
release:linux:armv7:
|
||||||
@@ -348,7 +374,7 @@ release:linux:armv7:
|
|||||||
- .linux:armv7
|
- .linux:armv7
|
||||||
- .release_ghcup
|
- .release_ghcup
|
||||||
before_script:
|
before_script:
|
||||||
- ./.gitlab/before_script/linux/install_deps_manual.sh
|
- ./.gitlab/before_script/linux/install_deps.sh
|
||||||
variables:
|
variables:
|
||||||
ARTIFACT: "armv7-linux-ghcup"
|
ARTIFACT: "armv7-linux-ghcup"
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.4"
|
||||||
@@ -361,7 +387,7 @@ release:linux:aarch64:
|
|||||||
- .linux:aarch64
|
- .linux:aarch64
|
||||||
- .release_ghcup
|
- .release_ghcup
|
||||||
before_script:
|
before_script:
|
||||||
- ./.gitlab/before_script/linux/install_deps_manual.sh
|
- ./.gitlab/before_script/linux/install_deps.sh
|
||||||
variables:
|
variables:
|
||||||
ARTIFACT: "aarch64-linux-ghcup"
|
ARTIFACT: "aarch64-linux-ghcup"
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.4"
|
||||||
@@ -380,16 +406,50 @@ release:darwin:
|
|||||||
- ./.gitlab/before_script/darwin/install_deps.sh
|
- ./.gitlab/before_script/darwin/install_deps.sh
|
||||||
variables:
|
variables:
|
||||||
ARTIFACT: "x86_64-apple-darwin-ghcup"
|
ARTIFACT: "x86_64-apple-darwin-ghcup"
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
MACOSX_DEPLOYMENT_TARGET: "10.7"
|
MACOSX_DEPLOYMENT_TARGET: "10.7"
|
||||||
|
|
||||||
|
release:darwin:aarch64:
|
||||||
|
stage: release
|
||||||
|
needs: ["test:mac:recommended:aarch64"]
|
||||||
|
extends:
|
||||||
|
- .darwin:aarch64
|
||||||
|
- .release_ghcup
|
||||||
|
- .root_cleanup
|
||||||
|
script: |
|
||||||
|
set -Eeuo pipefail
|
||||||
|
function runInNixShell() {
|
||||||
|
time nix-shell .gitlab/shell.nix \
|
||||||
|
-I nixpkgs=https://github.com/angerman/nixpkgs/archive/75f7281738b.tar.gz \
|
||||||
|
--argstr system "aarch64-darwin" \
|
||||||
|
--pure \
|
||||||
|
--keep CI_PROJECT_DIR \
|
||||||
|
--keep MACOSX_DEPLOYMENT_TARGET \
|
||||||
|
--keep JSON_VERSION \
|
||||||
|
--keep ARTIFACT \
|
||||||
|
--keep OS \
|
||||||
|
--keep ARCH \
|
||||||
|
--keep CABAL_DIR \
|
||||||
|
--keep GHC_VERSION \
|
||||||
|
--keep CABAL_VERSION \
|
||||||
|
--run "$1" 2>&1
|
||||||
|
}
|
||||||
|
runInNixShell ./.gitlab/before_script/darwin/install_deps.sh 2>&1
|
||||||
|
runInNixShell ./.gitlab/script/ghcup_release.sh 2>&1
|
||||||
|
variables:
|
||||||
|
ARTIFACT: "aarch64-apple-darwin-ghcup"
|
||||||
|
GHC_VERSION: "8.10.5"
|
||||||
|
CABAL_VERSION: "3.4.0.0"
|
||||||
|
MACOSX_DEPLOYMENT_TARGET: "10.7"
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
|
||||||
######## freebsd release ########
|
######## freebsd release ########
|
||||||
|
|
||||||
release:freebsd:
|
release:freebsd:
|
||||||
stage: release
|
stage: release
|
||||||
needs: ["test:freebsd:recommended", "test:freebsd:latest"]
|
needs: ["test:freebsd:recommended"]
|
||||||
extends:
|
extends:
|
||||||
- .freebsd
|
- .freebsd
|
||||||
- .release_ghcup
|
- .release_ghcup
|
||||||
@@ -398,8 +458,9 @@ release:freebsd:
|
|||||||
- ./.gitlab/before_script/freebsd/install_deps.sh
|
- ./.gitlab/before_script/freebsd/install_deps.sh
|
||||||
variables:
|
variables:
|
||||||
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
######## windows release ########
|
######## windows release ########
|
||||||
|
|
||||||
@@ -414,7 +475,7 @@ release:windows:
|
|||||||
- bash ./.gitlab/before_script/windows/install_deps.sh
|
- bash ./.gitlab/before_script/windows/install_deps.sh
|
||||||
variables:
|
variables:
|
||||||
ARTIFACT: "x86_64-mingw64-ghcup"
|
ARTIFACT: "x86_64-mingw64-ghcup"
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
|
|
||||||
######## hlint ########
|
######## hlint ########
|
||||||
@@ -428,7 +489,7 @@ hlint:
|
|||||||
script:
|
script:
|
||||||
- ./.gitlab/script/hlint.sh
|
- ./.gitlab/script/hlint.sh
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.10.4"
|
GHC_VERSION: "8.10.5"
|
||||||
CABAL_VERSION: "3.4.0.0"
|
CABAL_VERSION: "3.4.0.0"
|
||||||
JSON_VERSION: "0.0.4"
|
JSON_VERSION: "0.0.4"
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|||||||
@@ -6,12 +6,27 @@ set -eux
|
|||||||
|
|
||||||
mkdir -p "${TMPDIR}"
|
mkdir -p "${TMPDIR}"
|
||||||
|
|
||||||
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ./ghcup-bin
|
if [ $ARCH = 'ARM64' ] ; then
|
||||||
chmod +x ghcup-bin
|
curl -sSfL https://downloads.haskell.org/~ghcup/0.1.15.1/aarch64-apple-darwin-ghcup-0.1.15.1 > ./ghcup-bin
|
||||||
|
chmod +x ghcup-bin
|
||||||
|
else
|
||||||
|
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ./ghcup-bin
|
||||||
|
chmod +x ghcup-bin
|
||||||
|
./ghcup-bin upgrade -i -f
|
||||||
|
fi
|
||||||
|
|
||||||
./ghcup-bin upgrade -i -f
|
|
||||||
./ghcup-bin install ${GHC_VERSION}
|
./ghcup-bin install ${GHC_VERSION}
|
||||||
./ghcup-bin set ${GHC_VERSION}
|
./ghcup-bin set ${GHC_VERSION}
|
||||||
./ghcup-bin install-cabal ${CABAL_VERSION}
|
./ghcup-bin install-cabal ${CABAL_VERSION}
|
||||||
|
|
||||||
|
if [ $ARCH = 'ARM64' ] ; then
|
||||||
|
cabal update
|
||||||
|
mkdir vendored
|
||||||
|
cd vendored
|
||||||
|
cabal unpack network-3.1.2.1
|
||||||
|
cd network*
|
||||||
|
autoreconf -fi
|
||||||
|
cd ../..
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -7,13 +7,60 @@ set -eux
|
|||||||
mkdir -p "${TMPDIR}"
|
mkdir -p "${TMPDIR}"
|
||||||
|
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget
|
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https
|
||||||
|
|
||||||
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ./ghcup-bin
|
case "${ARCH}" in
|
||||||
chmod +x ghcup-bin
|
ARM*)
|
||||||
|
case "${ARCH}" in
|
||||||
|
"ARM")
|
||||||
|
ghc_url=https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-armv7-deb10-linux.tar.xz
|
||||||
|
cabal_url=home.smart-cactus.org/~ben/cabal-install-${CABAL_VERSION}-armv7-linux-bootstrapped.tar.xz
|
||||||
|
;;
|
||||||
|
"ARM64")
|
||||||
|
ghc_url=https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-aarch64-deb10-linux.tar.xz
|
||||||
|
cabal_url=https://downloads.haskell.org/~cabal/cabal-install-${CABAL_VERSION}/cabal-install-${CABAL_VERSION}-aarch64-ubuntu-18.04.tar.xz
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
exit 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
./ghcup-bin upgrade -i -f
|
mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin
|
||||||
./ghcup-bin install ${GHC_VERSION}
|
|
||||||
./ghcup-bin set ${GHC_VERSION}
|
curl -O "${ghc_url}"
|
||||||
./ghcup-bin install-cabal ${CABAL_VERSION}
|
tar -xf ghc-*.tar.*
|
||||||
|
cd ghc-${GHC_VERSION}
|
||||||
|
./configure --prefix="${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/ghc/${GHC_VERSION}
|
||||||
|
make install
|
||||||
|
for i in "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/ghc/${GHC_VERSION}/bin/*-${GHC_VERSION} ; do
|
||||||
|
ln -s "${i}" "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/${i##*/}
|
||||||
|
done
|
||||||
|
for x in "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/*-${GHC_VERSION} ; do
|
||||||
|
ln -s ${x##*/} ${x%-${GHC_VERSION}}
|
||||||
|
done
|
||||||
|
cd ..
|
||||||
|
rm -rf ghc-${GHC_VERSION} ghc-*.tar.*
|
||||||
|
unset x i
|
||||||
|
|
||||||
|
mkdir cabal-install
|
||||||
|
cd cabal-install
|
||||||
|
curl -O "${cabal_url}"
|
||||||
|
tar -xf cabal-install-*
|
||||||
|
mv cabal "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/cabal
|
||||||
|
cd ..
|
||||||
|
rm -rf cabal-install
|
||||||
|
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
url=https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup
|
||||||
|
|
||||||
|
curl -sSfL "${url}" > ./ghcup-bin
|
||||||
|
chmod +x ghcup-bin
|
||||||
|
|
||||||
|
./ghcup-bin upgrade -i -f
|
||||||
|
./ghcup-bin install ${GHC_VERSION}
|
||||||
|
./ghcup-bin set ${GHC_VERSION}
|
||||||
|
./ghcup-bin install-cabal ${CABAL_VERSION}
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
|
||||||
|
|
||||||
mkdir -p "${TMPDIR}"
|
|
||||||
|
|
||||||
ednf() {
|
|
||||||
case "${ARCH}" in
|
|
||||||
"ARM")
|
|
||||||
sudo dnf -y --forcearch armv7hl "$@"
|
|
||||||
;;
|
|
||||||
"ARM64")
|
|
||||||
sudo dnf -y --forcearch aarch64 "$@"
|
|
||||||
;;
|
|
||||||
*) exit 1 ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
ednf update
|
|
||||||
ednf install gcc gcc-c++ gmp gmp-devel make ncurses ncurses-devel xz xz-devel perl zlib zlib-devel openssl-devel openssl-libs openssl libffi libffi-devel lbzip2 lbzip2-utils bzip2-devel
|
|
||||||
if [ "${ARCH}" = "ARM64" ] ; then
|
|
||||||
ednf install numactl numactl-libs numactl-devel
|
|
||||||
fi
|
|
||||||
ednf install bash wget curl git tar
|
|
||||||
ednf install llvm9.0 llvm9.0-devel llvm9.0-libs llvm9.0-static
|
|
||||||
|
|
||||||
case "${ARCH}" in
|
|
||||||
"ARM")
|
|
||||||
ghc_url=https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-armv7-deb10-linux.tar.xz
|
|
||||||
cabal_url=home.smart-cactus.org/~ben/cabal-install-${CABAL_VERSION}-armv7-linux-bootstrapped.tar.xz
|
|
||||||
;;
|
|
||||||
"ARM64")
|
|
||||||
ghc_url=https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-aarch64-deb10-linux.tar.xz
|
|
||||||
cabal_url=https://downloads.haskell.org/~cabal/cabal-install-${CABAL_VERSION}/cabal-install-${CABAL_VERSION}-aarch64-ubuntu-18.04.tar.xz
|
|
||||||
;;
|
|
||||||
*) exit 1 ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin
|
|
||||||
|
|
||||||
curl -O "${ghc_url}"
|
|
||||||
tar -xf ghc-*.tar.*
|
|
||||||
cd ghc-${GHC_VERSION}
|
|
||||||
./configure --prefix="${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/ghc/${GHC_VERSION}
|
|
||||||
make install
|
|
||||||
for i in "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/ghc/${GHC_VERSION}/bin/*-${GHC_VERSION} ; do
|
|
||||||
ln -s "${i}" "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/${i##*/}
|
|
||||||
done
|
|
||||||
for x in "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/*-${GHC_VERSION} ; do
|
|
||||||
ln -s ${x##*/} ${x%-${GHC_VERSION}}
|
|
||||||
done
|
|
||||||
cd ..
|
|
||||||
rm -rf ghc-${GHC_VERSION} ghc-*.tar.*
|
|
||||||
unset x i
|
|
||||||
|
|
||||||
mkdir cabal-install
|
|
||||||
cd cabal-install
|
|
||||||
curl -O "${cabal_url}"
|
|
||||||
tar -xf cabal-install-*
|
|
||||||
mv cabal "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/cabal
|
|
||||||
cd ..
|
|
||||||
rm -rf cabal-install
|
|
||||||
@@ -6,11 +6,10 @@ set -eux
|
|||||||
|
|
||||||
mkdir -p "${TMPDIR}" "${CABAL_DIR}"
|
mkdir -p "${TMPDIR}" "${CABAL_DIR}"
|
||||||
|
|
||||||
rm -rf /c/ghcup
|
mkdir -p "$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin"
|
||||||
mkdir -p /c/ghcup
|
|
||||||
|
|
||||||
CI_PROJECT_DIR=$(pwd)
|
CI_PROJECT_DIR=$(pwd)
|
||||||
curl -o ghcup.exe https://downloads.haskell.org/~ghcup/tmp/x86_64-mingw64-ghcup-5.exe
|
curl -o ghcup.exe https://downloads.haskell.org/~ghcup/0.1.15.1/x86_64-mingw64-ghcup-0.1.15.1.exe
|
||||||
chmod +x ghcup.exe
|
chmod +x ghcup.exe
|
||||||
|
|
||||||
./ghcup.exe install ${GHC_VERSION}
|
./ghcup.exe install ${GHC_VERSION}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
if [ "${OS}" = "WINDOWS" ] ; then
|
if [ "${OS}" = "WINDOWS" ] ; then
|
||||||
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
||||||
export PATH="/c/ghcup/bin:$CI_PROJECT_DIR/.local/bin:$PATH"
|
export PATH="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin:$CI_PROJECT_DIR/.local/bin:$PATH"
|
||||||
export TMPDIR="$CI_PROJECT_DIR/tmp"
|
export TMPDIR="$CI_PROJECT_DIR/tmp"
|
||||||
else
|
else
|
||||||
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
||||||
export PATH="$CI_PROJECT_DIR/.ghcup/bin:$CI_PROJECT_DIR/.local/bin:$PATH"
|
export PATH="$CI_PROJECT_DIR/.ghcup/bin:$CI_PROJECT_DIR/.local/bin:/opt/llvm/bin:$PATH"
|
||||||
export TMPDIR="$CI_PROJECT_DIR/tmp"
|
export TMPDIR="$CI_PROJECT_DIR/tmp"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir out
|
mkdir out
|
||||||
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup')" .
|
binary=$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup')
|
||||||
ver=$(./ghcup --numeric-version)
|
ver=$("${binary}" --numeric-version)
|
||||||
if [ "${OS}" = "DARWIN" ] ; then
|
if [ "${OS}" = "DARWIN" ] ; then
|
||||||
strip ./ghcup
|
strip "${binary}"
|
||||||
else
|
else
|
||||||
strip -s ./ghcup
|
strip -s "${binary}"
|
||||||
fi
|
fi
|
||||||
cp ghcup out/${ARTIFACT}-${ver}
|
cp "${binary}" out/${ARTIFACT}-${ver}
|
||||||
|
|
||||||
|
|||||||
@@ -60,16 +60,21 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup')" .
|
if [ "${OS}" = "WINDOWS" ] ; then
|
||||||
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup-gen')" .
|
ext=".exe"
|
||||||
|
else
|
||||||
cp ./ghcup "$CI_PROJECT_DIR"/.local/bin/ghcup
|
ext=''
|
||||||
cp ./ghcup-gen "$CI_PROJECT_DIR"/.local/bin/ghcup-gen
|
fi
|
||||||
|
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup')" "$CI_PROJECT_DIR"/.local/bin/ghcup${ext}
|
||||||
|
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup-gen')" "$CI_PROJECT_DIR"/.local/bin/ghcup-gen${ext}
|
||||||
|
|
||||||
### cleanup
|
### cleanup
|
||||||
|
|
||||||
rm -rf "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
|
if [ "${OS}" = "WINDOWS" ] ; then
|
||||||
|
rm -rf "${GHCUP_INSTALL_BASE_PREFIX}"/ghcup
|
||||||
|
else
|
||||||
|
rm -rf "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
|
||||||
|
fi
|
||||||
|
|
||||||
### manual cli based testing
|
### manual cli based testing
|
||||||
|
|
||||||
@@ -92,40 +97,46 @@ eghcup list -t cabal
|
|||||||
|
|
||||||
ghc_ver=$(ghc --numeric-version)
|
ghc_ver=$(ghc --numeric-version)
|
||||||
ghc --version
|
ghc --version
|
||||||
ghci --version
|
ghc-${ghc_ver} --version
|
||||||
ghc-$(ghc --numeric-version) --version
|
if [ "${OS}" != "WINDOWS" ] ; then
|
||||||
ghci-$(ghc --numeric-version) --version
|
ghci --version
|
||||||
|
ghci-${ghc_ver} --version
|
||||||
|
|
||||||
# test installing new ghc doesn't mess with currently set GHC
|
|
||||||
# https://gitlab.haskell.org/haskell/ghcup-hs/issues/7
|
|
||||||
if [ "${OS}" = "LINUX" ] ; then
|
|
||||||
eghcup --downloader=wget install 8.10.3
|
|
||||||
else # test wget a bit
|
|
||||||
eghcup install 8.10.3
|
|
||||||
fi
|
fi
|
||||||
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
|
||||||
eghcup set 8.10.3
|
|
||||||
eghcup set 8.10.3
|
|
||||||
[ "$(ghc --numeric-version)" = "8.10.3" ]
|
|
||||||
eghcup set ${GHC_VERSION}
|
|
||||||
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
|
||||||
eghcup rm 8.10.3
|
|
||||||
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
|
||||||
|
|
||||||
if [ "${OS}" = "DARWIN" ] ; then
|
|
||||||
eghcup install hls
|
|
||||||
haskell-language-server-wrapper --version
|
|
||||||
|
|
||||||
eghcup install stack
|
if [ "${OS}" = "DARWIN" ] && [ "${ARCH}" = "ARM64" ] ; then
|
||||||
stack --version
|
echo
|
||||||
elif [ "${OS}" = "LINUX" ] ; then
|
else
|
||||||
if [ "${ARCH}" = "64" ] ; then
|
# test installing new ghc doesn't mess with currently set GHC
|
||||||
|
# https://gitlab.haskell.org/haskell/ghcup-hs/issues/7
|
||||||
|
if [ "${OS}" = "LINUX" ] ; then
|
||||||
|
eghcup --downloader=wget install 8.10.3
|
||||||
|
else # test wget a bit
|
||||||
|
eghcup install 8.10.3
|
||||||
|
fi
|
||||||
|
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
||||||
|
eghcup set 8.10.3
|
||||||
|
eghcup set 8.10.3
|
||||||
|
[ "$(ghc --numeric-version)" = "8.10.3" ]
|
||||||
|
eghcup set ${GHC_VERSION}
|
||||||
|
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
||||||
|
eghcup rm 8.10.3
|
||||||
|
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
||||||
|
|
||||||
|
if [ "${OS}" = "DARWIN" ] ; then
|
||||||
eghcup install hls
|
eghcup install hls
|
||||||
haskell-language-server-wrapper --version
|
haskell-language-server-wrapper --version
|
||||||
|
|
||||||
eghcup install stack
|
eghcup install stack
|
||||||
stack --version
|
stack --version
|
||||||
|
elif [ "${OS}" = "LINUX" ] ; then
|
||||||
|
if [ "${ARCH}" = "64" ] ; then
|
||||||
|
eghcup install hls
|
||||||
|
haskell-language-server-wrapper --version
|
||||||
|
|
||||||
|
eghcup install stack
|
||||||
|
stack --version
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -143,3 +154,11 @@ fi
|
|||||||
eghcup upgrade
|
eghcup upgrade
|
||||||
eghcup upgrade -f
|
eghcup upgrade -f
|
||||||
|
|
||||||
|
|
||||||
|
# nuke
|
||||||
|
eghcup nuke
|
||||||
|
if [ "${OS}" = "WINDOWS" ] ; then
|
||||||
|
[ ! -e "${GHCUP_INSTALL_BASE_PREFIX}/ghcup" ]
|
||||||
|
else
|
||||||
|
[ ! -e "${GHCUP_INSTALL_BASE_PREFIX}/.ghcup" ]
|
||||||
|
fi
|
||||||
|
|||||||
89
.gitlab/shell.nix
Normal file
89
.gitlab/shell.nix
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
{ system ? "aarch64-darwin"
|
||||||
|
#, nixpkgs ? fetchTarball https://github.com/angerman/nixpkgs/archive/257cb120334.tar.gz #apple-silicon.tar.gz
|
||||||
|
, pkgs ? import <nixpkgs> { inherit system; }
|
||||||
|
, compiler ? if system == "aarch64-darwin" then "ghc8103Binary" else "ghc8103"
|
||||||
|
}: pkgs.mkShell {
|
||||||
|
# this prevents nix from trying to write the env-vars file.
|
||||||
|
# we can't really, as NIX_BUILD_TOP/env-vars is not set.
|
||||||
|
noDumpEnvVars=1;
|
||||||
|
|
||||||
|
# stop polluting LDFLAGS with -liconv
|
||||||
|
dontAddExtraLibs = true;
|
||||||
|
|
||||||
|
# we need to inject ncurses into --with-curses-libraries.
|
||||||
|
# the real fix is to teach terminfo to use libcurses on macOS.
|
||||||
|
# CONFIGURE_ARGS = "--with-intree-gmp --with-curses-libraries=${pkgs.ncurses.out}/lib";
|
||||||
|
CONFIGURE_ARGS = "--with-intree-gmp --with-curses-libraries=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib --with-iconv-includes=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include --with-iconv-libraries=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib SH=/bin/bash";
|
||||||
|
|
||||||
|
# magic speedup pony :facepalm:
|
||||||
|
#
|
||||||
|
# nix has the ugly habbit of duplicating ld flags more than necessary. This
|
||||||
|
# somewhat consolidates this.
|
||||||
|
shellHook = ''
|
||||||
|
export NIX_LDFLAGS=$(for a in $NIX_LDFLAGS; do echo $a; done |sort|uniq|xargs)
|
||||||
|
export NIX_LDFLAGS_FOR_TARGET=$(for a in $NIX_LDFLAGS_FOR_TARGET; do echo $a; done |sort|uniq|xargs)
|
||||||
|
export NIX_LDFLAGS_FOR_TARGET=$(comm -3 <(for l in $NIX_LDFLAGS_FOR_TARGET; do echo $l; done) <(for l in $NIX_LDFLAGS; do echo $l; done))
|
||||||
|
|
||||||
|
|
||||||
|
# Impurity hack for GHC releases.
|
||||||
|
#################################
|
||||||
|
# We don't want binary releases to depend on nix, thus we'll need to make sure we don't leak in references.
|
||||||
|
# GHC externally depends only on iconv and curses. However we can't force a specific curses library for
|
||||||
|
# the terminfo package, as such we'll need to make sure we only look in the system path for the curses library
|
||||||
|
# and not pick up the tinfo from the nix provided ncurses package.
|
||||||
|
#
|
||||||
|
# We also need to force us to use the systems COREFOUNDATION, not the one that nix builds. Again this is impure,
|
||||||
|
# but it will allow us to have proper binary distributions.
|
||||||
|
#
|
||||||
|
# do not use nixpkgs provided core foundation
|
||||||
|
export NIX_COREFOUNDATION_RPATH=/System/Library/Frameworks
|
||||||
|
# drop curses from the LDFLAGS, we really want the system ones, not the nix ones.
|
||||||
|
export NIX_LDFLAGS=$(for lib in $NIX_LDFLAGS; do case "$lib" in *curses*);; *) echo -n "$lib ";; esac; done;)
|
||||||
|
export NIX_CFLAGS_COMPILE+=" -Wno-nullability-completeness -Wno-availability -Wno-expansion-to-defined -Wno-builtin-requires-header -Wno-unused-command-line-argument"
|
||||||
|
|
||||||
|
# unconditionally add the MacOSX.sdk and TargetConditional.h
|
||||||
|
export NIX_CFLAGS_COMPILE+=" -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
|
||||||
|
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = (with pkgs; [
|
||||||
|
# This needs to come *before* ghc,
|
||||||
|
# otherwise we migth end up with the clang from
|
||||||
|
# the bootstrap GHC in PATH with higher priority.
|
||||||
|
clang_11
|
||||||
|
llvm_11
|
||||||
|
|
||||||
|
haskell.compiler.${compiler}
|
||||||
|
haskell.packages.${compiler}.cabal-install
|
||||||
|
haskell.packages.${compiler}.alex
|
||||||
|
haskell.packages.${compiler}.happy # _1_19_12 is needed for older GHCs.
|
||||||
|
|
||||||
|
automake
|
||||||
|
autoconf
|
||||||
|
m4
|
||||||
|
|
||||||
|
gmp
|
||||||
|
zlib.out
|
||||||
|
zlib.dev
|
||||||
|
glibcLocales
|
||||||
|
# locale doesn't build yet :-/
|
||||||
|
# locale
|
||||||
|
|
||||||
|
git
|
||||||
|
|
||||||
|
python3
|
||||||
|
# python3Full
|
||||||
|
# python3Packages.sphinx
|
||||||
|
perl
|
||||||
|
|
||||||
|
which
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
file
|
||||||
|
|
||||||
|
xz
|
||||||
|
xlibs.lndir
|
||||||
|
|
||||||
|
cacert ])
|
||||||
|
++ (with pkgs.darwin.apple_sdk.frameworks; [ Foundation Security ]);
|
||||||
|
}
|
||||||
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,13 +1,26 @@
|
|||||||
# Revision history for ghcup
|
# Revision history for ghcup
|
||||||
|
|
||||||
## 0.1.15 -- ????-??-??
|
## 0.1.16 -- ????-??-??
|
||||||
|
|
||||||
|
* Add 'nuke' subcommand wrt [#135](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/135), implemented by Arjun Kathuria
|
||||||
|
|
||||||
|
## 0.1.15.2 -- 2021-06-13
|
||||||
|
|
||||||
|
* Remove legacy handling of cabal binary and be more graceful about binaries not installed by ghcup (e.g. stack)
|
||||||
|
* Fix GHC compilation from git
|
||||||
|
* Fix 'ghcup upgrade' on windows
|
||||||
|
* Allow to skip update checks via `GHCUP_SKIP_UPDATE_CHECK`
|
||||||
|
* Use libarchive on windows as well, fixing unpack errors wrt [#147](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/147)
|
||||||
|
|
||||||
|
## 0.1.15.1 -- 2021-06-11
|
||||||
|
|
||||||
|
* Add Apple Silicon support
|
||||||
* Add windows support wrt [#130](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/130)
|
* Add windows support wrt [#130](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/130)
|
||||||
* Add date to GHC bindist names created by ghcup
|
* Add stack support
|
||||||
* Warn when /tmp doesn't have 5GB or more of disk space
|
* Warn when /tmp doesn't have 5GB or more of disk space
|
||||||
* Allow to compile GHC from git repo wrt [#126](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/126)
|
* Allow to compile GHC from git repo wrt [#126](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/126)
|
||||||
* Allow to set custom ghc version when running 'ghcup compile ghc' wrt [#136](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/136)
|
* Allow to set custom ghc version when running 'ghcup compile ghc' wrt [#136](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/136)
|
||||||
* Add stack support
|
* Add date to GHC bindist names created by ghcup
|
||||||
|
|
||||||
## 0.1.14.2 -- 2021-05-12
|
## 0.1.14.2 -- 2021-05-12
|
||||||
|
|
||||||
|
|||||||
@@ -69,3 +69,7 @@ yaml files: `ghcup-<yaml-ver>.yaml`.
|
|||||||
Most of the `Version` parameters to functions had to be replaced with
|
Most of the `Version` parameters to functions had to be replaced with
|
||||||
that and ensured the logic is consistent for cross and non-cross
|
that and ensured the logic is consistent for cross and non-cross
|
||||||
installs.
|
installs.
|
||||||
|
2. This refactor added windows support wrt [#130](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/130).
|
||||||
|
The major changes here were switching `hpath` library out for `filepath`/`directory` (sadly) and
|
||||||
|
introducing a non-unix way of handling processes via the `process` library. It also introduced considerable
|
||||||
|
amounts of CPP wrt file handling, installation etc.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
`ghcup` makes it easy to install specific versions of `ghc` on GNU/Linux,
|
`ghcup` makes it easy to install specific versions of `ghc` on GNU/Linux,
|
||||||
macOS (aka Darwin) and FreeBSD and can also bootstrap a fresh Haskell developer environment from scratch.
|
macOS (aka Darwin), FreeBSD and Windows and can also bootstrap a fresh Haskell developer environment from scratch.
|
||||||
It follows the unix UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well).
|
It follows the unix UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well).
|
||||||
|
|
||||||
Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [pyenv](https://github.com/pyenv/pyenv) and [jenv](http://www.jenv.be).
|
Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [pyenv](https://github.com/pyenv/pyenv) and [jenv](http://www.jenv.be).
|
||||||
@@ -85,7 +85,7 @@ handles your haskell packages and can demand that [a specific version](https://c
|
|||||||
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](./config.yaml).
|
||||||
|
|
||||||
Partial configuration is fine. Command line options always overwrite the config file settings.
|
Partial configuration is fine. Command line options always override the config file settings.
|
||||||
|
|
||||||
### Manpages
|
### Manpages
|
||||||
|
|
||||||
@@ -123,6 +123,9 @@ Then you can control the locations via XDG environment variables as such:
|
|||||||
* `XDG_BIN_HOME`: binaries end up here (default: `~/.local/bin`)
|
* `XDG_BIN_HOME`: binaries end up here (default: `~/.local/bin`)
|
||||||
* `XDG_CONFIG_HOME`: the config file is stored in `ghcup` subdir as `config.yaml` (default: `~/.config`)
|
* `XDG_CONFIG_HOME`: the config file is stored in `ghcup` subdir as `config.yaml` (default: `~/.config`)
|
||||||
|
|
||||||
|
**Note that `ghcup` makes some assumptions about structure of files in `XDG_BIN_HOME`. So if you have other tools
|
||||||
|
installing e.g. stack/cabal/ghc into it, this will likely clash. In that case consider disabling XDG support.**
|
||||||
|
|
||||||
### Env variables
|
### Env variables
|
||||||
|
|
||||||
This is the complete list of env variables that change GHCup behavior:
|
This is the complete list of env variables that change GHCup behavior:
|
||||||
@@ -132,6 +135,7 @@ This is the complete list of env variables that change GHCup behavior:
|
|||||||
* `GHCUP_INSTALL_BASE_PREFIX`: the base of ghcup (default: `$HOME`)
|
* `GHCUP_INSTALL_BASE_PREFIX`: the base of ghcup (default: `$HOME`)
|
||||||
* `GHCUP_CURL_OPTS`: additional options that can be passed to curl
|
* `GHCUP_CURL_OPTS`: additional options that can be passed to curl
|
||||||
* `GHCUP_WGET_OPTS`: additional options that can be passed to wget
|
* `GHCUP_WGET_OPTS`: additional options that can be passed to wget
|
||||||
|
* `GHCUP_SKIP_UPDATE_CHECK`: Skip the (possibly annoying) update check when you run a command
|
||||||
* `CC`/`LD` etc.: full environment is passed to the build system when compiling GHC via GHCup
|
* `CC`/`LD` etc.: full environment is passed to the build system when compiling GHC via GHCup
|
||||||
|
|
||||||
### Installing custom bindists
|
### Installing custom bindists
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ data Command
|
|||||||
| Upgrade UpgradeOpts Bool
|
| Upgrade UpgradeOpts Bool
|
||||||
| ToolRequirements
|
| ToolRequirements
|
||||||
| ChangeLog ChangeLogOptions
|
| ChangeLog ChangeLogOptions
|
||||||
|
| Nuke
|
||||||
#if defined(BRICK)
|
#if defined(BRICK)
|
||||||
| Interactive
|
| Interactive
|
||||||
#endif
|
#endif
|
||||||
@@ -219,7 +220,7 @@ invertableSwitch'
|
|||||||
-> Mod FlagFields Bool -- ^ option modifier for --no-foo
|
-> Mod FlagFields Bool -- ^ option modifier for --no-foo
|
||||||
-> Parser (Maybe Bool)
|
-> Parser (Maybe Bool)
|
||||||
invertableSwitch' longopt shortopt defv enmod dismod = optional
|
invertableSwitch' longopt shortopt defv enmod dismod = optional
|
||||||
( flag' True (enmod <> long longopt <> if defv then mempty else short shortopt)
|
( flag' True ( enmod <> long longopt <> if defv then mempty else short shortopt)
|
||||||
<|> flag' False (dismod <> long nolongopt <> if defv then short shortopt else mempty)
|
<|> flag' False (dismod <> long nolongopt <> if defv then short shortopt else mempty)
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
@@ -368,6 +369,14 @@ com =
|
|||||||
)
|
)
|
||||||
<> internal
|
<> internal
|
||||||
)
|
)
|
||||||
|
<|> subparser
|
||||||
|
(command
|
||||||
|
"nuke"
|
||||||
|
(info (pure Nuke <**> helper)
|
||||||
|
(progDesc "Completely remove ghcup from your system"))
|
||||||
|
<> commandGroup "Nuclear Commands:"
|
||||||
|
)
|
||||||
|
|
||||||
where
|
where
|
||||||
installToolFooter :: String
|
installToolFooter :: String
|
||||||
installToolFooter = [s|Discussion:
|
installToolFooter = [s|Discussion:
|
||||||
@@ -393,7 +402,6 @@ com =
|
|||||||
By default returns the URI of the ChangeLog of the latest GHC release.
|
By default returns the URI of the ChangeLog of the latest GHC release.
|
||||||
Pass '-o' to automatically open via xdg-open.|]
|
Pass '-o' to automatically open via xdg-open.|]
|
||||||
|
|
||||||
|
|
||||||
installCabalFooter :: String
|
installCabalFooter :: String
|
||||||
installCabalFooter = [s|Discussion:
|
installCabalFooter = [s|Discussion:
|
||||||
Installs the specified cabal-install version (or a recommended default one)
|
Installs the specified cabal-install version (or a recommended default one)
|
||||||
@@ -1095,17 +1103,20 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
>>= \opt@Options {..} -> do
|
>>= \opt@Options {..} -> do
|
||||||
dirs <- getDirs
|
dirs <- getDirs
|
||||||
|
|
||||||
(settings, keybindings) <- toSettings opt
|
|
||||||
|
|
||||||
-- create ~/.ghcup dir
|
-- create ~/.ghcup dir
|
||||||
createDirRecursive' (baseDir dirs)
|
ensureDirectories dirs
|
||||||
|
|
||||||
|
(settings, keybindings) <- toSettings opt
|
||||||
|
|
||||||
-- logger interpreter
|
-- logger interpreter
|
||||||
logfile <- initGHCupFileLogging (logsDir dirs)
|
logfile <- initGHCupFileLogging (logsDir dirs)
|
||||||
let loggerConfig = LoggerConfig
|
let loggerConfig = LoggerConfig
|
||||||
{ lcPrintDebug = verbose settings
|
{ lcPrintDebug = verbose settings
|
||||||
, colorOutter = B.hPut stderr
|
, colorOutter = B.hPut stderr
|
||||||
, rawOutter = B.appendFile logfile
|
, rawOutter =
|
||||||
|
case optCommand of
|
||||||
|
Nuke -> \_ -> pure ()
|
||||||
|
_ -> B.appendFile logfile
|
||||||
}
|
}
|
||||||
let runLogger = myLoggerT loggerConfig
|
let runLogger = myLoggerT loggerConfig
|
||||||
let siletRunLogger = myLoggerT loggerConfig { colorOutter = \_ -> pure () }
|
let siletRunLogger = myLoggerT loggerConfig { colorOutter = \_ -> pure () }
|
||||||
@@ -1144,7 +1155,10 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
|
|
||||||
case optCommand of
|
case optCommand of
|
||||||
Upgrade _ _ -> pure ()
|
Upgrade _ _ -> pure ()
|
||||||
_ -> runLogger $ flip runReaderT appstate $ checkForUpdates
|
_ -> do
|
||||||
|
lookupEnv "GHCUP_SKIP_UPDATE_CHECK" >>= \case
|
||||||
|
Nothing -> runLogger $ flip runReaderT appstate $ checkForUpdates
|
||||||
|
Just _ -> pure ()
|
||||||
|
|
||||||
|
|
||||||
-- ensure global tools
|
-- ensure global tools
|
||||||
@@ -1618,7 +1632,7 @@ Make sure to clean up #{tmpdir} afterwards.|])
|
|||||||
target <- case uOpts of
|
target <- case uOpts of
|
||||||
UpgradeInplace -> Just <$> liftIO getExecutablePath
|
UpgradeInplace -> Just <$> liftIO getExecutablePath
|
||||||
(UpgradeAt p) -> pure $ Just p
|
(UpgradeAt p) -> pure $ Just p
|
||||||
UpgradeGHCupDir -> pure (Just (binDir </> "ghcup"))
|
UpgradeGHCupDir -> pure (Just (binDir </> "ghcup" <> exeExt))
|
||||||
|
|
||||||
runUpgrade (liftE $ upgradeGHCup target force) >>= \case
|
runUpgrade (liftE $ upgradeGHCup target force) >>= \case
|
||||||
VRight v' -> do
|
VRight v' -> do
|
||||||
@@ -1690,9 +1704,41 @@ Make sure to clean up #{tmpdir} afterwards.|])
|
|||||||
>> pure (ExitFailure 13)
|
>> pure (ExitFailure 13)
|
||||||
else putStrLn uri' >> pure ExitSuccess
|
else putStrLn uri' >> pure ExitSuccess
|
||||||
|
|
||||||
|
Nuke ->
|
||||||
|
runRm (do
|
||||||
|
lift $ $logWarn "WARNING: This will remove GHCup and all installed components from your system."
|
||||||
|
lift $ $logWarn "Waiting 10 seconds before commencing, if you want to cancel it, now would be the time."
|
||||||
|
liftIO $ threadDelay 10000000 -- wait 10s
|
||||||
|
|
||||||
|
lift $ $logInfo "Initiating Nuclear Sequence 🚀🚀🚀"
|
||||||
|
lift $ $logInfo "Nuking in 3...2...1"
|
||||||
|
|
||||||
|
lInstalled <- lift $ listVersions Nothing (Just ListInstalled)
|
||||||
|
|
||||||
|
forM_ lInstalled (liftE . rmTool)
|
||||||
|
|
||||||
|
lift rmGhcupDirs
|
||||||
|
|
||||||
|
) >>= \case
|
||||||
|
VRight leftOverFiles
|
||||||
|
| null leftOverFiles -> do
|
||||||
|
runLogger $ $logInfo "Nuclear Annihilation complete!"
|
||||||
|
pure ExitSuccess
|
||||||
|
| otherwise -> do
|
||||||
|
runLogger $ $logWarn "These Files have survived Nuclear Annihilation, you may remove them manually."
|
||||||
|
forM_ leftOverFiles putStrLn
|
||||||
|
pure ExitSuccess
|
||||||
|
|
||||||
|
VLeft e -> do
|
||||||
|
runLogger $ $(logError) $ T.pack $ prettyShow e
|
||||||
|
pure $ ExitFailure 15
|
||||||
|
|
||||||
|
|
||||||
case res of
|
case res of
|
||||||
ExitSuccess -> pure ()
|
ExitSuccess -> pure ()
|
||||||
ef@(ExitFailure _) -> exitWith ef
|
ef@(ExitFailure _) -> exitWith ef
|
||||||
|
|
||||||
|
|
||||||
pure ()
|
pure ()
|
||||||
|
|
||||||
fromVersion :: (MonadLogger m, MonadFail m, MonadReader AppState m, MonadThrow m, MonadIO m, MonadCatch m)
|
fromVersion :: (MonadLogger m, MonadFail m, MonadReader AppState m, MonadThrow m, MonadIO m, MonadCatch m)
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
plat="$(uname -s)"
|
plat="$(uname -s)"
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
ghver="0.1.14.1"
|
ghver="0.1.15.2"
|
||||||
base_url="https://downloads.haskell.org/~ghcup"
|
base_url="https://downloads.haskell.org/~ghcup"
|
||||||
|
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*)
|
||||||
: "${GHCUP_INSTALL_BASE_PREFIX:=/c}"
|
: "${GHCUP_INSTALL_BASE_PREFIX:=/c}"
|
||||||
GHCUP_DIR=${GHCUP_INSTALL_BASE_PREFIX}/ghcup
|
GHCUP_DIR=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup")
|
||||||
GHCUP_BIN=${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin
|
GHCUP_BIN=$(cygpath -u "${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin")
|
||||||
: "${GHCUP_MSYS2:=${GHCUP_DIR}/msys64}"
|
: "${GHCUP_MSYS2:=${GHCUP_DIR}/msys64}"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -73,9 +73,9 @@ _eghcup() {
|
|||||||
args="-s ${BOOTSTRAP_HASKELL_YAML}"
|
args="-s ${BOOTSTRAP_HASKELL_YAML}"
|
||||||
fi
|
fi
|
||||||
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
|
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
|
||||||
ghcup ${args} "$@"
|
"${GHCUP_BIN}/ghcup" ${args} "$@"
|
||||||
else
|
else
|
||||||
ghcup ${args} --verbose "$@"
|
"${GHCUP_BIN}/ghcup" ${args} --verbose "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,6 +166,10 @@ download_ghcup() {
|
|||||||
"Darwin"|"darwin")
|
"Darwin"|"darwin")
|
||||||
case "${arch}" in
|
case "${arch}" in
|
||||||
x86_64|amd64)
|
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)
|
i*86)
|
||||||
die "i386 currently not supported!"
|
die "i386 currently not supported!"
|
||||||
@@ -173,11 +177,11 @@ download_ghcup() {
|
|||||||
*) die "Unknown architecture: ${arch}"
|
*) die "Unknown architecture: ${arch}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
_url=${base_url}/${ghver}/x86_64-apple-darwin-ghcup-${ghver} ;;
|
;;
|
||||||
MSYS*|MINGW*)
|
MSYS*|MINGW*)
|
||||||
case "${arch}" in
|
case "${arch}" in
|
||||||
x86_64|amd64)
|
x86_64|amd64)
|
||||||
_url=https://downloads.haskell.org/ghcup/0.1.15-rc2/x86_64-mingw64-ghcup-0.1.15.exe
|
_url=${base_url}/${ghver}/x86_64-mingw64-ghcup-${ghver}.exe
|
||||||
;;
|
;;
|
||||||
*) die "Unknown architecture: ${arch}"
|
*) die "Unknown architecture: ${arch}"
|
||||||
;;
|
;;
|
||||||
@@ -206,6 +210,90 @@ download_ghcup() {
|
|||||||
eghcup upgrade
|
eghcup upgrade
|
||||||
}
|
}
|
||||||
|
|
||||||
|
adjust_bashrc() {
|
||||||
|
case $SHELL in
|
||||||
|
*/zsh) # login shell is zsh
|
||||||
|
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
||||||
|
MY_SHELL="zsh" ;;
|
||||||
|
*/bash) # login shell is bash
|
||||||
|
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
||||||
|
MY_SHELL="bash" ;;
|
||||||
|
*/sh) # login shell is sh, but might be a symlink to bash or zsh
|
||||||
|
if [ -n "${BASH}" ] ; then
|
||||||
|
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
||||||
|
MY_SHELL="bash"
|
||||||
|
elif [ -n "${ZSH_VERSION}" ] ; then
|
||||||
|
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
||||||
|
MY_SHELL="zsh"
|
||||||
|
else
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*/fish) # login shell is fish
|
||||||
|
GHCUP_PROFILE_FILE="$HOME/.config/fish/config.fish"
|
||||||
|
MY_SHELL="fish" ;;
|
||||||
|
*) return ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
warn ""
|
||||||
|
warn "Detected ${MY_SHELL} shell on your system..."
|
||||||
|
warn "If you want ghcup to automatically add the required PATH variable to \"${GHCUP_PROFILE_FILE}\""
|
||||||
|
warn ""
|
||||||
|
warn "[Y] Yes [N] No [?] Help (default is \"Y\")."
|
||||||
|
warn ""
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
||||||
|
read -r next_answer </dev/tty
|
||||||
|
else
|
||||||
|
next_answer="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $next_answer in
|
||||||
|
[Nn]*)
|
||||||
|
return ;;
|
||||||
|
[Yy]* | "")
|
||||||
|
case $MY_SHELL in
|
||||||
|
"") break ;;
|
||||||
|
fish)
|
||||||
|
mkdir -p "${GHCUP_PROFILE_FILE%/*}"
|
||||||
|
sed -i -e '/# ghcup-env$/ s/^#*/#/' "${GHCUP_PROFILE_FILE}"
|
||||||
|
echo "set -q GHCUP_INSTALL_BASE_PREFIX[1]; or set GHCUP_INSTALL_BASE_PREFIX \$HOME ; test -f $GHCUP_DIR/env ; and set -gx PATH \$HOME/.cabal/bin $GHCUP_BIN \$PATH # ghcup-env" >> "${GHCUP_PROFILE_FILE}"
|
||||||
|
break ;;
|
||||||
|
bash)
|
||||||
|
sed -i -e '/# ghcup-env$/ s/^#*/#/' "${GHCUP_PROFILE_FILE}"
|
||||||
|
echo "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "${GHCUP_PROFILE_FILE}"
|
||||||
|
case "${plat}" in
|
||||||
|
"Darwin"|"darwin")
|
||||||
|
if ! grep -q "ghcup-env" "${HOME}/.bash_profile" ; then
|
||||||
|
echo "[[ -f ~/.bashrc ]] && source ~/.bashrc # ghcup-env" >> "${HOME}/.bash_profile"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
break ;;
|
||||||
|
|
||||||
|
zsh)
|
||||||
|
sed -i -e '/# ghcup-env$/ s/^#*/#/' "${GHCUP_PROFILE_FILE}"
|
||||||
|
echo "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "${GHCUP_PROFILE_FILE}"
|
||||||
|
break ;;
|
||||||
|
esac
|
||||||
|
warn "OK! ${GHCUP_PROFILE_FILE} has been modified. Restart your terminal for the changes to take effect,"
|
||||||
|
warn "or type \"source ${GHCUP_DIR}/env\" to apply them in your current terminal session."
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Possible choices are:"
|
||||||
|
echo
|
||||||
|
echo "Y - Yes, update my \"${GHCUP_PROFILE_FILE}\" (default)"
|
||||||
|
echo "N - No, don't mess with my configuration"
|
||||||
|
echo
|
||||||
|
echo "Please make your choice and press ENTER."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Welcome to Haskell!"
|
echo "Welcome to Haskell!"
|
||||||
@@ -273,7 +361,7 @@ eghcup set ghc "${BOOTSTRAP_HASKELL_GHC_VERSION}"
|
|||||||
eghcup --cache install cabal "${BOOTSTRAP_HASKELL_CABAL_VERSION}"
|
eghcup --cache install cabal "${BOOTSTRAP_HASKELL_CABAL_VERSION}"
|
||||||
|
|
||||||
adjust_cabal_config() {
|
adjust_cabal_config() {
|
||||||
edo cabal user-config -a "extra-prog-path: $(cygpath -w $GHCUP_BIN), $(cygpath -w "$HOME"/AppData/Roaming/cabal/bin), $(cygpath -w "$GHCUP_MSYS2"/usr/bin), $(cygpath -w "$GHCUP_MSYS2"/mingw64/bin)" -a "extra-include-dirs: $(cygpath -w "$GHCUP_MSYS2"/mingw64/include)" -a "extra-lib-dirs: $(cygpath -w "$GHCUP_MSYS2"/mingw64/lib)" -f init
|
edo cabal user-config -a "extra-prog-path: $(cygpath -w "$GHCUP_BIN"), $(cygpath -w "$HOME"/AppData/Roaming/cabal/bin), $(cygpath -w "$GHCUP_MSYS2"/usr/bin), $(cygpath -w "$GHCUP_MSYS2"/mingw64/bin)" -a "extra-include-dirs: $(cygpath -w "$GHCUP_MSYS2"/mingw64/include)" -a "extra-lib-dirs: $(cygpath -w "$GHCUP_MSYS2"/mingw64/lib)" -f init
|
||||||
}
|
}
|
||||||
|
|
||||||
case "${plat}" in
|
case "${plat}" in
|
||||||
@@ -313,6 +401,7 @@ esac
|
|||||||
|
|
||||||
edo cabal new-update
|
edo cabal new-update
|
||||||
|
|
||||||
|
|
||||||
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
||||||
warn "Do you want to install haskell-language-server (HLS) now?"
|
warn "Do you want to install haskell-language-server (HLS) now?"
|
||||||
warn "HLS is a language-server that provides IDE-like functionality"
|
warn "HLS is a language-server that provides IDE-like functionality"
|
||||||
@@ -327,7 +416,7 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
|||||||
|
|
||||||
case $hls_answer in
|
case $hls_answer in
|
||||||
[Yy]*)
|
[Yy]*)
|
||||||
eghcup --cache install hls
|
_eghcup --cache install hls || warn "HLS installation failed, continuing anyway"
|
||||||
break ;;
|
break ;;
|
||||||
[Nn]* | "")
|
[Nn]* | "")
|
||||||
break ;;
|
break ;;
|
||||||
@@ -354,7 +443,7 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
|||||||
|
|
||||||
case $stack_answer in
|
case $stack_answer in
|
||||||
[Yy]*)
|
[Yy]*)
|
||||||
eghcup --cache install stack
|
_eghcup --cache install stack || warn "Stack installation failed, continuing anyway"
|
||||||
break ;;
|
break ;;
|
||||||
[Nn]* | "")
|
[Nn]* | "")
|
||||||
break ;;
|
break ;;
|
||||||
@@ -368,94 +457,24 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
echo "In order to run ghc and cabal, you need to adjust your PATH variable."
|
# short-circuit script based on platform
|
||||||
echo "You may want to source '$GHCUP_DIR/env' in your shell"
|
case "${plat}" in
|
||||||
echo "configuration to do so (e.g. ~/.bashrc)."
|
MSYS*|MINGW*)
|
||||||
|
# For windows we always adjust bashrc, since it's inside msys2
|
||||||
|
adjust_bashrc
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
||||||
|
echo "In order to run ghc and cabal, you need to adjust your PATH variable."
|
||||||
|
echo "You may want to source '$GHCUP_DIR/env' in your shell"
|
||||||
|
echo "configuration to do so (e.g. ~/.bashrc)."
|
||||||
|
|
||||||
case $SHELL in
|
adjust_bashrc
|
||||||
*/zsh) # login shell is zsh
|
|
||||||
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
|
||||||
MY_SHELL="zsh" ;;
|
|
||||||
*/bash) # login shell is bash
|
|
||||||
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
|
||||||
MY_SHELL="bash" ;;
|
|
||||||
*/sh) # login shell is sh, but might be a symlink to bash or zsh
|
|
||||||
if [ -n "${BASH}" ] ; then
|
|
||||||
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
|
||||||
MY_SHELL="bash"
|
|
||||||
elif [ -n "${ZSH_VERSION}" ] ; then
|
|
||||||
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
|
||||||
MY_SHELL="zsh"
|
|
||||||
else
|
|
||||||
_done
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*/fish) # login shell is fish
|
esac
|
||||||
GHCUP_PROFILE_FILE="$HOME/.config/fish/config.fish"
|
|
||||||
MY_SHELL="fish" ;;
|
|
||||||
*) _done ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
|
||||||
warn ""
|
|
||||||
warn "Detected ${MY_SHELL} shell on your system..."
|
|
||||||
warn "If you want ghcup to automatically add the required PATH variable to \"${GHCUP_PROFILE_FILE}\""
|
|
||||||
warn ""
|
|
||||||
warn "[Y] Yes [N] No [?] Help (default is \"Y\")."
|
|
||||||
warn ""
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
read -r next_answer </dev/tty
|
|
||||||
|
|
||||||
case $next_answer in
|
|
||||||
[Nn]*)
|
|
||||||
_done ;;
|
|
||||||
[Yy]* | "")
|
|
||||||
case $MY_SHELL in
|
|
||||||
"") break ;;
|
|
||||||
fish)
|
|
||||||
if ! grep -q "ghcup-env" "${GHCUP_PROFILE_FILE}" ; then
|
|
||||||
mkdir -p "${GHCUP_PROFILE_FILE%/*}"
|
|
||||||
echo "# ghcup-env" >> "${GHCUP_PROFILE_FILE}"
|
|
||||||
echo "set -q GHCUP_INSTALL_BASE_PREFIX[1]; or set GHCUP_INSTALL_BASE_PREFIX \$HOME" >> "${GHCUP_PROFILE_FILE}"
|
|
||||||
echo "test -f $GHCUP_DIR/env ; and set -gx PATH \$HOME/.cabal/bin $GHCUP_BIN \$PATH" >> "${GHCUP_PROFILE_FILE}"
|
|
||||||
fi
|
|
||||||
break ;;
|
|
||||||
bash)
|
|
||||||
if ! grep -q "ghcup-env" "${GHCUP_PROFILE_FILE}" ; then
|
|
||||||
echo "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "${GHCUP_PROFILE_FILE}"
|
|
||||||
fi
|
|
||||||
case "${plat}" in
|
|
||||||
"Darwin"|"darwin")
|
|
||||||
if ! grep -q "ghcup-env" "${HOME}/.bash_profile" ; then
|
|
||||||
echo "[[ -f ~/.bashrc ]] && source ~/.bashrc # ghcup-env" >> "${HOME}/.bash_profile"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
break ;;
|
|
||||||
|
|
||||||
zsh)
|
|
||||||
if ! grep -q "ghcup-env" "${GHCUP_PROFILE_FILE}" ; then
|
|
||||||
echo "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "${GHCUP_PROFILE_FILE}"
|
|
||||||
fi
|
|
||||||
break ;;
|
|
||||||
esac
|
|
||||||
warn "OK! ${GHCUP_PROFILE_FILE} has been modified. Restart your terminal for the changes to take effect,"
|
|
||||||
warn "or type \"source ${GHCUP_DIR}/env\" to apply them in your current terminal session."
|
|
||||||
_done
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Possible choices are:"
|
|
||||||
echo
|
|
||||||
echo "Y - Yes, update my \"${GHCUP_PROFILE_FILE}\" (default)"
|
|
||||||
echo "N - No, don't mess with my configuration"
|
|
||||||
echo
|
|
||||||
echo "Please make your choice and press ENTER."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
_done
|
_done
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,36 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Script to bootstrap a Haskell environment
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This is the windows GHCup installer, installing:
|
||||||
|
|
||||||
|
* ghcup - The Haskell toolchain installer"
|
||||||
|
* ghc - The Glasgow Haskell Compiler"
|
||||||
|
* msys2 - Unix-style toolchain needed for dependencies and tools
|
||||||
|
* cabal - The Cabal build tool for managing Haskell software"
|
||||||
|
* stack - (optional) A cross-platform program for developing Haskell projects"
|
||||||
|
* hls - (optional) A language server for developers to integrate with their editor/IDE"
|
||||||
|
#>
|
||||||
|
param (
|
||||||
|
# Run an interactive installation
|
||||||
|
[switch]$Interactive,
|
||||||
|
# Specify the install root (default: 'C:\')
|
||||||
|
[string]$InstallDir,
|
||||||
|
# Instead of installing a new MSys2, use an existing installation
|
||||||
|
[string]$ExistingMsys2Dir,
|
||||||
|
# Specify the cabal root directory (default: '$InstallDir\cabal')
|
||||||
|
[string]$CabalDir,
|
||||||
|
# Overwrite (or rather backup) a previous install
|
||||||
|
[switch]$Overwrite,
|
||||||
|
# Specify the bootstrap url (default: 'https://www.haskell.org/ghcup/sh/bootstrap-haskell')
|
||||||
|
[string]$BootstrapUrl,
|
||||||
|
# Run the final bootstrap script via 'bash' instead of a full newly spawned msys2 shell
|
||||||
|
[switch]$InBash
|
||||||
|
)
|
||||||
|
|
||||||
|
$Silent = !$Interactive
|
||||||
|
|
||||||
function Print-Msg {
|
function Print-Msg {
|
||||||
param ( [Parameter(Mandatory=$true, HelpMessage='String to output')][string]$msg, [string]$color = "Green" )
|
param ( [Parameter(Mandatory=$true, HelpMessage='String to output')][string]$msg, [string]$color = "Green" )
|
||||||
Write-Host ('{0}' -f $msg) -ForegroundColor $color
|
Write-Host ('{0}' -f $msg) -ForegroundColor $color
|
||||||
@@ -15,51 +48,48 @@ function Create-Shortcut {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Add-EnvPath {
|
function Add-EnvPath {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true,HelpMessage='The Pathe to add to Users environment')]
|
[Parameter(Mandatory=$true,HelpMessage='The Path to add to Users environment')]
|
||||||
[string] $Path,
|
[string] $Path,
|
||||||
|
|
||||||
[ValidateSet('Machine', 'User', 'Session')]
|
[ValidateSet('Machine', 'User', 'Session')]
|
||||||
[string] $Container = 'Session'
|
[string] $Container = 'Session'
|
||||||
)
|
)
|
||||||
|
|
||||||
function Where-Something
|
if ($Container -eq 'Session') {
|
||||||
{
|
$envPaths = [Collections.Generic.List[String]]($env:Path -split ([IO.Path]::PathSeparator))
|
||||||
param
|
if ($envPaths -notcontains $Path) {
|
||||||
(
|
$envPaths.Add($Path)
|
||||||
[Parameter(Mandatory=$true, ValueFromPipeline=$true, HelpMessage='Data to filter')]
|
$env:PATH = $envPaths -join ([IO.Path]::PathSeparator)
|
||||||
$InputObject
|
}
|
||||||
)
|
}
|
||||||
process
|
else {
|
||||||
{
|
[Microsoft.Win32.RegistryHive]$hive, $keyPath = switch ($Container) {
|
||||||
if ($InputObject)
|
'Machine' { 'LocalMachine', 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment' }
|
||||||
{
|
'User' { 'CurrentUser', 'Environment' }
|
||||||
$InputObject
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($Container -ne 'Session') {
|
$hiveKey = $envKey = $null
|
||||||
$containerMapping = @{
|
try {
|
||||||
Machine = [EnvironmentVariableTarget]::Machine
|
$hiveKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($hive, '')
|
||||||
User = [EnvironmentVariableTarget]::User
|
$envKey = $hiveKey.OpenSubKey($keyPath, $true)
|
||||||
}
|
$rawPath = $envKey.GetValue('PATH', '', 'DoNotExpandEnvironmentNames')
|
||||||
$containerType = $containerMapping[$Container]
|
|
||||||
|
|
||||||
$persistedPaths = [Environment]::GetEnvironmentVariable('Path', $containerType) -split ';'
|
$envPaths = [Collections.Generic.List[String]]($rawPath -split ([IO.Path]::PathSeparator))
|
||||||
if ($persistedPaths -notcontains $Path) {
|
if ($envPaths -notcontains $Path) {
|
||||||
$persistedPaths = $persistedPaths + $Path | Where-Something
|
$envPaths.Add($Path)
|
||||||
[Environment]::SetEnvironmentVariable('Path', $persistedPaths -join ';', $containerType)
|
$envKey.SetValue('PATH', ($envPaths -join ([IO.Path]::PathSeparator)), 'ExpandString')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
$envPaths = $env:Path -split ';'
|
if ($envKey) { $envKey.Close() }
|
||||||
if ($envPaths -notcontains $Path) {
|
if ($hiveKey) { $hiveKey.Close() }
|
||||||
$envPaths = $envPaths + $Path | Where-Something
|
}
|
||||||
$env:Path = $envPaths -join ';'
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
filter Get-FileSize {
|
filter Get-FileSize {
|
||||||
'{0:N2} {1}' -f $(
|
'{0:N2} {1}' -f $(
|
||||||
if ($_ -lt 1kb) { $_, 'Bytes' }
|
if ($_ -lt 1kb) { $_, 'Bytes' }
|
||||||
@@ -91,22 +121,124 @@ function Get-FileWCSynchronous{
|
|||||||
Get-Item -Path $destination | Unblock-File
|
Get-Item -Path $destination | Unblock-File
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Test-AbsolutePath {
|
||||||
|
Param (
|
||||||
|
[Parameter(Mandatory=$True)]
|
||||||
|
[ValidateScript({[System.IO.Path]::IsPathRooted($_)})]
|
||||||
|
[String]$Path
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function Exec
|
||||||
|
{
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Position = 0, Mandatory = 1)][string]$cmd,
|
||||||
|
[Parameter()][string]$errorMessage,
|
||||||
|
[parameter(ValueFromRemainingArguments = $true)]
|
||||||
|
[string[]]$Passthrough
|
||||||
|
)
|
||||||
|
& $cmd @Passthrough
|
||||||
|
if ($lastexitcode -ne 0) {
|
||||||
|
if (!($errorMessage)) {
|
||||||
|
throw ('Exec: Error executing command {0} with arguments ''{1}''' -f $cmd, "$Passthrough")
|
||||||
|
} else {
|
||||||
|
throw ('Exec: ' + $errorMessage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
$GhcupDir = "C:\ghcup"
|
$GhcupBasePrefixEnv = [System.Environment]::GetEnvironmentVariable('GHCUP_INSTALL_BASE_PREFIX', 'user')
|
||||||
|
|
||||||
|
if ($GhcupBasePrefixEnv) {
|
||||||
|
$defaultGhcupBasePrefix = $GhcupBasePrefixEnv
|
||||||
|
} else {
|
||||||
|
$partitions = Get-CimInstance win32_logicaldisk
|
||||||
|
$defaultGhcupBasePrefix = $null
|
||||||
|
foreach ($p in $partitions){
|
||||||
|
try {
|
||||||
|
if ($p."FreeSpace" -lt 5368709120) { # at least 5 GB are needed
|
||||||
|
throw ("Not enough free space on {0}" -f $p."DeviceId")
|
||||||
|
}
|
||||||
|
$null = New-Item -Path ('{0}\' -f $p."DeviceId") -Name "ghcup.test" -ItemType "directory" -Force
|
||||||
|
$defaultGhcupBasePrefix = ('{0}\' -f $p."DeviceId")
|
||||||
|
Remove-Item -LiteralPath ('{0}\ghcup.test' -f $p."DeviceId")
|
||||||
|
break
|
||||||
|
} catch {
|
||||||
|
Print-Msg -color Yellow -msg ("{0} not writable or not enough disk space, trying next device" -f $p."DeviceId")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($defaultGhcupBasePrefix) {
|
||||||
|
Print-Msg -color Green -msg ("Picked {0} as default Install prefix!" -f $defaultGhcupBasePrefix)
|
||||||
|
} else {
|
||||||
|
Print-Msg -color Red -msg "Couldn't find a writable partition with at least 5GB free disk space!"
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Silent -and !($InstallDir)) {
|
||||||
|
$GhcupBasePrefix = $defaultGhcupBasePrefix
|
||||||
|
} elseif ($InstallDir) {
|
||||||
|
if (!(Test-Path -LiteralPath ('{0}' -f $InstallDir) -IsValid)) {
|
||||||
|
Print-Msg -color Red -msg "Not a valid directory!"
|
||||||
|
Exit 1
|
||||||
|
} elseif (!(Split-Path -IsAbsolute -Path "$InstallDir")) {
|
||||||
|
Print-Msg -color Red -msg "Non-absolute Path specified!"
|
||||||
|
Exit 1
|
||||||
|
} else {
|
||||||
|
$GhcupBasePrefix = $InstallDir
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while ($true) {
|
||||||
|
Print-Msg -color Magenta -msg ('Where to install to (this should be a short Path, preferably a Drive like ''C:\''){1}Press enter to accept the default [{0}]:' -f $defaultGhcupBasePrefix, "`n")
|
||||||
|
$basePrefixPrompt = Read-Host
|
||||||
|
$GhcupBasePrefix = ($defaultGhcupBasePrefix,$basePrefixPrompt)[[bool]$basePrefixPrompt]
|
||||||
|
if (!($GhcupBasePrefix.EndsWith('\'))) {
|
||||||
|
$GhcupBasePrefix = ('{0}\' -f $GhcupBasePrefix)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!($GhcupBasePrefix)) {
|
||||||
|
Print-Msg -color Red -msg "No directory specified!"
|
||||||
|
} elseif (!(Test-Path -LiteralPath ('{0}' -f $GhcupBasePrefix))) {
|
||||||
|
Print-Msg -color Red -msg "Directory does not exist, need to specify an existing Drive/Directory"
|
||||||
|
} elseif (!(Split-Path -IsAbsolute -Path "$GhcupBasePrefix")) {
|
||||||
|
Print-Msg -color Red -msg "Invalid/Non-absolute Path specified"
|
||||||
|
} else {
|
||||||
|
Break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Print-Msg -msg ('Setting env variable GHCUP_INSTALL_BASE_PREFIX to ''{0}''' -f $GhcupBasePrefix)
|
||||||
|
$null = [Environment]::SetEnvironmentVariable("GHCUP_INSTALL_BASE_PREFIX", $GhcupBasePrefix, [System.EnvironmentVariableTarget]::User)
|
||||||
|
|
||||||
|
|
||||||
|
$GhcupDir = ('{0}\ghcup' -f $GhcupBasePrefix)
|
||||||
$MsysDir = ('{0}\msys64' -f $GhcupDir)
|
$MsysDir = ('{0}\msys64' -f $GhcupDir)
|
||||||
$Bash = ('{0}\usr\bin\bash' -f $MsysDir)
|
$Bash = ('{0}\usr\bin\bash' -f $MsysDir)
|
||||||
$BootstrapUrl = 'https://www.haskell.org/ghcup/sh/bootstrap-haskell-windows'
|
if (!($BootstrapUrl)) {
|
||||||
|
$BootstrapUrl = 'https://www.haskell.org/ghcup/sh/bootstrap-haskell'
|
||||||
|
}
|
||||||
$GhcupMsys2 = [System.Environment]::GetEnvironmentVariable('GHCUP_MSYS2', 'user')
|
$GhcupMsys2 = [System.Environment]::GetEnvironmentVariable('GHCUP_MSYS2', 'user')
|
||||||
|
|
||||||
Print-Msg -msg 'Preparing for GHCup installation...'
|
Print-Msg -msg 'Preparing for GHCup installation...'
|
||||||
|
|
||||||
if (Test-Path -Path ('{0}' -f $GhcupDir)) {
|
if (Test-Path -LiteralPath ('{0}' -f $GhcupDir)) {
|
||||||
$decision = $Host.UI.PromptForChoice('Install GHCup'
|
Print-Msg -msg ('GHCup already installed at ''{0}''...' -f $GhcupDir)
|
||||||
, 'GHCup is already installed, what do you want to do?'
|
if ($Overwrite) {
|
||||||
, @('&Reinstall'
|
$decision = 0
|
||||||
'&Continue'
|
} elseif (!($Silent)) {
|
||||||
'&Abort'), 1)
|
$decision = $Host.UI.PromptForChoice('Install GHCup'
|
||||||
|
, 'GHCup is already installed, what do you want to do?'
|
||||||
|
, [System.Management.Automation.Host.ChoiceDescription[]] @('&Reinstall'
|
||||||
|
'&Continue'
|
||||||
|
'&Abort'), 1)
|
||||||
|
} else {
|
||||||
|
$decision = 1
|
||||||
|
}
|
||||||
|
|
||||||
if ($decision -eq 0) {
|
if ($decision -eq 0) {
|
||||||
$suffix = [IO.Path]::GetRandomFileName()
|
$suffix = [IO.Path]::GetRandomFileName()
|
||||||
Print-Msg -msg ('Backing up {0} to {0}-{1} ...' -f $GhcupDir, $suffix)
|
Print-Msg -msg ('Backing up {0} to {0}-{1} ...' -f $GhcupDir, $suffix)
|
||||||
@@ -114,7 +246,7 @@ if (Test-Path -Path ('{0}' -f $GhcupDir)) {
|
|||||||
} elseif ($decision -eq 1) {
|
} elseif ($decision -eq 1) {
|
||||||
Print-Msg -msg 'Continuing installation...'
|
Print-Msg -msg 'Continuing installation...'
|
||||||
} elseif ($decision -eq 2) {
|
} elseif ($decision -eq 2) {
|
||||||
Break
|
Exit 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,11 +256,16 @@ $null = New-Item -Path ('{0}' -f $GhcupDir) -Name 'bin' -ItemType 'directory' -E
|
|||||||
|
|
||||||
Print-Msg -msg 'First checking for Msys2...'
|
Print-Msg -msg 'First checking for Msys2...'
|
||||||
|
|
||||||
if (!(Test-Path -Path ('{0}' -f $MsysDir)) -And !($GhcupMsys2)) {
|
if (!(Test-Path -Path ('{0}' -f $MsysDir))) {
|
||||||
$msys2Decision = $Host.UI.PromptForChoice('Install MSys2'
|
if ($Silent) {
|
||||||
, 'Do you want GHCup to install a default MSys2 toolchain (recommended)?'
|
$msys2Decision = 0
|
||||||
, @('&Yes'
|
} else {
|
||||||
'&No'), 0)
|
$msys2Decision = $Host.UI.PromptForChoice('Install MSys2'
|
||||||
|
, 'Do you want GHCup to install a default MSys2 toolchain (recommended)?'
|
||||||
|
, [System.Management.Automation.Host.ChoiceDescription[]] @('&Yes'
|
||||||
|
'&No'), 0)
|
||||||
|
}
|
||||||
|
|
||||||
if ($msys2Decision -eq 0) {
|
if ($msys2Decision -eq 0) {
|
||||||
Print-Msg -msg ('...Msys2 doesn''t exist, installing into {0} ...this may take a while' -f $MsysDir)
|
Print-Msg -msg ('...Msys2 doesn''t exist, installing into {0} ...this may take a while' -f $MsysDir)
|
||||||
|
|
||||||
@@ -137,7 +274,7 @@ if (!(Test-Path -Path ('{0}' -f $MsysDir)) -And !($GhcupMsys2)) {
|
|||||||
$archive = 'msys2-x86_64-latest.sfx.exe'
|
$archive = 'msys2-x86_64-latest.sfx.exe'
|
||||||
|
|
||||||
if (Get-Command -Name 'curl.exe' -ErrorAction SilentlyContinue) {
|
if (Get-Command -Name 'curl.exe' -ErrorAction SilentlyContinue) {
|
||||||
curl.exe -o ('{0}\{1}' -f $env:TEMP, $archive) ('https://repo.msys2.org/distrib/{0}' -f $archive)
|
Exec "curl.exe" '-o' ('{0}\{1}' -f $env:TEMP, $archive) ('https://repo.msys2.org/distrib/{0}' -f $archive)
|
||||||
} else {
|
} else {
|
||||||
Get-FileWCSynchronous -url ('https://repo.msys2.org/distrib/{0}' -f $archive) -destinationFolder "$env:TEMP" -includeStats
|
Get-FileWCSynchronous -url ('https://repo.msys2.org/distrib/{0}' -f $archive) -destinationFolder "$env:TEMP" -includeStats
|
||||||
}
|
}
|
||||||
@@ -147,69 +284,111 @@ if (!(Test-Path -Path ('{0}' -f $MsysDir)) -And !($GhcupMsys2)) {
|
|||||||
Remove-Item -Path ('{0}/{1}' -f $env:TEMP, $archive)
|
Remove-Item -Path ('{0}/{1}' -f $env:TEMP, $archive)
|
||||||
|
|
||||||
Print-Msg -msg 'Processing MSYS2 bash for first time use...'
|
Print-Msg -msg 'Processing MSYS2 bash for first time use...'
|
||||||
& "$Bash" -lc 'exit'
|
Exec "$Bash" '-lc' 'exit'
|
||||||
|
|
||||||
& "$env:windir\system32\taskkill.exe" /F /FI `"MODULES eq msys-2.0.dll`"
|
Exec "$env:windir\system32\taskkill.exe" /F /FI `"MODULES eq msys-2.0.dll`"
|
||||||
|
|
||||||
Print-Msg -msg 'Upgrading full system...'
|
Print-Msg -msg 'Upgrading full system...'
|
||||||
& "$Bash" -lc 'pacman --noconfirm -Syuu'
|
Exec "$Bash" '-lc' 'pacman --noconfirm -Syuu'
|
||||||
|
|
||||||
Print-Msg -msg 'Upgrading full system twice...'
|
Print-Msg -msg 'Upgrading full system twice...'
|
||||||
& "$Bash" -lc 'pacman --noconfirm -Syuu'
|
Exec "$Bash" '-lc' 'pacman --noconfirm -Syuu'
|
||||||
|
|
||||||
Print-Msg -msg 'Installing GHC Build Dependencies...'
|
Print-Msg -msg 'Installing Dependencies...'
|
||||||
& "$Bash" -lc 'pacman --noconfirm -S --needed git tar curl wget base-devel gettext binutils autoconf make libtool automake python p7zip patch unzip mingw-w64-x86_64-toolchain mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-python2 mingw-w64-x86_64-python3-sphinx'
|
Exec "$Bash" '-lc' 'pacman --noconfirm -S --needed curl mingw-w64-x86_64-pkgconf'
|
||||||
|
|
||||||
Print-Msg -msg 'Updating SSL root certificate authorities...'
|
Print-Msg -msg 'Updating SSL root certificate authorities...'
|
||||||
& "$Bash" -lc 'pacman --noconfirm -S ca-certificates'
|
Exec "$Bash" '-lc' 'pacman --noconfirm -S ca-certificates'
|
||||||
|
|
||||||
Print-Msg -msg 'Setting default home directory...'
|
Print-Msg -msg 'Setting default home directory...'
|
||||||
& "$Bash" -lc "sed -i -e 's/db_home:.*$/db_home: windows/' /etc/nsswitch.conf"
|
Exec "$Bash" '-lc' "sed -i -e 's/db_home:.*$/db_home: windows/' /etc/nsswitch.conf"
|
||||||
} elseif ($msys2Decision -eq 1) {
|
} elseif ($msys2Decision -eq 1) {
|
||||||
Print-Msg -color Magenta -msg 'Skipping MSys2 installation.'
|
Print-Msg -color Yellow -msg 'Skipping MSys2 installation.'
|
||||||
if ($GhcupMsys2) {
|
while ($true) {
|
||||||
Print-Msg -msg 'GHCUP_MSYS2 env var set, using existing installation...'
|
if ($GhcupMsys2) {
|
||||||
$MsysDir = $GhcupMsys2
|
$defaultMsys2Dir = $GhcupMsys2
|
||||||
} else {
|
Print-Msg -color Magenta -msg ('Input existing MSys2 toolchain directory. Press enter to accept the default [{0}]:' -f $defaultMsys2Dir)
|
||||||
$MsysDir = Read-Host -Prompt 'Input existing MSys2 toolchain directory'
|
$MsysDirPrompt = Read-Host
|
||||||
|
$MsysDir = ($defaultMsys2Dir,$MsysDirPrompt)[[bool]$MsysDirPrompt]
|
||||||
|
} else {
|
||||||
|
Print-Msg -color Magenta -msg 'Input existing MSys2 toolchain directory:'
|
||||||
|
$MsysDir = Read-Host
|
||||||
|
}
|
||||||
|
if (!($MsysDir)) {
|
||||||
|
Print-Msg -color Red -msg "No directory specified!"
|
||||||
|
} elseif (!(Test-Path -LiteralPath ('{0}' -f $MsysDir))) {
|
||||||
|
Print-Msg -color Red -msg ('MSys2 installation at ''{0}'' could not be found!' -f $MsysDir)
|
||||||
|
} elseif (!(Split-Path -IsAbsolute -Path "$MsysDir")) {
|
||||||
|
Print-Msg -color Red -msg "Invalid/Non-absolute Path specified"
|
||||||
|
} else {
|
||||||
|
Break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Print-Msg -msg ('Setting GHCUP_MSYS2 env var to ''{0}''' -f $MsysDir)
|
||||||
if (!(Test-Path -Path ('{0}' -f $MsysDir))) {
|
|
||||||
Print-Msg -color Red -msg ('MSys2 installation at ''{0}'' could not be found, aborting!' -f $MsysDir)
|
|
||||||
Break
|
|
||||||
}
|
|
||||||
Print-Msg -msg 'Making MSys2 discoverable for GHCup...'
|
|
||||||
$null = [Environment]::SetEnvironmentVariable("GHCUP_MSYS2", $MsysDir, [System.EnvironmentVariableTarget]::User)
|
$null = [Environment]::SetEnvironmentVariable("GHCUP_MSYS2", $MsysDir, [System.EnvironmentVariableTarget]::User)
|
||||||
$Bash = ('{0}\usr\bin\bash' -f $MsysDir)
|
$Bash = ('{0}\usr\bin\bash' -f $MsysDir)
|
||||||
}
|
}
|
||||||
} elseif ($GhcupMsys2) {
|
|
||||||
if (!(Test-Path -Path ('{0}' -f $GhcupMsys2))) {
|
|
||||||
Print-Msg -color Red -msg ('MSys2 installation at ''{0}'' could not be found, aborting!' -f $GhcupMsys2)
|
|
||||||
Break
|
|
||||||
}
|
|
||||||
$MsysDir = $GhcupMsys2
|
|
||||||
Print-Msg -msg 'Making MSys2 discoverable for GHCup...'
|
|
||||||
$null = [Environment]::SetEnvironmentVariable("GHCUP_MSYS2", $MsysDir, [System.EnvironmentVariableTarget]::User)
|
|
||||||
$Bash = ('{0}\usr\bin\bash' -f $MsysDir)
|
|
||||||
} else {
|
} else {
|
||||||
Print-Msg -msg ('...Msys2 found in {0} ...skipping Msys2 installation.' -f $MsysDir)
|
Print-Msg -msg ('...Msys2 found in {0} ...skipping Msys2 installation.' -f $MsysDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
Print-Msg -msg 'Creating shortcuts...'
|
Print-Msg -msg 'Creating shortcuts...'
|
||||||
Create-Shortcut -SourceExe ('{0}\msys2_shell.cmd' -f $MsysDir) -ArgumentsToSourceExe '-mingw64' -DestinationPath ('{0}\Desktop\Mingw haskell shell.lnk' -f $HOME)
|
$DesktopDir = [Environment]::GetFolderPath("Desktop")
|
||||||
Create-Shortcut -SourceExe 'https://www.msys2.org/docs/package-management' -ArgumentsToSourceExe '' -DestinationPath ('{0}\Desktop\Mingw package management docs.url' -f $HOME)
|
$GhcInstArgs = '-mingw64 -mintty -c "pacman --noconfirm -S --needed base-devel gettext autoconf make libtool automake python p7zip patch unzip"'
|
||||||
|
Create-Shortcut -SourceExe ('{0}\msys2_shell.cmd' -f $MsysDir) -ArgumentsToSourceExe $GhcInstArgs -DestinationPath ('{0}\Install GHC dev dependencies.lnk' -f $DesktopDir)
|
||||||
|
Create-Shortcut -SourceExe ('{0}\msys2_shell.cmd' -f $MsysDir) -ArgumentsToSourceExe '-mingw64' -DestinationPath ('{0}\Mingw haskell shell.lnk' -f $DesktopDir)
|
||||||
|
Create-Shortcut -SourceExe 'https://www.msys2.org/docs/package-management' -ArgumentsToSourceExe '' -DestinationPath ('{0}\Mingw package management docs.url' -f $DesktopDir)
|
||||||
|
|
||||||
Print-Msg -msg ('Adding {0}\bin to Users Path...' -f $GhcupDir)
|
Print-Msg -msg ('Adding {0}\bin to Users Path...' -f $GhcupDir)
|
||||||
Add-EnvPath -Path ('{0}\bin' -f $GhcupDir) -Container 'User'
|
Add-EnvPath -Path ('{0}\bin' -f ([System.IO.Path]::GetFullPath("$GhcupDir"))) -Container 'User'
|
||||||
|
|
||||||
|
if ($CabalDir) {
|
||||||
|
$CabDirEnv = $CabalDir
|
||||||
|
if (!($CabDirEnv)) {
|
||||||
|
Print-Msg -color Red -msg "No directory specified!"
|
||||||
|
Exit 1
|
||||||
|
} elseif (!(Split-Path -IsAbsolute -Path "$CabDirEnv")) {
|
||||||
|
Print-Msg -color Red -msg "Invalid/Non-absolute Path specified"
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
} elseif (!($Silent)) {
|
||||||
|
while ($true) {
|
||||||
|
|
||||||
|
$defaultCabalDir = ('{0}\cabal' -f $GhcupBasePrefix)
|
||||||
|
Print-Msg -color Magenta -msg ('Specify Cabal directory (this is where haskell packages end up). Press enter to accept the default [{0}]:' -f $defaultCabalDir)
|
||||||
|
$CabalDirPrompt = Read-Host
|
||||||
|
$CabDirEnv = ($defaultCabalDir,$CabalDirPrompt)[[bool]$CabalDirPrompt]
|
||||||
|
|
||||||
|
if (!($CabDirEnv)) {
|
||||||
|
Print-Msg -color Red -msg "No directory specified!"
|
||||||
|
} elseif (!(Split-Path -IsAbsolute -Path "$CabDirEnv")) {
|
||||||
|
Print-Msg -color Red -msg "Invalid/Non-absolute Path specified"
|
||||||
|
} else {
|
||||||
|
Break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$CabDirEnv = ('{0}\cabal' -f $GhcupBasePrefix)
|
||||||
|
}
|
||||||
|
|
||||||
|
$CabalDirFull = [System.IO.Path]::GetFullPath("$CabDirEnv")
|
||||||
|
Print-Msg -msg ('Setting CABAL_DIR to ''{0}''' -f $CabalDirFull)
|
||||||
|
$null = [Environment]::SetEnvironmentVariable("CABAL_DIR", $CabalDirFull, [System.EnvironmentVariableTarget]::User)
|
||||||
|
|
||||||
Print-Msg -msg 'Starting GHCup installer...'
|
Print-Msg -msg 'Starting GHCup installer...'
|
||||||
|
|
||||||
$Msys2Shell = ('{0}\msys2_shell.cmd' -f $MsysDir)
|
$Msys2Shell = ('{0}\msys2_shell.cmd' -f $MsysDir)
|
||||||
|
|
||||||
if ((Get-Process -ID $PID).ProcessName.StartsWith("bootstrap-haskell")) {
|
if ($Silent) {
|
||||||
& "$Bash" -lc ('[ -n ''{1}'' ] && export GHCUP_MSYS2=$(cygpath -w ''{1}'') ; export PATH="/c/ghcup/bin:$PATH" ; curl --proto ''=https'' --tlsv1.2 -sSf {0} | bash' -f $BootstrapUrl, $MsysDir)
|
$SilentExport = 'export BOOTSTRAP_HASKELL_NONINTERACTIVE=1 ;'
|
||||||
} else {
|
} else {
|
||||||
& "$Msys2Shell" -mingw64 -mintty -c ('[ -n ''{1}'' ] && export GHCUP_MSYS2=$(cygpath -w ''{1}'') ; export PATH="/c/ghcup/bin:$PATH" ; trap ''echo Press any key to exit && read -n 1 && exit'' 2 ; curl --proto =https --tlsv1.2 -sSf -k {0} | bash ; echo ''Press any key to exit'' && read -n 1' -f $BootstrapUrl, $MsysDir)
|
$SilentExport = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((Get-Process -ID $PID).ProcessName.StartsWith("bootstrap-haskell") -Or $InBash) {
|
||||||
|
Exec "$Bash" '-lc' ('{4} [ -n ''{1}'' ] && export GHCUP_MSYS2=$(cygpath -m ''{1}'') ; [ -n ''{2}'' ] && export GHCUP_INSTALL_BASE_PREFIX=$(cygpath -m ''{2}/'') ; export PATH=$(cygpath -u ''{3}/bin''):$PATH ; export CABAL_DIR=''{5}'' ; [[ ''{0}'' = https* ]] && curl --proto ''=https'' --tlsv1.2 -sSf {0} | bash || cat $(cygpath -m ''{0}'') | bash' -f $BootstrapUrl, $MsysDir, $GhcupBasePrefix, $GhcupDir, $SilentExport, $CabalDirFull)
|
||||||
|
} else {
|
||||||
|
Exec "$Msys2Shell" '-mingw64' '-mintty' '-c' ('{4} [ -n ''{1}'' ] && export GHCUP_MSYS2=$(cygpath -m ''{1}'') ; [ -n ''{2}'' ] && export GHCUP_INSTALL_BASE_PREFIX=$(cygpath -m ''{2}/'') ; export PATH=$(cygpath -u ''{3}/bin''):$PATH ; export CABAL_DIR=''{5}'' ; trap ''echo Press any key to exit && read -n 1 && exit'' 2 ; [[ ''{0}'' = https* ]] && curl --proto ''=https'' --tlsv1.2 -sSf {0} | bash || cat $(cygpath -m ''{0}'') | bash ; echo ''Press any key to exit'' && read -n 1' -f $BootstrapUrl, $MsysDir, $GhcupBasePrefix, $GhcupDir, $SilentExport, $CabalDirFull)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -236,3 +415,8 @@ if ((Get-Process -ID $PID).ProcessName.StartsWith("bootstrap-haskell")) {
|
|||||||
# aED5Ujwyq3Qre+TGVRUqwkEauDhQiX2A008G00fRO6+di6yJRCRn5eaRAbdU3Xww
|
# aED5Ujwyq3Qre+TGVRUqwkEauDhQiX2A008G00fRO6+di6yJRCRn5eaRAbdU3Xww
|
||||||
# E5VhEwLBnwzWrvLKtdEclhgUCo5Tq87QMXVdgX4aRmunl4ZE+Q==
|
# E5VhEwLBnwzWrvLKtdEclhgUCo5Tq87QMXVdgX4aRmunl4ZE+Q==
|
||||||
# SIG # End signature block
|
# SIG # End signature block
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
packages: ./ghcup.cabal
|
packages: ./ghcup.cabal
|
||||||
|
|
||||||
|
optional-packages: ./vendored/*/*.cabal
|
||||||
|
|
||||||
optimization: 2
|
optimization: 2
|
||||||
|
|
||||||
package ghcup
|
package ghcup
|
||||||
@@ -11,6 +13,11 @@ source-repository-package
|
|||||||
location: https://github.com/Bodigrim/tar
|
location: https://github.com/Bodigrim/tar
|
||||||
tag: ac197ec7ea4838dc2b4e22b9b888b080cedf29cf
|
tag: ac197ec7ea4838dc2b4e22b9b888b080cedf29cf
|
||||||
|
|
||||||
|
source-repository-package
|
||||||
|
type: git
|
||||||
|
location: https://github.com/bgamari/terminal-size
|
||||||
|
tag: 34ea816bd63f75f800eedac12c6908c6f3736036
|
||||||
|
|
||||||
constraints: http-io-streams -brotli
|
constraints: http-io-streams -brotli
|
||||||
|
|
||||||
package libarchive
|
package libarchive
|
||||||
|
|||||||
@@ -1520,11 +1520,11 @@ ghcupDownloads:
|
|||||||
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-apple-darwin.tar.xz
|
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-apple-darwin.tar.xz
|
||||||
dlSubdir: ghc-8.10.5
|
dlSubdir: ghc-8.10.5
|
||||||
dlHash: ef0f47eff8962d58fa447123636cf8ef31c1e5b2d0ae90177d3388861ddf4a22
|
dlHash: ef0f47eff8962d58fa447123636cf8ef31c1e5b2d0ae90177d3388861ddf4a22
|
||||||
# FreeBSD:
|
FreeBSD:
|
||||||
# unknown_versioning:
|
unknown_versioning:
|
||||||
# dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-portbld-freebsd.tar.xz
|
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/8.10.5/ghc-8.10.5-x86_64-portbld-freebsd.tar.xz
|
||||||
# dlSubdir: ghc-8.10.5
|
dlSubdir: ghc-8.10.5
|
||||||
# dlHash: c9776a2ccf9629b03e967206a507fcdcb6c5189800a626e9461ababf6733c357
|
dlHash: 11a0b490bfb2f57b5bc87c69c197542eafce1b4991cc22f625179a6c6e567834
|
||||||
A_32:
|
A_32:
|
||||||
Linux_Debian:
|
Linux_Debian:
|
||||||
'( >= 9 && < 10 )': &ghc-8105-32-deb9
|
'( >= 9 && < 10 )': &ghc-8105-32-deb9
|
||||||
@@ -1868,7 +1868,7 @@ ghcupDownloads:
|
|||||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.0.0/cabal-install-3.4.0.0-armv7-linux-bootstrapped.tar.xz
|
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.0.0/cabal-install-3.4.0.0-armv7-linux-bootstrapped.tar.xz
|
||||||
dlHash: 16c0d1eaba24bed14f3e152970179a45d9f9bb5cc839b2c210ad06eb7d4826ed
|
dlHash: 16c0d1eaba24bed14f3e152970179a45d9f9bb5cc839b2c210ad06eb7d4826ed
|
||||||
GHCup:
|
GHCup:
|
||||||
0.1.14.1:
|
0.1.15.2:
|
||||||
viTags:
|
viTags:
|
||||||
- Recommended
|
- Recommended
|
||||||
- Latest
|
- Latest
|
||||||
@@ -1878,35 +1878,39 @@ ghcupDownloads:
|
|||||||
A_64:
|
A_64:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning: &ghcup-64
|
unknown_versioning: &ghcup-64
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/x86_64-linux-ghcup-0.1.15.2
|
||||||
dlHash: 59e31b2ede3ed20f79dce0f8ba0a68b6fb25e5f00ba2d7243f6a8af68d979ff5
|
dlHash: 1eb1bb318a327754f42eaa2245bc81fe53be7c791160d28a186893ded3004ed7
|
||||||
Darwin:
|
Darwin:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-apple-darwin-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/x86_64-apple-darwin-ghcup-0.1.15.2
|
||||||
dlHash: 3e1dd173b3e7b5d90dcdece423c3ddd3efb4c83e964967b0fb574c9b7b2c44e1
|
dlHash: c2a6436a49f19f108493954d4a3efcb27503e343dd6288c2641784d32320b1ea
|
||||||
FreeBSD:
|
FreeBSD:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-portbld-freebsd-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/x86_64-portbld-freebsd-ghcup-0.1.15.2
|
||||||
dlHash: 89a70980d77888dae8b9fd0f05e7a7920f421bc3bb5192da8e73fd4e7b4cb86f
|
dlHash: 7e0c17dd78ebd9fd03e6ecea278c192bac31ca333721bde5b0ef99438b847a20
|
||||||
Linux_Alpine:
|
Linux_Alpine:
|
||||||
unknown_versioning: *ghcup-64
|
unknown_versioning: *ghcup-64
|
||||||
A_32:
|
A_32:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning: &ghcup-32
|
unknown_versioning: &ghcup-32
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/i386-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/i386-linux-ghcup-0.1.15.2
|
||||||
dlHash: 610aac7c3be3ba3874c07b9cae5b2ca0da9a92bf381afc2597bd2dc9c70aae0c
|
dlHash: 3b1fe710cded0398e920ec9716089ba65226abf181741897f387e7c539a619c2
|
||||||
Linux_Alpine:
|
Linux_Alpine:
|
||||||
unknown_versioning: *ghcup-32
|
unknown_versioning: *ghcup-32
|
||||||
A_ARM64:
|
A_ARM64:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/aarch64-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/aarch64-linux-ghcup-0.1.15.2
|
||||||
dlHash: e9ae07b7d41ea03e6af9c1f3587f61287827c4e29478b6a5d46ea1ce5af4cee5
|
dlHash: d91b7a5416f292f2cf813824eb419f76ad9976d258cee3581123cb6eb01db9a7
|
||||||
|
Darwin:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/aarch64-apple-darwin-ghcup-0.1.15.2
|
||||||
|
dlHash: 20625ba5e7488f2a6155331750ecead3815ea16b2695c20521633c1412f012cc
|
||||||
A_ARM:
|
A_ARM:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/armv7-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/armv7-linux-ghcup-0.1.15.2
|
||||||
dlHash: 646832030efbc0a848df24c08b5eb7507bd15d1c2eb95fea6d9d03890f3662be
|
dlHash: 03a4af5ed895ada1dd21f4cc3f64dc9078a5bf4268313021d004c04bea7f9c2e
|
||||||
HLS:
|
HLS:
|
||||||
1.1.0:
|
1.1.0:
|
||||||
viTags:
|
viTags:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
globalTools:
|
globalTools:
|
||||||
ShimGen:
|
ShimGen:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/shimgen/gs.exe
|
dlUri: https://downloads.haskell.org/~ghcup/shimgen/shim-2.exe
|
||||||
dlHash: 9ce8b7dad7ff4e5017dbd63d6f6f3d16412b889560cb6ccd3903dbcab0bf4f0d
|
dlHash: 7c55e201f71860c5babea886007c8fa44b861abf50d1c07e5677eb0bda387a70
|
||||||
toolRequirements:
|
toolRequirements:
|
||||||
GHC:
|
GHC:
|
||||||
unknown_version:
|
unknown_version:
|
||||||
@@ -1631,11 +1631,11 @@ ghcupDownloads:
|
|||||||
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-apple-darwin.tar.xz
|
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-apple-darwin.tar.xz
|
||||||
dlSubdir: ghc-8.10.5
|
dlSubdir: ghc-8.10.5
|
||||||
dlHash: ef0f47eff8962d58fa447123636cf8ef31c1e5b2d0ae90177d3388861ddf4a22
|
dlHash: ef0f47eff8962d58fa447123636cf8ef31c1e5b2d0ae90177d3388861ddf4a22
|
||||||
# FreeBSD:
|
FreeBSD:
|
||||||
# unknown_versioning:
|
unknown_versioning:
|
||||||
# dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-portbld-freebsd.tar.xz
|
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/ghc/8.10.5/ghc-8.10.5-x86_64-portbld-freebsd.tar.xz
|
||||||
# dlSubdir: ghc-8.10.5
|
dlSubdir: ghc-8.10.5
|
||||||
# dlHash: c9776a2ccf9629b03e967206a507fcdcb6c5189800a626e9461ababf6733c357
|
dlHash: 11a0b490bfb2f57b5bc87c69c197542eafce1b4991cc22f625179a6c6e567834
|
||||||
Windows:
|
Windows:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-unknown-mingw32.tar.xz
|
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-x86_64-unknown-mingw32.tar.xz
|
||||||
@@ -1665,6 +1665,11 @@ ghcupDownloads:
|
|||||||
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-aarch64-deb10-linux.tar.xz
|
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-aarch64-deb10-linux.tar.xz
|
||||||
dlSubdir: ghc-8.10.5
|
dlSubdir: ghc-8.10.5
|
||||||
dlHash: 9a085cd8a7f8e0ace21ac67dbf659a56fcf41564b48817ba42cd8a1aac7f0ddc
|
dlHash: 9a085cd8a7f8e0ace21ac67dbf659a56fcf41564b48817ba42cd8a1aac7f0ddc
|
||||||
|
Darwin:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-aarch64-apple-darwin.tar.xz
|
||||||
|
dlSubdir: ghc-8.10.5
|
||||||
|
dlHash: 03684e70ff03d041b9a4e0f84c177953a241ab8ec7a028c72fa21ac67e66cb09
|
||||||
A_ARM:
|
A_ARM:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
@@ -2008,13 +2013,18 @@ ghcupDownloads:
|
|||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~cabal/cabal-install-3.4.0.0/cabal-install-3.4.0.0-aarch64-ubuntu-18.04.tar.xz
|
dlUri: https://downloads.haskell.org/~cabal/cabal-install-3.4.0.0/cabal-install-3.4.0.0-aarch64-ubuntu-18.04.tar.xz
|
||||||
dlHash: 04d378347896dfdc3510b192b97489815cfa5d692f46e2758da0f789e682b8f0
|
dlHash: 04d378347896dfdc3510b192b97489815cfa5d692f46e2758da0f789e682b8f0
|
||||||
|
Darwin:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.0.0/cabal-install-3.4.0.0-aarch64-darwin-big-sur.tar.xz
|
||||||
|
dlHash: 46d8f96446a6bcdb81b3a9fbc14b137dc4f08436b46fe6446c5fba7bcb9b3d75
|
||||||
|
|
||||||
A_ARM:
|
A_ARM:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.0.0/cabal-install-3.4.0.0-armv7-linux-bootstrapped.tar.xz
|
dlUri: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.4.0.0/cabal-install-3.4.0.0-armv7-linux-bootstrapped.tar.xz
|
||||||
dlHash: 16c0d1eaba24bed14f3e152970179a45d9f9bb5cc839b2c210ad06eb7d4826ed
|
dlHash: 16c0d1eaba24bed14f3e152970179a45d9f9bb5cc839b2c210ad06eb7d4826ed
|
||||||
GHCup:
|
GHCup:
|
||||||
0.1.14.1:
|
0.1.15.2:
|
||||||
viTags:
|
viTags:
|
||||||
- Recommended
|
- Recommended
|
||||||
- Latest
|
- Latest
|
||||||
@@ -2024,44 +2034,46 @@ ghcupDownloads:
|
|||||||
A_64:
|
A_64:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning: &ghcup-64
|
unknown_versioning: &ghcup-64
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/x86_64-linux-ghcup-0.1.15.2
|
||||||
dlHash: 59e31b2ede3ed20f79dce0f8ba0a68b6fb25e5f00ba2d7243f6a8af68d979ff5
|
dlHash: 1eb1bb318a327754f42eaa2245bc81fe53be7c791160d28a186893ded3004ed7
|
||||||
Darwin:
|
Darwin:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-apple-darwin-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/x86_64-apple-darwin-ghcup-0.1.15.2
|
||||||
dlHash: 3e1dd173b3e7b5d90dcdece423c3ddd3efb4c83e964967b0fb574c9b7b2c44e1
|
dlHash: c2a6436a49f19f108493954d4a3efcb27503e343dd6288c2641784d32320b1ea
|
||||||
FreeBSD:
|
FreeBSD:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-portbld-freebsd-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/x86_64-portbld-freebsd-ghcup-0.1.15.2
|
||||||
dlHash: 89a70980d77888dae8b9fd0f05e7a7920f421bc3bb5192da8e73fd4e7b4cb86f
|
dlHash: 7e0c17dd78ebd9fd03e6ecea278c192bac31ca333721bde5b0ef99438b847a20
|
||||||
Windows:
|
Windows:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/tmp/x86_64-mingw64-ghcup-1.exe
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/x86_64-mingw64-ghcup-0.1.15.2.exe
|
||||||
dlHash: a61ae29e677db0f0a93505e0ab3b35b7ccc3ebec6a2a2cf9418cfd550ef82ec6
|
dlHash: 4d832052754379531ac472aeef35666e433acfee79d4079826b8ede8ca5de520
|
||||||
Linux_Alpine:
|
Linux_Alpine:
|
||||||
unknown_versioning: *ghcup-64
|
unknown_versioning: *ghcup-64
|
||||||
A_32:
|
A_32:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning: &ghcup-32
|
unknown_versioning: &ghcup-32
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/i386-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/i386-linux-ghcup-0.1.15.2
|
||||||
dlHash: 610aac7c3be3ba3874c07b9cae5b2ca0da9a92bf381afc2597bd2dc9c70aae0c
|
dlHash: 3b1fe710cded0398e920ec9716089ba65226abf181741897f387e7c539a619c2
|
||||||
Linux_Alpine:
|
Linux_Alpine:
|
||||||
unknown_versioning: *ghcup-32
|
unknown_versioning: *ghcup-32
|
||||||
A_ARM64:
|
A_ARM64:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/aarch64-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/aarch64-linux-ghcup-0.1.15.2-r2
|
||||||
dlHash: e9ae07b7d41ea03e6af9c1f3587f61287827c4e29478b6a5d46ea1ce5af4cee5
|
dlHash: d67702f7c9e3586e85ed7c1bd09b7544da55bd1d3b4a961a07018348f78cf76b
|
||||||
|
Darwin:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/aarch64-apple-darwin-ghcup-0.1.15.2
|
||||||
|
dlHash: 20625ba5e7488f2a6155331750ecead3815ea16b2695c20521633c1412f012cc
|
||||||
A_ARM:
|
A_ARM:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
unknown_versioning:
|
unknown_versioning:
|
||||||
dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/armv7-linux-ghcup-0.1.14.1
|
dlUri: https://downloads.haskell.org/~ghcup/0.1.15.2/armv7-linux-ghcup-0.1.15.2
|
||||||
dlHash: 646832030efbc0a848df24c08b5eb7507bd15d1c2eb95fea6d9d03890f3662be
|
dlHash: 03a4af5ed895ada1dd21f4cc3f64dc9078a5bf4268313021d004c04bea7f9c2e
|
||||||
HLS:
|
HLS:
|
||||||
1.1.0:
|
1.1.0:
|
||||||
viTags:
|
viTags: []
|
||||||
- Recommended
|
|
||||||
- Latest
|
|
||||||
viChangeLog: https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md#110
|
viChangeLog: https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md#110
|
||||||
viPostInstall: "This is just the server part of your LSP configuration. Consult the README on how to configure HLS, your project and your LSP client in your editor: https://github.com/haskell/haskell-language-server/blob/master/README.md"
|
viPostInstall: "This is just the server part of your LSP configuration. Consult the README on how to configure HLS, your project and your LSP client in your editor: https://github.com/haskell/haskell-language-server/blob/master/README.md"
|
||||||
viArch:
|
viArch:
|
||||||
@@ -2080,11 +2092,36 @@ ghcupDownloads:
|
|||||||
dlHash: a1d3f451e64a041aa527a25da29e4716a2de6ae347cef4ef9312fc7611e168cc
|
dlHash: a1d3f451e64a041aa527a25da29e4716a2de6ae347cef4ef9312fc7611e168cc
|
||||||
Linux_Alpine:
|
Linux_Alpine:
|
||||||
unknown_versioning: *hls-64
|
unknown_versioning: *hls-64
|
||||||
|
1.2.0:
|
||||||
|
viTags:
|
||||||
|
- Recommended
|
||||||
|
- Latest
|
||||||
|
viChangeLog: https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md#120
|
||||||
|
viPostInstall: "This is just the server part of your LSP configuration. Consult the README on how to configure HLS, your project and your LSP client in your editor: https://github.com/haskell/haskell-language-server/blob/master/README.md"
|
||||||
|
viArch:
|
||||||
|
A_64:
|
||||||
|
Linux_UnknownLinux:
|
||||||
|
unknown_versioning: &hls-64
|
||||||
|
dlUri: https://github.com/haskell/haskell-language-server/releases/download/1.2.0/haskell-language-server-Linux-1.2.0.tar.gz
|
||||||
|
dlHash: d29ee22f7bd706da2e2a1bd7640e25bb9736adeafb34eef47d29ea143b0fa927
|
||||||
|
Darwin:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://github.com/haskell/haskell-language-server/releases/download/1.2.0/haskell-language-server-macOS-1.2.0.tar.gz
|
||||||
|
dlHash: a310d8a3e9c5c4218210f750682c74a0f82ad0f59995adde0dbe775115b1e357
|
||||||
|
Windows:
|
||||||
|
unknown_versioning:
|
||||||
|
dlUri: https://github.com/haskell/haskell-language-server/releases/download/1.2.0/haskell-language-server-Windows-1.2.0.tar.gz
|
||||||
|
dlHash: 961c6ff12c9a9c7a4609f239c5ac70d7d16753cdb8c10348a6a51feeaa0b6aea
|
||||||
|
Linux_Alpine:
|
||||||
|
unknown_versioning: *hls-64
|
||||||
Stack:
|
Stack:
|
||||||
2.5.1:
|
2.5.1:
|
||||||
viTags: []
|
viTags:
|
||||||
|
- old
|
||||||
viChangeLog: https://github.com/commercialhaskell/stack/blob/master/ChangeLog.md#v251
|
viChangeLog: https://github.com/commercialhaskell/stack/blob/master/ChangeLog.md#v251
|
||||||
viPostInstall: &stack-post "Stack manages GHC versions internally by default. In order to make it use ghcup installed GHC versions have a look at the options 'system-ghc', 'compiler-check' and 'compiler': https://docs.haskellstack.org/en/stable/yaml_configuration/#system-ghc"
|
viPostInstall: &stack-post |
|
||||||
|
Stack manages GHC versions internally by default. In order to make it use ghcup installed GHC versions have a look at the options 'system-ghc', 'compiler-check' and 'compiler': https://docs.haskellstack.org/en/stable/yaml_configuration/#system-ghc
|
||||||
|
Additionally, you should upgrade stack only through ghcup.
|
||||||
viArch:
|
viArch:
|
||||||
A_64:
|
A_64:
|
||||||
Linux_UnknownLinux:
|
Linux_UnknownLinux:
|
||||||
|
|||||||
22
ghcup.cabal
22
ghcup.cabal
@@ -1,6 +1,6 @@
|
|||||||
cabal-version: 3.0
|
cabal-version: 3.0
|
||||||
name: ghcup
|
name: ghcup
|
||||||
version: 0.1.15
|
version: 0.1.15.2
|
||||||
license: LGPL-3.0-only
|
license: LGPL-3.0-only
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
copyright: Julian Ospald 2020
|
copyright: Julian Ospald 2020
|
||||||
@@ -43,9 +43,7 @@ flag internal-downloader
|
|||||||
manual: True
|
manual: True
|
||||||
|
|
||||||
flag tar
|
flag tar
|
||||||
description:
|
description: Use tar-bytestring instead of libarchive.
|
||||||
Use tar-bytestring instead of libarchive.
|
|
||||||
|
|
||||||
default: False
|
default: False
|
||||||
manual: True
|
manual: True
|
||||||
|
|
||||||
@@ -115,7 +113,7 @@ library
|
|||||||
, generics-sop ^>=0.5
|
, generics-sop ^>=0.5
|
||||||
, haskus-utils-types ^>=1.5
|
, haskus-utils-types ^>=1.5
|
||||||
, haskus-utils-variant >=3.0 && <3.2
|
, haskus-utils-variant >=3.0 && <3.2
|
||||||
, lzma-static ^>=5.2.5.2
|
, lzma-static ^>=5.2.5.3
|
||||||
, megaparsec >=8.0.0 && <9.1
|
, megaparsec >=8.0.0 && <9.1
|
||||||
, monad-logger ^>=0.3.31
|
, monad-logger ^>=0.3.31
|
||||||
, mtl ^>=2.2
|
, mtl ^>=2.2
|
||||||
@@ -142,7 +140,7 @@ library
|
|||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, utf8-string ^>=1.0
|
, utf8-string ^>=1.0
|
||||||
, vector ^>=0.12
|
, vector ^>=0.12
|
||||||
, versions ^>=4.0.1
|
, versions >=4.0.1 && <5.1
|
||||||
, word8 ^>=0.1.3
|
, word8 ^>=0.1.3
|
||||||
, yaml ^>=0.11.4.0
|
, yaml ^>=0.11.4.0
|
||||||
, zip ^>=1.7.1
|
, zip ^>=1.7.1
|
||||||
@@ -157,7 +155,7 @@ library
|
|||||||
, io-streams >=1.5.2.1
|
, io-streams >=1.5.2.1
|
||||||
, terminal-progress-bar >=0.4.1
|
, terminal-progress-bar >=0.4.1
|
||||||
|
|
||||||
if (flag(tar) || os(windows))
|
if flag(tar)
|
||||||
cpp-options: -DTAR
|
cpp-options: -DTAR
|
||||||
build-depends: tar
|
build-depends: tar
|
||||||
|
|
||||||
@@ -226,7 +224,7 @@ executable ghcup
|
|||||||
, text ^>=1.2.4.0
|
, text ^>=1.2.4.0
|
||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, utf8-string ^>=1.0
|
, utf8-string ^>=1.0
|
||||||
, versions ^>=4.0.1
|
, versions >=4.0.1 && <5.1
|
||||||
|
|
||||||
if flag(internal-downloader)
|
if flag(internal-downloader)
|
||||||
cpp-options: -DINTERNAL_DOWNLOADER
|
cpp-options: -DINTERNAL_DOWNLOADER
|
||||||
@@ -243,7 +241,7 @@ executable ghcup
|
|||||||
if os(windows)
|
if os(windows)
|
||||||
cpp-options: -DIS_WINDOWS
|
cpp-options: -DIS_WINDOWS
|
||||||
|
|
||||||
if (flag(tar) || os(windows))
|
if flag(tar)
|
||||||
cpp-options: -DTAR
|
cpp-options: -DTAR
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -294,10 +292,10 @@ executable ghcup-gen
|
|||||||
, text ^>=1.2.4.0
|
, text ^>=1.2.4.0
|
||||||
, transformers ^>=0.5
|
, transformers ^>=0.5
|
||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, versions ^>=4.0.1
|
, versions >=4.0.1 && <5.1
|
||||||
, yaml ^>=0.11.4.0
|
, yaml ^>=0.11.4.0
|
||||||
|
|
||||||
if (flag(tar) || os(windows))
|
if flag(tar)
|
||||||
cpp-options: -DTAR
|
cpp-options: -DTAR
|
||||||
build-depends: tar
|
build-depends: tar
|
||||||
|
|
||||||
@@ -338,4 +336,4 @@ test-suite ghcup-test
|
|||||||
, quickcheck-arbitrary-adt ^>=0.3.1.0
|
, quickcheck-arbitrary-adt ^>=0.3.1.0
|
||||||
, text ^>=1.2.4.0
|
, text ^>=1.2.4.0
|
||||||
, uri-bytestring ^>=0.3.2.2
|
, uri-bytestring ^>=0.3.2.2
|
||||||
, versions ^>=4.0.1
|
, versions >=4.0.1 && <5.1
|
||||||
|
|||||||
212
lib/GHCup.hs
212
lib/GHCup.hs
@@ -42,6 +42,7 @@ import GHCup.Version
|
|||||||
import Codec.Archive ( ArchiveResult )
|
import Codec.Archive ( ArchiveResult )
|
||||||
#endif
|
#endif
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
|
import Control.Exception ( evaluate )
|
||||||
import Control.Exception.Safe
|
import Control.Exception.Safe
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
#if !MIN_VERSION_base(4,13,0)
|
#if !MIN_VERSION_base(4,13,0)
|
||||||
@@ -84,6 +85,9 @@ import qualified Data.ByteString.Lazy as BL
|
|||||||
import qualified Data.Map.Strict as Map
|
import qualified Data.Map.Strict as Map
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.Encoding as E
|
import qualified Data.Text.Encoding as E
|
||||||
|
#if defined(IS_WINDOWS)
|
||||||
|
import qualified System.Win32.File as Win32
|
||||||
|
#endif
|
||||||
import qualified Text.Megaparsec as MP
|
import qualified Text.Megaparsec as MP
|
||||||
import GHCup.Utils.MegaParsec
|
import GHCup.Utils.MegaParsec
|
||||||
import Control.Concurrent (threadDelay)
|
import Control.Concurrent (threadDelay)
|
||||||
@@ -658,7 +662,6 @@ setGHC ver sghc = do
|
|||||||
|
|
||||||
-- symlink destination
|
-- symlink destination
|
||||||
AppState { dirs = Dirs {..} } <- lift ask
|
AppState { dirs = Dirs {..} } <- lift ask
|
||||||
liftIO $ createDirRecursive' binDir
|
|
||||||
|
|
||||||
-- first delete the old symlinks (this fixes compatibility issues
|
-- first delete the old symlinks (this fixes compatibility issues
|
||||||
-- with old ghcup)
|
-- with old ghcup)
|
||||||
@@ -741,7 +744,6 @@ setCabal ver = do
|
|||||||
|
|
||||||
-- symlink destination
|
-- symlink destination
|
||||||
AppState {dirs = Dirs {..}} <- lift ask
|
AppState {dirs = Dirs {..}} <- lift ask
|
||||||
liftIO $ createDirRecursive' binDir
|
|
||||||
|
|
||||||
whenM (liftIO $ not <$> doesFileExist (binDir </> targetFile))
|
whenM (liftIO $ not <$> doesFileExist (binDir </> targetFile))
|
||||||
$ throwE
|
$ throwE
|
||||||
@@ -772,7 +774,6 @@ setHLS :: ( MonadCatch m
|
|||||||
-> Excepts '[NotInstalled] m ()
|
-> Excepts '[NotInstalled] m ()
|
||||||
setHLS ver = do
|
setHLS ver = do
|
||||||
AppState { dirs = Dirs {..} } <- lift ask
|
AppState { dirs = Dirs {..} } <- lift ask
|
||||||
liftIO $ createDirRecursive' binDir
|
|
||||||
|
|
||||||
-- Delete old symlinks, since these might have different ghc versions than the
|
-- Delete old symlinks, since these might have different ghc versions than the
|
||||||
-- selected version, so we could end up with stray or incorrect symlinks.
|
-- selected version, so we could end up with stray or incorrect symlinks.
|
||||||
@@ -815,7 +816,6 @@ setStack ver = do
|
|||||||
|
|
||||||
-- symlink destination
|
-- symlink destination
|
||||||
AppState {dirs = Dirs {..}} <- lift ask
|
AppState {dirs = Dirs {..}} <- lift ask
|
||||||
liftIO $ createDirRecursive' binDir
|
|
||||||
|
|
||||||
whenM (liftIO $ not <$> doesFileExist (binDir </> targetFile))
|
whenM (liftIO $ not <$> doesFileExist (binDir </> targetFile))
|
||||||
$ throwE
|
$ throwE
|
||||||
@@ -878,7 +878,7 @@ listVersions :: ( MonadCatch m
|
|||||||
listVersions lt' criteria = do
|
listVersions lt' criteria = do
|
||||||
-- some annoying work to avoid too much repeated IO
|
-- some annoying work to avoid too much repeated IO
|
||||||
cSet <- cabalSet
|
cSet <- cabalSet
|
||||||
cabals <- getInstalledCabals' cSet
|
cabals <- getInstalledCabals
|
||||||
hlsSet' <- hlsSet
|
hlsSet' <- hlsSet
|
||||||
hlses <- getInstalledHLSs
|
hlses <- getInstalledHLSs
|
||||||
sSet <- stackSet
|
sSet <- stackSet
|
||||||
@@ -1283,6 +1283,187 @@ rmStackVer ver = do
|
|||||||
Nothing -> liftIO $ rmLink (binDir </> "stack" <> exeExt)
|
Nothing -> liftIO $ rmLink (binDir </> "stack" <> exeExt)
|
||||||
|
|
||||||
|
|
||||||
|
-- assuming the current scheme of having just 1 ghcup bin, no version info is required.
|
||||||
|
rmGhcup :: ( MonadReader AppState m
|
||||||
|
, MonadIO m
|
||||||
|
, MonadCatch m
|
||||||
|
, MonadLogger m
|
||||||
|
)
|
||||||
|
=> m ()
|
||||||
|
|
||||||
|
rmGhcup = do
|
||||||
|
AppState {dirs = Dirs {binDir}} <- ask
|
||||||
|
let ghcupFilename = "ghcup" <> exeExt
|
||||||
|
let ghcupFilepath = binDir </> ghcupFilename
|
||||||
|
|
||||||
|
currentRunningExecPath <- liftIO getExecutablePath
|
||||||
|
|
||||||
|
-- if paths do no exist, warn user, and continue to compare them, as is,
|
||||||
|
-- which should eventually fail and result in a non-standard install warning
|
||||||
|
|
||||||
|
p1 <- handleIO' doesNotExistErrorType
|
||||||
|
(handlePathNotPresent currentRunningExecPath)
|
||||||
|
(liftIO $ canonicalizePath currentRunningExecPath)
|
||||||
|
|
||||||
|
p2 <- handleIO' doesNotExistErrorType
|
||||||
|
(handlePathNotPresent ghcupFilepath)
|
||||||
|
(liftIO $ canonicalizePath ghcupFilepath)
|
||||||
|
|
||||||
|
let areEqualPaths = equalFilePath p1 p2
|
||||||
|
|
||||||
|
unless areEqualPaths $ $logWarn $ nonStandardInstallLocationMsg currentRunningExecPath
|
||||||
|
|
||||||
|
#if defined(IS_WINDOWS)
|
||||||
|
-- since it doesn't seem possible to delete a running exec in windows
|
||||||
|
-- we move it to temp dir, to be deleted at next reboot
|
||||||
|
tempDir <- liftIO $ getTemporaryDirectory
|
||||||
|
let tempFilepath = tempDir </> ghcupFilename
|
||||||
|
hideError UnsupportedOperation $
|
||||||
|
liftIO $ hideError NoSuchThing $
|
||||||
|
Win32.moveFileEx ghcupFilepath (Just tempFilepath) Win32.mOVEFILE_REPLACE_EXISTING
|
||||||
|
#else
|
||||||
|
-- delete it.
|
||||||
|
hideError doesNotExistErrorType $ liftIO $ rmFile ghcupFilepath
|
||||||
|
#endif
|
||||||
|
|
||||||
|
where
|
||||||
|
handlePathNotPresent fp _err = do
|
||||||
|
$logDebug $ "Error: The path does not exist, " <> T.pack fp
|
||||||
|
pure fp
|
||||||
|
|
||||||
|
nonStandardInstallLocationMsg path = T.pack $
|
||||||
|
"current ghcup is invoked from a non-standard location: \n"
|
||||||
|
<> path <>
|
||||||
|
"\n you may have to uninstall it manually."
|
||||||
|
|
||||||
|
rmTool :: ( MonadReader AppState m
|
||||||
|
, MonadLogger m
|
||||||
|
, MonadFail m
|
||||||
|
, MonadMask m
|
||||||
|
, MonadUnliftIO m)
|
||||||
|
=> ListResult
|
||||||
|
-> Excepts '[NotInstalled ] m ()
|
||||||
|
|
||||||
|
rmTool ListResult {lVer, lTool, lCross} = do
|
||||||
|
case lTool of
|
||||||
|
GHC ->
|
||||||
|
let ghcTargetVersion = GHCTargetVersion lCross lVer
|
||||||
|
in rmGHCVer ghcTargetVersion
|
||||||
|
HLS -> rmHLSVer lVer
|
||||||
|
Cabal -> rmCabalVer lVer
|
||||||
|
Stack -> rmStackVer lVer
|
||||||
|
GHCup -> lift rmGhcup
|
||||||
|
|
||||||
|
|
||||||
|
rmGhcupDirs :: ( MonadReader AppState m
|
||||||
|
, MonadIO m
|
||||||
|
, MonadLogger m
|
||||||
|
, MonadCatch m
|
||||||
|
, MonadMask m )
|
||||||
|
=> m [FilePath]
|
||||||
|
rmGhcupDirs = do
|
||||||
|
Dirs
|
||||||
|
{ baseDir
|
||||||
|
, binDir
|
||||||
|
, logsDir
|
||||||
|
, cacheDir
|
||||||
|
} <- asks dirs
|
||||||
|
|
||||||
|
let envFilePath = baseDir </> "env"
|
||||||
|
|
||||||
|
confFilePath <- getConfigFilePath
|
||||||
|
|
||||||
|
rmEnvFile envFilePath
|
||||||
|
rmConfFile confFilePath
|
||||||
|
rmDir cacheDir
|
||||||
|
rmDir logsDir
|
||||||
|
rmBinDir binDir
|
||||||
|
#if defined(IS_WINDOWS)
|
||||||
|
rmDir (baseDir </> "msys64")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
liftIO $ removeEmptyDirsRecursive baseDir
|
||||||
|
|
||||||
|
-- report files in baseDir that are left-over after
|
||||||
|
-- the standard location deletions above
|
||||||
|
hideErrorDef [doesNotExistErrorType] [] $ reportRemainingFiles baseDir
|
||||||
|
|
||||||
|
where
|
||||||
|
|
||||||
|
rmEnvFile :: (MonadCatch m, MonadLogger m, MonadIO m) => FilePath -> m ()
|
||||||
|
rmEnvFile enFilePath = do
|
||||||
|
$logInfo "Removing Ghcup Environment File"
|
||||||
|
hideError doesNotExistErrorType $ liftIO $ deleteFile enFilePath
|
||||||
|
|
||||||
|
rmConfFile :: (MonadCatch m, MonadLogger m, MonadIO m) => FilePath -> m ()
|
||||||
|
rmConfFile confFilePath = do
|
||||||
|
$logInfo "removing Ghcup Config File"
|
||||||
|
hideError doesNotExistErrorType $ liftIO $ deleteFile confFilePath
|
||||||
|
|
||||||
|
rmDir :: (MonadLogger m, MonadIO m, MonadCatch m) => FilePath -> m ()
|
||||||
|
rmDir dir = do
|
||||||
|
$logInfo [i|removing #{dir}|]
|
||||||
|
contents <- hideErrorDef [doesNotExistErrorType] []
|
||||||
|
$ liftIO
|
||||||
|
(getDirectoryContentsRecursive dir >>= evaluate)
|
||||||
|
forM_ contents (liftIO . deleteFile . (dir </>))
|
||||||
|
|
||||||
|
rmBinDir :: (MonadCatch m, MonadIO m) => FilePath -> m ()
|
||||||
|
rmBinDir binDir = do
|
||||||
|
#if !defined(IS_WINDOWS)
|
||||||
|
isXDGStyle <- liftIO useXDG
|
||||||
|
if not isXDGStyle
|
||||||
|
then removeDirIfEmptyOrIsSymlink binDir
|
||||||
|
else pure ()
|
||||||
|
#else
|
||||||
|
removeDirIfEmptyOrIsSymlink binDir
|
||||||
|
#endif
|
||||||
|
|
||||||
|
reportRemainingFiles :: MonadIO m => FilePath -> m [FilePath]
|
||||||
|
reportRemainingFiles dir = do
|
||||||
|
remainingFiles <- liftIO $ getDirectoryContentsRecursive dir
|
||||||
|
let normalizedFilePaths = fmap normalise remainingFiles
|
||||||
|
let sortedByDepthRemainingFiles = sortBy (flip compareFn) normalizedFilePaths
|
||||||
|
let remainingFilesAbsolute = fmap (dir </>) sortedByDepthRemainingFiles
|
||||||
|
|
||||||
|
pure remainingFilesAbsolute
|
||||||
|
|
||||||
|
where
|
||||||
|
calcDepth :: FilePath -> Int
|
||||||
|
calcDepth = length . filter isPathSeparator
|
||||||
|
|
||||||
|
compareFn :: FilePath -> FilePath -> Ordering
|
||||||
|
compareFn fp1 fp2 = compare (calcDepth fp1) (calcDepth fp2)
|
||||||
|
|
||||||
|
removeEmptyDirsRecursive :: FilePath -> IO ()
|
||||||
|
removeEmptyDirsRecursive fp = do
|
||||||
|
cs <- listDirectory fp >>= filterM doesDirectoryExist . fmap (fp </>)
|
||||||
|
forM_ cs removeEmptyDirsRecursive
|
||||||
|
hideError InappropriateType $ removeDirIfEmptyOrIsSymlink fp
|
||||||
|
|
||||||
|
|
||||||
|
-- we expect only files inside cache/log dir
|
||||||
|
-- we report remaining files/dirs later,
|
||||||
|
-- hence the force/quiet mode in these delete functions below.
|
||||||
|
|
||||||
|
deleteFile :: FilePath -> IO ()
|
||||||
|
deleteFile filepath = do
|
||||||
|
hideError InappropriateType $ rmFile filepath
|
||||||
|
|
||||||
|
removeDirIfEmptyOrIsSymlink :: (MonadCatch m, MonadIO m) => FilePath -> m ()
|
||||||
|
removeDirIfEmptyOrIsSymlink filepath =
|
||||||
|
hideError UnsatisfiedConstraints $
|
||||||
|
handleIO' InappropriateType
|
||||||
|
(handleIfSym filepath)
|
||||||
|
(liftIO $ removeDirectory filepath)
|
||||||
|
where
|
||||||
|
handleIfSym fp e = do
|
||||||
|
isSym <- liftIO $ pathIsSymbolicLink fp
|
||||||
|
if isSym
|
||||||
|
then liftIO $ deleteFile fp
|
||||||
|
else liftIO $ ioError e
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------
|
------------------
|
||||||
--[ Debug info ]--
|
--[ Debug info ]--
|
||||||
@@ -1400,7 +1581,7 @@ compileGHC targetGhc ov bstrap jobs mbuildConfig patchdir aargs
|
|||||||
|
|
||||||
lEM $ git [ "checkout", "FETCH_HEAD" ]
|
lEM $ git [ "checkout", "FETCH_HEAD" ]
|
||||||
lEM $ git [ "submodule", "update", "--init", "--depth", "1" ]
|
lEM $ git [ "submodule", "update", "--init", "--depth", "1" ]
|
||||||
lEM $ execLogged "sh" ["./boot"] (Just tmpUnpack) "ghc-bootstrap" Nothing
|
lEM $ execLogged "python3" ["./boot"] (Just tmpUnpack) "ghc-bootstrap" Nothing
|
||||||
lEM $ execLogged "sh" ["./configure"] (Just tmpUnpack) "ghc-bootstrap" Nothing
|
lEM $ execLogged "sh" ["./configure"] (Just tmpUnpack) "ghc-bootstrap" Nothing
|
||||||
CapturedProcess {..} <- lift $ makeOut
|
CapturedProcess {..} <- lift $ makeOut
|
||||||
["show!", "--quiet", "VALUE=ProjectVersion" ] (Just tmpUnpack)
|
["show!", "--quiet", "VALUE=ProjectVersion" ] (Just tmpUnpack)
|
||||||
@@ -1624,27 +1805,40 @@ upgradeGHCup :: ( MonadMask m
|
|||||||
]
|
]
|
||||||
m
|
m
|
||||||
Version
|
Version
|
||||||
upgradeGHCup mtarget force = do
|
upgradeGHCup mtarget force' = do
|
||||||
AppState { dirs = Dirs {..}
|
AppState { dirs = Dirs {..}
|
||||||
, pfreq
|
, pfreq
|
||||||
, ghcupInfo = GHCupInfo { _ghcupDownloads = dls }
|
, ghcupInfo = GHCupInfo { _ghcupDownloads = dls }
|
||||||
, settings } <- lift ask
|
, settings } <- lift ask
|
||||||
lift $ $(logInfo) [i|Upgrading GHCup...|]
|
lift $ $(logInfo) [i|Upgrading GHCup...|]
|
||||||
let latestVer = fromJust $ fst <$> getLatest dls GHCup
|
let latestVer = fromJust $ fst <$> getLatest dls GHCup
|
||||||
when (not force && (latestVer <= pvpToVersion ghcUpVer)) $ throwE NoUpdate
|
when (not force' && (latestVer <= pvpToVersion ghcUpVer)) $ throwE NoUpdate
|
||||||
dli <- lE $ getDownloadInfo GHCup latestVer pfreq dls
|
dli <- lE $ getDownloadInfo GHCup latestVer pfreq dls
|
||||||
tmp <- lift withGHCupTmpDir
|
tmp <- lift withGHCupTmpDir
|
||||||
let fn = "ghcup" <> exeExt
|
let fn = "ghcup" <> exeExt
|
||||||
p <- liftE $ download settings dli tmp (Just fn)
|
p <- liftE $ download settings dli tmp (Just fn)
|
||||||
let destDir = takeDirectory destFile
|
let destDir = takeDirectory destFile
|
||||||
destFile = fromMaybe (binDir </> fn) mtarget
|
destFile = fromMaybe (binDir </> fn <> exeExt) mtarget
|
||||||
lift $ $(logDebug) [i|mkdir -p #{destDir}|]
|
lift $ $(logDebug) [i|mkdir -p #{destDir}|]
|
||||||
liftIO $ createDirRecursive' destDir
|
liftIO $ createDirRecursive' destDir
|
||||||
|
#if defined(IS_WINDOWS)
|
||||||
|
let tempGhcup = cacheDir </> "ghcup.old"
|
||||||
|
liftIO $ hideError NoSuchThing $ rmFile tempGhcup
|
||||||
|
|
||||||
|
lift $ $(logDebug) [i|mv #{destFile} #{tempGhcup}|]
|
||||||
|
-- NoSuchThing may be raised when we're updating ghcup from
|
||||||
|
-- a non-standard location
|
||||||
|
liftIO $ hideError NoSuchThing $ Win32.moveFileEx destFile (Just tempGhcup) 0
|
||||||
|
lift $ $(logDebug) [i|cp #{p} #{destFile}|]
|
||||||
|
handleIO (throwE . CopyError . show) $ liftIO $ copyFile p
|
||||||
|
destFile
|
||||||
|
#else
|
||||||
lift $ $(logDebug) [i|rm -f #{destFile}|]
|
lift $ $(logDebug) [i|rm -f #{destFile}|]
|
||||||
liftIO $ hideError NoSuchThing $ rmFile destFile
|
liftIO $ hideError NoSuchThing $ rmFile destFile
|
||||||
lift $ $(logDebug) [i|cp #{p} #{destFile}|]
|
lift $ $(logDebug) [i|cp #{p} #{destFile}|]
|
||||||
handleIO (throwE . CopyError . show) $ liftIO $ copyFile p
|
handleIO (throwE . CopyError . show) $ liftIO $ copyFile p
|
||||||
destFile
|
destFile
|
||||||
|
#endif
|
||||||
lift $ chmod_755 destFile
|
lift $ chmod_755 destFile
|
||||||
|
|
||||||
liftIO (isInPath destFile) >>= \b -> unless b $
|
liftIO (isInPath destFile) >>= \b -> unless b $
|
||||||
|
|||||||
@@ -227,7 +227,6 @@ getBase dirs@Dirs{..} Settings{ downloader } =
|
|||||||
else -- access in less than 5 minutes, re-use file
|
else -- access in less than 5 minutes, re-use file
|
||||||
liftIO $ L.readFile json_file
|
liftIO $ L.readFile json_file
|
||||||
else do
|
else do
|
||||||
liftIO $ createDirRecursive' cacheDir
|
|
||||||
getModTime >>= \case
|
getModTime >>= \case
|
||||||
Just modTime -> dlWithMod modTime json_file
|
Just modTime -> dlWithMod modTime json_file
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ getPlatform = do
|
|||||||
either (const Nothing) Just
|
either (const Nothing) Just
|
||||||
. versioning
|
. versioning
|
||||||
-- TODO: maybe do this somewhere else
|
-- TODO: maybe do this somewhere else
|
||||||
. getMajorVersion
|
|
||||||
. decUTF8Safe'
|
. decUTF8Safe'
|
||||||
<$> getDarwinVersion
|
<$> getDarwinVersion
|
||||||
pure $ PlatformResult { _platform = Darwin, _distroVersion = ver }
|
pure $ PlatformResult { _platform = Darwin, _distroVersion = ver }
|
||||||
@@ -112,7 +111,6 @@ getPlatform = do
|
|||||||
lift $ $(logDebug) [i|Identified Platform as: #{prettyShow pfr}|]
|
lift $ $(logDebug) [i|Identified Platform as: #{prettyShow pfr}|]
|
||||||
pure pfr
|
pure pfr
|
||||||
where
|
where
|
||||||
getMajorVersion = T.intercalate "." . take 2 . T.split (== '.')
|
|
||||||
getFreeBSDVersion = lift $ fmap _stdOut $ executeOut "freebsd-version" [] Nothing
|
getFreeBSDVersion = lift $ fmap _stdOut $ executeOut "freebsd-version" [] Nothing
|
||||||
getDarwinVersion = lift $ fmap _stdOut $ executeOut "sw_vers"
|
getDarwinVersion = lift $ fmap _stdOut $ executeOut "sw_vers"
|
||||||
["-productVersion"]
|
["-productVersion"]
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ import qualified Codec.Archive.Tar as Tar
|
|||||||
import qualified Codec.Compression.BZip as BZip
|
import qualified Codec.Compression.BZip as BZip
|
||||||
import qualified Codec.Compression.GZip as GZip
|
import qualified Codec.Compression.GZip as GZip
|
||||||
import qualified Codec.Compression.Lzma as Lzma
|
import qualified Codec.Compression.Lzma as Lzma
|
||||||
import qualified Data.ByteString as B
|
|
||||||
import qualified Data.ByteString.Lazy as BL
|
import qualified Data.ByteString.Lazy as BL
|
||||||
import qualified Data.Map.Strict as Map
|
import qualified Data.Map.Strict as Map
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
@@ -253,14 +252,6 @@ getInstalledGHCs = do
|
|||||||
getInstalledCabals :: (MonadLogger m, MonadReader AppState m, MonadIO m, MonadCatch m)
|
getInstalledCabals :: (MonadLogger m, MonadReader AppState m, MonadIO m, MonadCatch m)
|
||||||
=> m [Either FilePath Version]
|
=> m [Either FilePath Version]
|
||||||
getInstalledCabals = do
|
getInstalledCabals = do
|
||||||
cs <- cabalSet -- for legacy cabal
|
|
||||||
getInstalledCabals' cs
|
|
||||||
|
|
||||||
|
|
||||||
getInstalledCabals' :: (MonadLogger m, MonadReader AppState m, MonadIO m, MonadCatch m)
|
|
||||||
=> Maybe Version
|
|
||||||
-> m [Either FilePath Version]
|
|
||||||
getInstalledCabals' cs = do
|
|
||||||
AppState {dirs = Dirs {..}} <- ask
|
AppState {dirs = Dirs {..}} <- ask
|
||||||
bins <- liftIO $ handleIO (\_ -> pure []) $ findFiles
|
bins <- liftIO $ handleIO (\_ -> pure []) $ findFiles
|
||||||
binDir
|
binDir
|
||||||
@@ -269,7 +260,7 @@ getInstalledCabals' cs = do
|
|||||||
Just (Right r) -> pure $ Right r
|
Just (Right r) -> pure $ Right r
|
||||||
Just (Left _) -> pure $ Left f
|
Just (Left _) -> pure $ Left f
|
||||||
Nothing -> pure $ Left f
|
Nothing -> pure $ Left f
|
||||||
pure $ maybe vs (\x -> nub $ Right x:vs) cs
|
pure $ nub vs
|
||||||
|
|
||||||
|
|
||||||
-- | Whether the given cabal version is installed.
|
-- | Whether the given cabal version is installed.
|
||||||
@@ -284,32 +275,21 @@ cabalSet :: (MonadLogger m, MonadReader AppState m, MonadIO m, MonadThrow m, Mon
|
|||||||
cabalSet = do
|
cabalSet = do
|
||||||
AppState {dirs = Dirs {..}} <- ask
|
AppState {dirs = Dirs {..}} <- ask
|
||||||
let cabalbin = binDir </> "cabal" <> exeExt
|
let cabalbin = binDir </> "cabal" <> exeExt
|
||||||
b <- handleIO (\_ -> pure False) $ liftIO $ pathIsLink cabalbin
|
|
||||||
if
|
handleIO' NoSuchThing (\_ -> pure Nothing) $ do
|
||||||
| b -> do
|
broken <- liftIO $ isBrokenSymlink cabalbin
|
||||||
handleIO' NoSuchThing (\_ -> pure Nothing) $ do
|
if broken
|
||||||
broken <- liftIO $ isBrokenSymlink cabalbin
|
then pure Nothing
|
||||||
if broken
|
else do
|
||||||
then pure Nothing
|
link <- liftIO
|
||||||
else do
|
$ handleIO' InvalidArgument
|
||||||
link <- liftIO $ getLinkTarget cabalbin
|
(\e -> pure $ Left (toException e))
|
||||||
case linkVersion link of
|
$ fmap Right $ getLinkTarget cabalbin
|
||||||
Right v -> pure $ Just v
|
case linkVersion =<< link of
|
||||||
Left err -> do
|
Right v -> pure $ Just v
|
||||||
$(logWarn) [i|Failed to parse cabal symlink target with: "#{err}". The symlink #{cabalbin} needs to point to valid cabal binary, such as 'cabal-3.4.0.0'.|]
|
Left err -> do
|
||||||
pure Nothing
|
$(logWarn) [i|Failed to parse cabal symlink target with: "#{err}". The symlink #{cabalbin} needs to point to valid cabal binary, such as 'cabal-3.4.0.0'.|]
|
||||||
| otherwise -> do -- legacy behavior
|
pure Nothing
|
||||||
mc <- handleIO (\_ -> pure Nothing) $ fmap Just $ executeOut
|
|
||||||
cabalbin
|
|
||||||
["--numeric-version"]
|
|
||||||
Nothing
|
|
||||||
fmap join $ forM mc $ \c -> if
|
|
||||||
| not (BL.null (_stdOut c)), _exitCode c == ExitSuccess -> do
|
|
||||||
let reportedVer = fst . B.spanEnd isNewLine . BL.toStrict . _stdOut $ c
|
|
||||||
case version $ decUTF8Safe reportedVer of
|
|
||||||
Left e -> throwM e
|
|
||||||
Right r -> pure $ Just r
|
|
||||||
| otherwise -> pure Nothing
|
|
||||||
where
|
where
|
||||||
-- We try to be extra permissive with link destination parsing,
|
-- We try to be extra permissive with link destination parsing,
|
||||||
-- because of:
|
-- because of:
|
||||||
@@ -375,18 +355,25 @@ getInstalledStacks = do
|
|||||||
|
|
||||||
-- Return the currently set stack version, if any.
|
-- Return the currently set stack version, if any.
|
||||||
-- TODO: there's a lot of code duplication here :>
|
-- TODO: there's a lot of code duplication here :>
|
||||||
stackSet :: (MonadReader AppState m, MonadIO m, MonadThrow m, MonadCatch m) => m (Maybe Version)
|
stackSet :: (MonadReader AppState m, MonadIO m, MonadThrow m, MonadCatch m, MonadLogger m) => m (Maybe Version)
|
||||||
stackSet = do
|
stackSet = do
|
||||||
AppState {dirs = Dirs {..}} <- ask
|
AppState {dirs = Dirs {..}} <- ask
|
||||||
let stackBin = binDir </> "stack" <> exeExt
|
let stackBin = binDir </> "stack" <> exeExt
|
||||||
|
|
||||||
liftIO $ handleIO' NoSuchThing (\_ -> pure Nothing) $ do
|
handleIO' NoSuchThing (\_ -> pure Nothing) $ do
|
||||||
broken <- isBrokenSymlink stackBin
|
broken <- liftIO $ isBrokenSymlink stackBin
|
||||||
if broken
|
if broken
|
||||||
then pure Nothing
|
then pure Nothing
|
||||||
else do
|
else do
|
||||||
link <- liftIO $ getLinkTarget stackBin
|
link <- liftIO
|
||||||
Just <$> linkVersion link
|
$ handleIO' InvalidArgument
|
||||||
|
(\e -> pure $ Left (toException e))
|
||||||
|
$ fmap Right $ getLinkTarget stackBin
|
||||||
|
case linkVersion =<< link of
|
||||||
|
Right v -> pure $ Just v
|
||||||
|
Left err -> do
|
||||||
|
$(logWarn) [i|Failed to parse stack symlink target with: "#{err}". The symlink #{stackBin} needs to point to valid stack binary, such as 'stack-2.7.1'.|]
|
||||||
|
pure Nothing
|
||||||
where
|
where
|
||||||
linkVersion :: MonadThrow m => FilePath -> m Version
|
linkVersion :: MonadThrow m => FilePath -> m Version
|
||||||
linkVersion = throwEither . MP.parse parser "" . T.pack . dropSuffix exeExt
|
linkVersion = throwEither . MP.parse parser "" . T.pack . dropSuffix exeExt
|
||||||
@@ -1088,3 +1075,21 @@ ensureGlobalTools = do
|
|||||||
#else
|
#else
|
||||||
pure ()
|
pure ()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
-- | Ensure ghcup directory structure exists.
|
||||||
|
ensureDirectories :: Dirs -> IO ()
|
||||||
|
ensureDirectories dirs = do
|
||||||
|
let Dirs
|
||||||
|
{ baseDir
|
||||||
|
, binDir
|
||||||
|
, cacheDir
|
||||||
|
, logsDir
|
||||||
|
, confDir
|
||||||
|
} = dirs
|
||||||
|
createDirRecursive' baseDir
|
||||||
|
createDirRecursive' binDir
|
||||||
|
createDirRecursive' cacheDir
|
||||||
|
createDirRecursive' logsDir
|
||||||
|
createDirRecursive' confDir
|
||||||
|
pure ()
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ module GHCup.Utils.Dirs
|
|||||||
, parseGHCupGHCDir
|
, parseGHCupGHCDir
|
||||||
, relativeSymlink
|
, relativeSymlink
|
||||||
, withGHCupTmpDir
|
, withGHCupTmpDir
|
||||||
|
, getConfigFilePath
|
||||||
|
#if !defined(IS_WINDOWS)
|
||||||
|
, useXDG
|
||||||
|
#endif
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
@@ -47,14 +51,12 @@ import Data.Maybe
|
|||||||
import Data.String.Interpolate
|
import Data.String.Interpolate
|
||||||
import GHC.IO.Exception ( IOErrorType(NoSuchThing) )
|
import GHC.IO.Exception ( IOErrorType(NoSuchThing) )
|
||||||
import Haskus.Utils.Variant.Excepts
|
import Haskus.Utils.Variant.Excepts
|
||||||
#if !defined(IS_WINDOWS)
|
|
||||||
import Optics
|
import Optics
|
||||||
|
#if !defined(IS_WINDOWS)
|
||||||
import System.Directory
|
import System.Directory
|
||||||
#endif
|
#endif
|
||||||
import System.DiskSpace
|
import System.DiskSpace
|
||||||
#if !defined(IS_WINDOWS)
|
|
||||||
import System.Environment
|
import System.Environment
|
||||||
#endif
|
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import System.IO.Temp
|
import System.IO.Temp
|
||||||
|
|
||||||
@@ -78,7 +80,8 @@ import Control.Concurrent (threadDelay)
|
|||||||
ghcupBaseDir :: IO FilePath
|
ghcupBaseDir :: IO FilePath
|
||||||
ghcupBaseDir = do
|
ghcupBaseDir = do
|
||||||
#if defined(IS_WINDOWS)
|
#if defined(IS_WINDOWS)
|
||||||
pure ("C:\\" </> "ghcup")
|
bdir <- fromMaybe "C:\\" <$> lookupEnv "GHCUP_INSTALL_BASE_PREFIX"
|
||||||
|
pure (bdir </> "ghcup")
|
||||||
#else
|
#else
|
||||||
xdg <- useXDG
|
xdg <- useXDG
|
||||||
if xdg
|
if xdg
|
||||||
@@ -104,7 +107,7 @@ ghcupBaseDir = do
|
|||||||
ghcupConfigDir :: IO FilePath
|
ghcupConfigDir :: IO FilePath
|
||||||
ghcupConfigDir = do
|
ghcupConfigDir = do
|
||||||
#if defined(IS_WINDOWS)
|
#if defined(IS_WINDOWS)
|
||||||
pure ("C:\\" </> "ghcup")
|
ghcupBaseDir
|
||||||
#else
|
#else
|
||||||
xdg <- useXDG
|
xdg <- useXDG
|
||||||
if xdg
|
if xdg
|
||||||
@@ -129,7 +132,7 @@ ghcupConfigDir = do
|
|||||||
ghcupBinDir :: IO FilePath
|
ghcupBinDir :: IO FilePath
|
||||||
ghcupBinDir = do
|
ghcupBinDir = do
|
||||||
#if defined(IS_WINDOWS)
|
#if defined(IS_WINDOWS)
|
||||||
pure ("C:\\" </> "ghcup" </> "bin")
|
ghcupBaseDir <&> (</> "bin")
|
||||||
#else
|
#else
|
||||||
xdg <- useXDG
|
xdg <- useXDG
|
||||||
if xdg
|
if xdg
|
||||||
@@ -150,7 +153,7 @@ ghcupBinDir = do
|
|||||||
ghcupCacheDir :: IO FilePath
|
ghcupCacheDir :: IO FilePath
|
||||||
ghcupCacheDir = do
|
ghcupCacheDir = do
|
||||||
#if defined(IS_WINDOWS)
|
#if defined(IS_WINDOWS)
|
||||||
pure ("C:\\" </> "ghcup" </> "cache")
|
ghcupBaseDir <&> (</> "cache")
|
||||||
#else
|
#else
|
||||||
xdg <- useXDG
|
xdg <- useXDG
|
||||||
if xdg
|
if xdg
|
||||||
@@ -172,7 +175,7 @@ ghcupCacheDir = do
|
|||||||
ghcupLogsDir :: IO FilePath
|
ghcupLogsDir :: IO FilePath
|
||||||
ghcupLogsDir = do
|
ghcupLogsDir = do
|
||||||
#if defined(IS_WINDOWS)
|
#if defined(IS_WINDOWS)
|
||||||
pure ("C:\\" </> "ghcup" </> "logs")
|
ghcupBaseDir <&> (</> "logs")
|
||||||
#else
|
#else
|
||||||
xdg <- useXDG
|
xdg <- useXDG
|
||||||
if xdg
|
if xdg
|
||||||
@@ -202,13 +205,16 @@ getDirs = do
|
|||||||
--[ GHCup files ]--
|
--[ GHCup files ]--
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
getConfigFilePath :: (MonadIO m) => m FilePath
|
||||||
|
getConfigFilePath = do
|
||||||
|
confDir <- liftIO ghcupConfigDir
|
||||||
|
pure $ confDir </> "config.yaml"
|
||||||
|
|
||||||
ghcupConfigFile :: (MonadIO m)
|
ghcupConfigFile :: (MonadIO m)
|
||||||
=> Excepts '[JSONError] m UserSettings
|
=> Excepts '[JSONError] m UserSettings
|
||||||
ghcupConfigFile = do
|
ghcupConfigFile = do
|
||||||
confDir <- liftIO ghcupConfigDir
|
filepath <- getConfigFilePath
|
||||||
let file = confDir </> "config.yaml"
|
contents <- liftIO $ handleIO' NoSuchThing (\_ -> pure Nothing) $ Just <$> BS.readFile filepath
|
||||||
contents <- liftIO $ handleIO' NoSuchThing (\_ -> pure Nothing) $ Just <$> BS.readFile file
|
|
||||||
case contents of
|
case contents of
|
||||||
Nothing -> pure defaultUserSettings
|
Nothing -> pure defaultUserSettings
|
||||||
Just contents' -> lE' JSONDecodeError . first show . Y.decodeEither' $ contents'
|
Just contents' -> lE' JSONDecodeError . first show . Y.decodeEither' $ contents'
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import Control.Monad.IO.Class
|
|||||||
import Control.Monad.Logger
|
import Control.Monad.Logger
|
||||||
import Prelude hiding ( appendFile )
|
import Prelude hiding ( appendFile )
|
||||||
import System.Console.Pretty
|
import System.Console.Pretty
|
||||||
import System.Directory hiding ( findFiles )
|
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
import Text.Regex.Posix
|
import Text.Regex.Posix
|
||||||
@@ -70,7 +69,6 @@ initGHCupFileLogging :: (MonadIO m) => FilePath -> m FilePath
|
|||||||
initGHCupFileLogging logsDir = do
|
initGHCupFileLogging logsDir = do
|
||||||
let logfile = logsDir </> "ghcup.log"
|
let logfile = logsDir </> "ghcup.log"
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
createDirectoryIfMissing True logsDir
|
|
||||||
logFiles <- findFiles
|
logFiles <- findFiles
|
||||||
logsDir
|
logsDir
|
||||||
(makeRegexOpts compExtended
|
(makeRegexOpts compExtended
|
||||||
|
|||||||
@@ -190,14 +190,14 @@ hideError :: (MonadIO m, MonadCatch m) => IOErrorType -> m () -> m ()
|
|||||||
hideError err = handleIO (\e -> if err == ioeGetErrorType e then pure () else liftIO . ioError $ e)
|
hideError err = handleIO (\e -> if err == ioeGetErrorType e then pure () else liftIO . ioError $ e)
|
||||||
|
|
||||||
|
|
||||||
hideErrorDef :: [IOErrorType] -> a -> IO a -> IO a
|
hideErrorDef :: (MonadIO m, MonadCatch m) => [IOErrorType] -> a -> m a -> m a
|
||||||
hideErrorDef errs def =
|
hideErrorDef errs def =
|
||||||
handleIO (\e -> if ioeGetErrorType e `elem` errs then pure def else ioError e)
|
handleIO (\e -> if ioeGetErrorType e `elem` errs then pure def else liftIO $ ioError e)
|
||||||
|
|
||||||
|
|
||||||
hideErrorDefM :: [IOErrorType] -> IO a -> IO a -> IO a
|
hideErrorDefM :: (MonadIO m, MonadCatch m) => [IOErrorType] -> m a -> m a -> m a
|
||||||
hideErrorDefM errs def =
|
hideErrorDefM errs def =
|
||||||
handleIO (\e -> if ioeGetErrorType e `elem` errs then def else ioError e)
|
handleIO (\e -> if ioeGetErrorType e `elem` errs then def else liftIO $ ioError e)
|
||||||
|
|
||||||
|
|
||||||
-- TODO: does this work?
|
-- TODO: does this work?
|
||||||
@@ -334,37 +334,38 @@ copyDirectoryRecursive srcDir destDir = do
|
|||||||
in doCopy src dest
|
in doCopy src dest
|
||||||
| (srcBase, srcFile) <- srcFiles ]
|
| (srcBase, srcFile) <- srcFiles ]
|
||||||
|
|
||||||
-- | List all the files in a directory and all subdirectories.
|
|
||||||
--
|
-- | List all the files in a directory and all subdirectories.
|
||||||
-- The order places files in sub-directories after all the files in their
|
--
|
||||||
-- parent directories. The list is generated lazily so is not well defined if
|
-- The order places files in sub-directories after all the files in their
|
||||||
-- the source directory structure changes before the list is used.
|
-- parent directories. The list is generated lazily so is not well defined if
|
||||||
--
|
-- the source directory structure changes before the list is used.
|
||||||
getDirectoryContentsRecursive :: FilePath -> IO [FilePath]
|
--
|
||||||
getDirectoryContentsRecursive topdir = recurseDirectories [""]
|
getDirectoryContentsRecursive :: FilePath -> IO [FilePath]
|
||||||
|
getDirectoryContentsRecursive topdir = recurseDirectories [""]
|
||||||
|
where
|
||||||
|
recurseDirectories :: [FilePath] -> IO [FilePath]
|
||||||
|
recurseDirectories [] = return []
|
||||||
|
recurseDirectories (dir:dirs) = unsafeInterleaveIO $ do
|
||||||
|
(files, dirs') <- collect [] [] =<< getDirectoryContents (topdir </> dir)
|
||||||
|
files' <- recurseDirectories (dirs' ++ dirs)
|
||||||
|
return (files ++ files')
|
||||||
|
|
||||||
where
|
where
|
||||||
recurseDirectories :: [FilePath] -> IO [FilePath]
|
collect files dirs' [] = return (reverse files
|
||||||
recurseDirectories [] = return []
|
,reverse dirs')
|
||||||
recurseDirectories (dir:dirs) = unsafeInterleaveIO $ do
|
collect files dirs' (entry:entries) | ignore entry
|
||||||
(files, dirs') <- collect [] [] =<< getDirectoryContents (topdir </> dir)
|
= collect files dirs' entries
|
||||||
files' <- recurseDirectories (dirs' ++ dirs)
|
collect files dirs' (entry:entries) = do
|
||||||
return (files ++ files')
|
let dirEntry = dir </> entry
|
||||||
|
isDirectory <- doesDirectoryExist (topdir </> dirEntry)
|
||||||
|
if isDirectory
|
||||||
|
then collect files (dirEntry:dirs') entries
|
||||||
|
else collect (dirEntry:files) dirs' entries
|
||||||
|
|
||||||
where
|
ignore ['.'] = True
|
||||||
collect files dirs' [] = return (reverse files
|
ignore ['.', '.'] = True
|
||||||
,reverse dirs')
|
ignore _ = False
|
||||||
collect files dirs' (entry:entries) | ignore entry
|
|
||||||
= collect files dirs' entries
|
|
||||||
collect files dirs' (entry:entries) = do
|
|
||||||
let dirEntry = dir </> entry
|
|
||||||
isDirectory <- doesDirectoryExist (topdir </> dirEntry)
|
|
||||||
if isDirectory
|
|
||||||
then collect files (dirEntry:dirs') entries
|
|
||||||
else collect (dirEntry:files) dirs' entries
|
|
||||||
|
|
||||||
ignore ['.'] = True
|
|
||||||
ignore ['.', '.'] = True
|
|
||||||
ignore _ = False
|
|
||||||
|
|
||||||
-- https://github.com/haskell/directory/issues/110
|
-- https://github.com/haskell/directory/issues/110
|
||||||
-- https://github.com/haskell/directory/issues/96
|
-- https://github.com/haskell/directory/issues/96
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ extra-deps:
|
|||||||
- hspec-core-2.7.10@sha256:2aba6ea126442b29e8183ab27f1c811706b19b1d83b02f193a896f6fc1589d13,4621
|
- hspec-core-2.7.10@sha256:2aba6ea126442b29e8183ab27f1c811706b19b1d83b02f193a896f6fc1589d13,4621
|
||||||
- hspec-discover-2.7.10@sha256:d08bf5dd785629f589571477d9beb7cd91529471bd89f39517c1cb4b9b38160f,2184
|
- hspec-discover-2.7.10@sha256:d08bf5dd785629f589571477d9beb7cd91529471bd89f39517c1cb4b9b38160f,2184
|
||||||
- hspec-golden-aeson-0.9.0.0@sha256:aa17274114026661ba4dfc9c60c230673c8f408bd86482fd611d2d5cb6aff996,2179
|
- hspec-golden-aeson-0.9.0.0@sha256:aa17274114026661ba4dfc9c60c230673c8f408bd86482fd611d2d5cb6aff996,2179
|
||||||
- lzma-static-5.2.5.2@sha256:ac38dcad9ab423342a72ba48415bd75f62234e9c9e11831495b75603b5a060f6,7184
|
|
||||||
- libarchive-3.0.2.1@sha256:40ebf2a278e585802427bc58826867208bb33822f63d56107a1fcc3ca04d691d,10990
|
- libarchive-3.0.2.1@sha256:40ebf2a278e585802427bc58826867208bb33822f63d56107a1fcc3ca04d691d,10990
|
||||||
|
- lzma-static-5.2.5.3@sha256:2758ee58c35992fcf7db78e98684c357a16a82fa2a4e7c352a6c210c08c555d8,7308
|
||||||
- os-release-1.0.1@sha256:1281c62081f438fc3f0874d3bae6a4887d5964ac25261ba06e29d368ab173467,2716
|
- os-release-1.0.1@sha256:1281c62081f438fc3f0874d3bae6a4887d5964ac25261ba06e29d368ab173467,2716
|
||||||
- primitive-0.7.0.1@sha256:a381571c36edc7dca28b77fe8159b43c14c640087ec5946adacf949feec64231,3433
|
- primitive-0.7.0.1@sha256:a381571c36edc7dca28b77fe8159b43c14c640087ec5946adacf949feec64231,3433
|
||||||
- regex-posix-clib-2.7
|
- regex-posix-clib-2.7
|
||||||
|
|||||||
@@ -132,13 +132,17 @@ hr {
|
|||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#platform-instructions-linux > div > pre,
|
span.code {
|
||||||
#platform-instructions-mac > div > pre,
|
font-family: 'Lucida Console', monospace;
|
||||||
#platform-instructions-freebsd > div > pre,
|
}
|
||||||
#platform-instructions-win32 > div > pre,
|
|
||||||
#platform-instructions-win64 > div > pre,
|
#platform-instructions-linux div > pre,
|
||||||
#platform-instructions-default > div > div > pre,
|
#platform-instructions-mac div > pre,
|
||||||
#platform-instructions-unknown > div > div > pre {
|
#platform-instructions-freebsd div > pre,
|
||||||
|
#platform-instructions-win32 div > pre,
|
||||||
|
#platform-instructions-win64 div > pre,
|
||||||
|
#platform-instructions-default div > div > pre,
|
||||||
|
#platform-instructions-unknown div > div > pre {
|
||||||
background-color: #515151;
|
background-color: #515151;
|
||||||
color: white;
|
color: white;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ function copyToClipboard() {
|
|||||||
document.body.removeChild(el);
|
document.body.removeChild(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyToClipboardSilicon() {
|
function copyToClipboardPowershell() {
|
||||||
const text = document.getElementById("ghcup-command-silicon").innerText;
|
const text = document.getElementById("ghcup-command-powershell").innerText;
|
||||||
const el = document.createElement('textarea');
|
const el = document.createElement('textarea');
|
||||||
el.value = text;
|
el.value = text;
|
||||||
document.body.appendChild(el);
|
document.body.appendChild(el);
|
||||||
|
|||||||
@@ -14,13 +14,12 @@
|
|||||||
|
|
||||||
<body id="idx">
|
<body id="idx">
|
||||||
|
|
||||||
<script id='html-content' type="text/html">
|
|
||||||
<a id="platform-button" style="display: none;" href="#">
|
<a id="platform-button" style="display: none;" href="#">
|
||||||
click or press "n" to cycle platforms
|
click or press "n" to cycle platforms
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p id="pitch">
|
<p id="pitch">
|
||||||
<em>ghcup</em> is the main installer for<br/>
|
<em>ghcup</em> is an installer for<br/>
|
||||||
the general purpose language <a href="https://www.haskell.org/">Haskell</a>
|
the general purpose language <a href="https://www.haskell.org/">Haskell</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -32,10 +31,7 @@
|
|||||||
|
|
||||||
<div id="platform-instructions-mac" class="instructions" style="display: none;">
|
<div id="platform-instructions-mac" class="instructions" style="display: none;">
|
||||||
<p>Run the following in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
<p>Run the following in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
<p>On Intel:</p>
|
|
||||||
<div class="command-button"><pre><span class='ghcup-command' id="ghcup-command-normal">curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
<div class="command-button"><pre><span class='ghcup-command' id="ghcup-command-normal">curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
<p>On Apple Silicon:</p>
|
|
||||||
<div class="command-button"><pre><span class='ghcup-command' id="ghcup-command-silicon">curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -x86_64 /bin/bash</span></pre><button class="tooltip" onclick="copyToClipboardSilicon()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
|
||||||
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.<br/>You appear to be running macOS. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.<br/>You appear to be running macOS. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -47,24 +43,41 @@
|
|||||||
|
|
||||||
<div id="platform-instructions-win32" class="instructions">
|
<div id="platform-instructions-win32" class="instructions">
|
||||||
<p>
|
<p>
|
||||||
To install Haskell, follow the instructions on
|
To install Haskell,<br/>run the following in a powershell session (as a non-admin user).
|
||||||
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
<div>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command' id="ghcup-command-powershell">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</span></span></pre><button class="tooltip" onclick="copyToClipboardPowershell()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button>
|
||||||
|
</div>
|
||||||
|
<p class="other-help">If you want to run an interactive installation, change <span class='code'>$false</span> to <span class='code'>$true</span> at the end of the script.</p>
|
||||||
|
</div>
|
||||||
<p>If you're a Windows Subsystem 2 for Linux user run the following in your terminal, then follow the onscreen instructions to install Haskell.
|
<p>If you're a Windows Subsystem 2 for Linux user run the following in your terminal, then follow the onscreen instructions to install Haskell.
|
||||||
</p>
|
</p>
|
||||||
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
<div>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button>
|
||||||
|
</div>
|
||||||
|
<p class="other-help">WSL1 does not work with ghcup, follow <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">the instructions here</a> to upgrade to WSL2 if needed.</p>
|
||||||
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<p class="other-help">WSL1 does not work with ghcup, follow <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">the instructions here</a> to upgrade to WSL2 if needed.</br>You appear to be running Windows 32-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
<hr/>
|
||||||
|
<p class="other-help">You appear to be running Windows 32-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="platform-instructions-win64" class="instructions" style="display: none;">
|
<div id="platform-instructions-win64" class="instructions" style="display: none;">
|
||||||
<p>
|
<p>
|
||||||
To install Haskell, follow the instructions on
|
To install Haskell,<br/>run the following in a powershell session (as a non-admin user).
|
||||||
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
<div>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command'>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</span></span></pre><button class="tooltip" onclick="copyToClipboardPowershell()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button>
|
||||||
|
</div>
|
||||||
|
<p class="other-help">If you want to run an interactive installation, change <span class='code'>$false</span> to <span class='code'>$true</span> at the end of the script.</p>
|
||||||
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<p>If you're a Windows Subsystem 2 for Linux user run the following in your terminal, then follow the onscreen instructions to install Haskell.
|
<p>If you're a Windows Subsystem 2 for Linux user run the following in your terminal, then follow the onscreen instructions to install Haskell.
|
||||||
</p>
|
</p>
|
||||||
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
<div>
|
||||||
<p class="other-help">WSL1 does not work with ghcup, follow <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">the instructions here</a> to upgrade to WSL2 if needed.</br>You appear to be running Windows 64-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button>
|
||||||
|
</div>
|
||||||
|
<p class="other-help">WSL1 does not work with ghcup, follow <a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">the instructions here</a> to upgrade to WSL2 if needed.</p>
|
||||||
|
</div>
|
||||||
|
<p class="other-help">You appear to be running Windows 64-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="platform-instructions-unknown" class="instructions" style="display: none;">
|
<div id="platform-instructions-unknown" class="instructions" style="display: none;">
|
||||||
@@ -95,8 +108,8 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
If you are running Windows,<br/>follow the instructions on
|
If you are running Windows,<br/>run the following in a powershell session (as a non-admin user).
|
||||||
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
<div class="command-button"><pre><span class='ghcup-command'>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</span></span></pre><button class="tooltip" onclick="copyToClipboardPowershell()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -104,11 +117,9 @@
|
|||||||
|
|
||||||
<div id="platform-instructions-default" class="instructions">
|
<div id="platform-instructions-default" class="instructions">
|
||||||
<div>
|
<div>
|
||||||
<p>To install Haskell, if you are running Linux, macOS (on Intel), FreeBSD or Windows Subsystem 2 for Linux, run the following
|
<p>To install Haskell, if you are running Linux, macOS, FreeBSD or Windows Subsystem 2 for Linux, run the following
|
||||||
in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
<p>For macOS on Apple Silicon, run this instead:</p>
|
|
||||||
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -x86_64 /bin/bash</span></pre><button class="tooltip" onclick="copyToClipboardSilicon()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
|
||||||
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.</p>
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -116,8 +127,8 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
If you are running Windows,<br/>follow the instructions on
|
If you are running Windows,<br/>run the following in a powershell session (as a non-admin user).
|
||||||
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
<div class="command-button"><pre><span class='ghcup-command'>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</span></span></pre><button class="tooltip" onclick="copyToClipboardPowershell()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -137,54 +148,7 @@
|
|||||||
·
|
·
|
||||||
<a href="https://github.com/rust-lang/rustup.rs/tree/master/www">web design from rustup</a>
|
<a href="https://github.com/rust-lang/rustup.rs/tree/master/www">web design from rustup</a>
|
||||||
</p>
|
</p>
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
document.write(document.getElementById("html-content").innerHTML);
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="ghcup.js"></script>
|
<script type="text/javascript" src="ghcup.js"></script>
|
||||||
|
|
||||||
<noscript>
|
|
||||||
<p id="pitch">
|
|
||||||
<em>ghcup</em> is the main installer for<br/>
|
|
||||||
the general purpose language <a href="https://www.haskell.org/">Haskell</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div id="platform-instructions-default" class="instructions">
|
|
||||||
<div>
|
|
||||||
<p>To install Haskell, if you are running Linux, macOS (on Intel), FreeBSD or Windows Subsystem for Linux 2, run the following
|
|
||||||
in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
|
||||||
<pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre>
|
|
||||||
<p>For macOS on Apple Silicon, run this instead:</p>
|
|
||||||
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -x86_64 /bin/bash</span></pre><button class="tooltip" onclick="copyToClipboardSilicon()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
|
||||||
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<p>
|
|
||||||
If you are running Windows,<br/>follow the instructions on
|
|
||||||
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Need help? Ask on <a href="https://kiwiirc.com/nextclient/irc.libera.chat/#haskell-ghcup">#haskell-ghcup</a>, <a href="https://kiwiirc.com/nextclient/irc.libera.chat/#haskell">#haskell</a> or <a href="https://gitlab.haskell.org/haskell/ghcup-hs/issues">report a bug</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p id="about">
|
|
||||||
<img src="haskell-logo.svg" alt="" />
|
|
||||||
ghcup is a haskell.org hosted project.
|
|
||||||
<br/>
|
|
||||||
<a href="https://www.haskell.org/downloads/">other installation options</a>
|
|
||||||
·
|
|
||||||
<a href="https://gitlab.haskell.org/haskell/ghcup-hs">about ghcup</a>
|
|
||||||
·
|
|
||||||
<a href="https://github.com/rust-lang/rustup.rs/tree/master/www">web design from rustup</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</noscript>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user