Compare commits

..

19 Commits

Author SHA1 Message Date
1e9ee260e7 Raise minSpace to 5GB 2021-04-25 21:32:58 +02:00
0b7d447aaf Satisfy hlint 2021-04-25 18:00:32 +02:00
16a9336d31 Fix missing pretty instance 2021-04-25 17:59:15 +02:00
7d13836fea Warn when /tmp doesn't have 2500 or more of disk space 2021-04-25 17:25:40 +02:00
b645c4d57e Add date to GHC bindist names created by ghcup 2021-04-24 21:51:43 +02:00
5db43cd908 Improve error printing in ghcup-gen 2021-04-24 21:51:06 +02:00
93cd421ca3 Add 9.1.1 alpha2 2021-04-23 09:43:45 +02:00
ec7130dac6 Add post-install msg to ghc-7.10.3 wrt no-pie, fixes #123 2021-04-17 19:53:18 +02:00
f2b8cc530c Fix download URL 2021-04-13 23:58:49 +02:00
de765088d1 Merge remote-tracking branch 'origin/merge-requests/83' 2021-04-13 23:47:16 +02:00
jneira
e11188aa99 Update haskell-language-server to 1.1.0 2021-04-13 23:38:27 +02:00
0c6699c3c6 Allow to check ghcup binaries in validate-tarballs 2021-04-11 22:15:43 +02:00
c5858be6b8 Update ghcup binaries 2021-04-11 22:10:44 +02:00
ffe00c7b1f Fix travis 2021-04-11 19:16:45 +02:00
43114959fd Fix release job 2021-04-11 19:12:55 +02:00
b1c3ffd729 Update ghcup.cabal 2021-04-11 18:14:52 +02:00
4f1a9e95a2 Add stuff to extra-doc-files 2021-04-11 18:08:31 +02:00
f6a4f55384 Release 0.1.14.1 2021-04-11 18:01:31 +02:00
672b179446 Merge branch 'lzma-static' 2021-04-11 17:58:03 +02:00
11 changed files with 176 additions and 89 deletions

View File

@@ -15,6 +15,11 @@ git describe
# build # build
ecabal update ecabal update
(
cd /tmp
ecabal install -w ghc-${GHC_VERSION} --installdir="$CI_PROJECT_DIR"/.local/bin hspec-discover
)
if [ "${OS}" = "LINUX" ] ; then if [ "${OS}" = "LINUX" ] ; then
if [ "${ARCH}" = "32" ] ; then if [ "${ARCH}" = "32" ] ; then
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static' -ftui -ftar ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static' -ftui -ftar

View File

@@ -16,6 +16,12 @@ ghcup set 8.10.4
## install ghcup ## install ghcup
cabal update cabal update
(
cd /tmp
cabal install --installdir="$HOME"/.ghcup/bin hspec-discover
)
cabal build --constraint="zlib +static" --constraint="lzma +static" -ftui cabal build --constraint="zlib +static" --constraint="lzma +static" -ftui
cp "$(cabal new-exec --verbose=0 --offline sh -- -c 'command -v ghcup')" . cp "$(cabal new-exec --verbose=0 --offline sh -- -c 'command -v ghcup')" .
strip ./ghcup strip ./ghcup

View File

@@ -1,5 +1,10 @@
# Revision history for ghcup # Revision history for ghcup
## 0.1.14.1 -- 2021-04-11
* Make internal symlink target parser more lax, fixes [#119](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/119)
* Prepare for hackage release
## 0.1.14 -- 2021-03-07 ## 0.1.14 -- 2021-03-07
* Major bugfix: fix handling of stray versions wrt [#116](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/116) * Major bugfix: fix handling of stray versions wrt [#116](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/116)

View File

@@ -37,7 +37,7 @@ import Data.IORef
import Data.List import Data.List
import Data.String.Interpolate import Data.String.Interpolate
import Data.Versions import Data.Versions
import HPath ( toFilePath ) import HPath ( toFilePath, rel )
import Haskus.Utils.Variant.Excepts import Haskus.Utils.Variant.Excepts
import Optics import Optics
import System.Exit import System.Exit
@@ -202,6 +202,7 @@ validateTarballs (TarballFilter tool versionRegex) dls = do
%& indices (matchTest versionRegex . T.unpack . prettyVer) %& indices (matchTest versionRegex . T.unpack . prettyVer)
% (viSourceDL % _Just `summing` viArch % each % each % each) % (viSourceDL % _Just `summing` viArch % each % each % each)
when (null dlis) $ $(logError) [i|no tarballs selected by filter|] *> addError when (null dlis) $ $(logError) [i|no tarballs selected by filter|] *> addError
forM_ dlis downloadAll forM_ dlis downloadAll
-- exit -- exit
@@ -235,13 +236,21 @@ validateTarballs (TarballFilter tool versionRegex) dls = do
#endif #endif
] ]
$ do $ do
p <- liftE $ downloadCached dli Nothing case tool of
fmap (head . splitDirectories . head) Just GHCup -> do
. liftE let fn = [rel|ghcup|]
. getArchiveFiles dir <- liftIO ghcupCacheDir
$ p p <- liftE $ download dli dir (Just fn)
liftE $ checkDigest dli p
pure Nothing
_ -> do
p <- liftE $ downloadCached dli Nothing
fmap (Just . head . splitDirectories . head)
. liftE
. getArchiveFiles
$ p
case r of case r of
VRight basePath -> do VRight (Just basePath) -> do
case _dlSubdir dli of case _dlSubdir dli of
Just (RealDir (toFilePath -> prel)) -> do Just (RealDir (toFilePath -> prel)) -> do
lift $ $(logInfo) lift $ $(logInfo)
@@ -262,7 +271,8 @@ validateTarballs (TarballFilter tool versionRegex) dls = do
[i|Subdir doesn't match: expected regex "#{regexString}", got "#{basePath}"|] [i|Subdir doesn't match: expected regex "#{regexString}", got "#{basePath}"|]
addError addError
Nothing -> pure () Nothing -> pure ()
VRight Nothing -> pure ()
VLeft e -> do VLeft e -> do
lift $ $(logError) lift $ $(logError)
[i|Could not download (or verify hash) of #{dli}, Error was: #{e}|] [i|Could not download (or verify hash) of #{dli}, Error was: #{prettyShow e}|]
addError addError

View File

@@ -69,7 +69,7 @@ _done() {
download_ghcup() { download_ghcup() {
_plat="$(uname -s)" _plat="$(uname -s)"
_arch=$(uname -m) _arch=$(uname -m)
_ghver="0.1.14" _ghver="0.1.14.1"
_base_url="https://downloads.haskell.org/~ghcup" _base_url="https://downloads.haskell.org/~ghcup"
case "${_plat}" in case "${_plat}" in

View File

@@ -139,6 +139,7 @@ ghcupDownloads:
dlSubdir: ghc-7.10.3 dlSubdir: ghc-7.10.3
dlHash: cf90cedce1c28fd0e2b9e72fe8a938756668d18ea1fcc884a19f698658ac4fef dlHash: cf90cedce1c28fd0e2b9e72fe8a938756668d18ea1fcc884a19f698658ac4fef
viPostRemove: &ghc-post-remove "After removing GHC you might also want to clean up your cabal store at: ~/.cabal/store/ghc-<ghcver>" viPostRemove: &ghc-post-remove "After removing GHC you might also want to clean up your cabal store at: ~/.cabal/store/ghc-<ghcver>"
viPostInstall: "GHC-7.10.3 may give linking errors on most modern distros. You may have to pass '--ghc-option=-optc-no-pie --ghc-option=-optl-no-pie' to cabal build/install. Also see https://gitlab.haskell.org/ghc/ghc/-/issues/18763"
viArch: viArch:
A_64: A_64:
Linux_Debian: Linux_Debian:
@@ -1553,86 +1554,91 @@ ghcupDownloads:
dlUri: https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-armv7-deb9-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-armv7-deb9-linux.tar.xz
dlSubdir: ghc-9.0.1 dlSubdir: ghc-9.0.1
dlHash: 6f404f9b88468407b3a9ec5800bcc2d01dd453ef3d63414853b4fbbd4d8df496 dlHash: 6f404f9b88468407b3a9ec5800bcc2d01dd453ef3d63414853b4fbbd4d8df496
9.2.0.20210331: 9.2.0.20210422:
viTags: viTags:
- Prerelease - Prerelease
- base-4.16.0.0 - base-4.16.0.0
viChangeLog: https://downloads.haskell.org/~ghc/9.2.1-alpha1/docs/html/users_guide/9.2.1-notes.html viChangeLog: https://downloads.haskell.org/~ghc/9.2.1-alpha2/docs/html/users_guide/index.html
viSourceDL: viSourceDL:
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-src.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-src.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: 3ec8ec2fb77e14d68ac1c092f3e8605b6822e24f7e6dc7139dccf8feaf168699 dlHash: 69be189e6e7f8d51a9078ac8f177176bc5bff54edc8352974c50c1f0e110df27
viPostRemove: *ghc-post-remove viPostRemove: *ghc-post-remove
viArch: viArch:
A_64: A_64:
Linux_Debian: Linux_Debian:
'( >= 9 && < 10 )': &ghc-921-alpha1-64-deb9 '( >= 9 && < 10 )': &ghc-921-alpha2-64-deb9
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-x86_64-deb9-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-deb9-linux.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: c13613cb6285a689c5b89c93fad5c6c0e95d66c8936338c44d92a1312f507006 dlHash: 7262f3a230cd6945c588882e03941301877a9eb12e58c5975ad264596c2e12f2
'( >= 10 && < 11 )': &ghc-921-alpha1-64-deb10 '( >= 10 && < 11 )': &ghc-921-alpha2-64-deb10
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-x86_64-deb10-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-deb10-linux.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: 2b2a0e2bad54d1a41440c093a199207b58ff314bea7edf73387916e9952d6a53 dlHash: 6d36cd08576bdee7473fee66b4b8ceb72011983a7d5aa3ec587403815a73e37b
unknown_versioning: *ghc-921-alpha1-64-deb9 unknown_versioning: *ghc-921-alpha2-64-deb9
Linux_Ubuntu: Linux_Ubuntu:
unknown_versioning: &ghc-921-alpha1-64-fedora unknown_versioning: &ghc-921-alpha2-64-fedora
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-x86_64-fedora27-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-fedora27-linux.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: c7e648ac313c268aaa3a9651b00650da6eb293abfe14e44f44da22a758c233e7 dlHash: 95624192ff0982690bc9093632d6351fdc6f72e6df380b392449229c39a0354b
'( >= 16 && < 19 )': *ghc-921-alpha1-64-deb9 '( >= 16 && < 19 )': *ghc-921-alpha2-64-deb9
Linux_Mint: Linux_Mint:
unknown_versioning: *ghc-921-alpha1-64-deb10 unknown_versioning: *ghc-921-alpha2-64-deb10
Linux_Fedora: Linux_Fedora:
'( >= 27 && < 28 )': *ghc-921-alpha1-64-fedora '( >= 27 && < 28 )': *ghc-921-alpha2-64-fedora
unknown_versioning: *ghc-921-alpha1-64-fedora unknown_versioning: *ghc-921-alpha2-64-fedora
Linux_CentOS: Linux_CentOS:
'( >= 7 && < 8 )': &ghc-921-alpha1-64-centos '( >= 7 && < 8 )': &ghc-921-alpha2-64-centos
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-x86_64-centos7-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-centos7-linux.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: 50556cc42be665957f2bd8e5deeceb26e58e88badfa0c99a44117fda2d63200c dlHash: dee4f158f2d59bfe97ec3f5773b6b31aa911f9b128a5e56eeefa2dccc754d295
unknown_versioning: *ghc-921-alpha1-64-centos unknown_versioning: *ghc-921-alpha2-64-centos
Linux_RedHat: Linux_RedHat:
unknown_versioning: *ghc-921-alpha1-64-centos unknown_versioning: *ghc-921-alpha2-64-centos
Linux_Alpine: Linux_Alpine:
unknown_versioning: unknown_versioning:
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-x86_64-alpine3.10-linux-integer-simple.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-alpine3.10-linux-integer-simple.tar.xz
dlSubdir: ghc-9.2.0.20210331-x86_64-unknown-linux dlSubdir: ghc-9.2.0.20210422-x86_64-unknown-linux
dlHash: bab5f5d0ecd6522da372a9a0f0eeebbbecf0bd94788847aa3cd5bdb36682d48a dlHash: f61ae72925325ca7b316e40121e8d6bad94794016d3fa59bcbc8dbe116a7f13c
Linux_AmazonLinux: Linux_AmazonLinux:
unknown_versioning: *ghc-921-alpha1-64-centos unknown_versioning: *ghc-921-alpha2-64-centos
Linux_UnknownLinux: Linux_UnknownLinux:
unknown_versioning: *ghc-921-alpha1-64-fedora unknown_versioning: *ghc-921-alpha2-64-fedora
FreeBSD:
unknown_versioning:
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-unknown-freebsd.tar.xz
dlSubdir: ghc-9.2.0.20210422
dlHash: 195728e02398ea6154fe713b7782a0cae856eb0d9d90f5d09cd0cca610c985e2
Darwin: Darwin:
unknown_versioning: unknown_versioning:
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-x86_64-apple-darwin.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-apple-darwin.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: cfd7d0479ce80607c11cf96fe25d4804783c6ebc623ca9adcb5436e3499c9c5b dlHash: 8884c059f2b76e4c4309ff6bd7a7dde37663f751fd26220e9a2bcabb4d69a401
A_32: A_32:
Linux_Debian: Linux_Debian:
'( >= 9 && < 10 )': &ghc-921-alpha1-32-deb9 '( >= 9 && < 10 )': &ghc-921-alpha2-32-deb9
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-i386-deb9-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-i386-deb9-linux.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: 58ccac8e89e60b4261dfa8ca0e17d335b99f2a1fecb90322436cfea3bdce2240 dlHash: a378ec3fd31a9fa2a7134e98159e189362fe969f04031515616e9cc3182c861a
unknown_versioning: *ghc-921-alpha1-32-deb9 unknown_versioning: *ghc-921-alpha2-32-deb9
Linux_Ubuntu: Linux_Ubuntu:
unknown_versioning: *ghc-921-alpha1-32-deb9 unknown_versioning: *ghc-921-alpha2-32-deb9
Linux_Mint: Linux_Mint:
unknown_versioning: *ghc-921-alpha1-32-deb9 unknown_versioning: *ghc-921-alpha2-32-deb9
Linux_UnknownLinux: Linux_UnknownLinux:
unknown_versioning: *ghc-921-alpha1-32-deb9 unknown_versioning: *ghc-921-alpha2-32-deb9
A_ARM64: A_ARM64:
Linux_UnknownLinux: Linux_UnknownLinux:
unknown_versioning: unknown_versioning:
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-aarch64-deb10-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-aarch64-deb10-linux.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: df355e1ed34cf0fef11444299020041f03d6c67f6c5c342db1f76b71fd31e6fe dlHash: fd2f4d0f6122f752aca396fe1a13e7d14d037dc45806bb0404a031eeeeb1994c
A_ARM: A_ARM:
Linux_UnknownLinux: Linux_UnknownLinux:
unknown_versioning: unknown_versioning:
dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha1/ghc-9.2.0.20210331-armv7-deb10-linux.tar.xz dlUri: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-armv7-deb10-linux.tar.xz
dlSubdir: ghc-9.2.0.20210331 dlSubdir: ghc-9.2.0.20210422
dlHash: 2c5133fb83943371ad8556328db4acb9081271b7c77ceaf2b74817dd0de3b486 dlHash: dab7d7785d6ccafb130526b666669fc974ba5c90fc9aaf2024f9c65bcbd097d3
Cabal: Cabal:
2.4.1.0: 2.4.1.0:
viTags: viTags:
@@ -1773,7 +1779,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: 0.1.14.1:
viTags: viTags:
- Recommended - Recommended
- Latest - Latest
@@ -1783,51 +1789,51 @@ 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/x86_64-linux-ghcup-0.1.14 dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-linux-ghcup-0.1.14.1
dlHash: e9b314d248f4d4604ce64cee1be7161c77c8940efd11986c9205779ec3b598dd dlHash: 59e31b2ede3ed20f79dce0f8ba0a68b6fb25e5f00ba2d7243f6a8af68d979ff5
Darwin: Darwin:
unknown_versioning: unknown_versioning:
dlUri: https://downloads.haskell.org/~ghcup/0.1.14/x86_64-apple-darwin-ghcup-0.1.14 dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-apple-darwin-ghcup-0.1.14.1
dlHash: 69ede9db36c0ae631b679fceb87dd856d4753ee26f33610da37dd7a694809919 dlHash: 3e1dd173b3e7b5d90dcdece423c3ddd3efb4c83e964967b0fb574c9b7b2c44e1
FreeBSD: FreeBSD:
unknown_versioning: unknown_versioning:
dlUri: https://downloads.haskell.org/~ghcup/0.1.14/x86_64-portbld-freebsd-ghcup-0.1.14 dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/x86_64-portbld-freebsd-ghcup-0.1.14.1
dlHash: 68b09404cf49061da539463f42f8ad67c9cef5c5d3f68a3c7c4f6760e8442bb9 dlHash: 89a70980d77888dae8b9fd0f05e7a7920f421bc3bb5192da8e73fd4e7b4cb86f
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/i386-linux-ghcup-0.1.14 dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/i386-linux-ghcup-0.1.14.1
dlHash: ecb1157f010d2421764c52ab0cdbbf9a5c3da555827172c7b904d5f3f96c80fa dlHash: 610aac7c3be3ba3874c07b9cae5b2ca0da9a92bf381afc2597bd2dc9c70aae0c
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/aarch64-linux-ghcup-0.1.14 dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/aarch64-linux-ghcup-0.1.14.1
dlHash: 78a15f8a03917a89b67536af0993d7526d2722248a3a5cd8c500adffd7cd7691 dlHash: e9ae07b7d41ea03e6af9c1f3587f61287827c4e29478b6a5d46ea1ce5af4cee5
A_ARM: A_ARM:
Linux_UnknownLinux: Linux_UnknownLinux:
unknown_versioning: unknown_versioning:
dlUri: https://downloads.haskell.org/~ghcup/0.1.14/armv7-linux-ghcup-0.1.14 dlUri: https://downloads.haskell.org/~ghcup/0.1.14.1/armv7-linux-ghcup-0.1.14.1
dlHash: 5484dc9e16553c3d1707a9f83404c3c795dc01d01ef998cf173caf960abe793b dlHash: 646832030efbc0a848df24c08b5eb7507bd15d1c2eb95fea6d9d03890f3662be
HLS: HLS:
1.0.0: 1.1.0:
viTags: viTags:
- Recommended - Recommended
- Latest - Latest
viChangeLog: https://github.com/haskell/haskell-language-server/blob/master/ChangeLog.md#100 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:
A_64: A_64:
Linux_UnknownLinux: Linux_UnknownLinux:
unknown_versioning: &hls-64 unknown_versioning: &hls-64
dlUri: https://github.com/haskell/haskell-language-server/releases/download/1.0.0/haskell-language-server-Linux-1.0.0.tar.gz dlUri: https://github.com/haskell/haskell-language-server/releases/download/1.1.0/haskell-language-server-Linux-1.1.0.tar.gz
dlHash: 4fab18998c5f67118a26b75b059f3b3e2ad345b6325515a552d1a24cdf87ed3f dlHash: 0f0dadb0e9a08273658f565fd71c636801959b954be2737f38f2a1aac522208f
Darwin: Darwin:
unknown_versioning: unknown_versioning:
dlUri: https://github.com/haskell/haskell-language-server/releases/download/1.0.0/haskell-language-server-macOS-1.0.0.tar.gz dlUri: https://github.com/haskell/haskell-language-server/releases/download/1.1.0/haskell-language-server-macOS-1.1.0.tar.gz
dlHash: 74e7624c889c0235f0b02d7e7f164d5eb95b611d584fc8602f0b3a099b73f8be dlHash: 4e89b192e2f49637d772e974f2c17b16da067ecd5912575eaa542551de97681b
Linux_Alpine: Linux_Alpine:
unknown_versioning: *hls-64 unknown_versioning: *hls-64

View File

@@ -1,6 +1,6 @@
cabal-version: 3.0 cabal-version: 3.0
name: ghcup name: ghcup
version: 0.1.14 version: 0.1.14.1
license: LGPL-3.0-only license: LGPL-3.0-only
license-file: LICENSE license-file: LICENSE
copyright: Julian Ospald 2020 copyright: Julian Ospald 2020
@@ -8,14 +8,20 @@ maintainer: hasufell@posteo.de
author: Julian Ospald author: Julian Ospald
homepage: https://gitlab.haskell.org/haskell/ghcup-hs homepage: https://gitlab.haskell.org/haskell/ghcup-hs
bug-reports: https://gitlab.haskell.org/haskell/ghcup-hs/issues bug-reports: https://gitlab.haskell.org/haskell/ghcup-hs/issues
synopsis: ghc toolchain installer as an exe/library synopsis: ghc toolchain installer
description: description:
A rewrite of the shell script ghcup, for providing A rewrite of the shell script ghcup, for providing
a more stable user experience and exposing an API. a more stable user experience and exposing an API.
category: System category: System
build-type: Simple build-type: Simple
extra-doc-files: CHANGELOG.md extra-doc-files:
CHANGELOG.md
config.yaml
ghcup-0.0.4.yaml
HACKING.md
README.md
RELEASING.md
source-repository head source-repository head
type: git type: git
@@ -91,6 +97,7 @@ library
, concurrent-output ^>=1.10.11 , concurrent-output ^>=1.10.11
, containers ^>=0.6 , containers ^>=0.6
, cryptohash-sha256 ^>=0.11.101.0 , cryptohash-sha256 ^>=0.11.101.0
, disk-free-space ^>=0.1.0.1
, 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
@@ -125,6 +132,7 @@ library
, transformers ^>=0.5 , transformers ^>=0.5
, unix ^>=2.7 , unix ^>=2.7
, unix-bytestring ^>=0.3 , unix-bytestring ^>=0.3
, unliftio-core ^>=0.2.0.1
, unordered-containers ^>=0.2.10.0 , unordered-containers ^>=0.2.10.0
, uri-bytestring ^>=0.3.2.2 , uri-bytestring ^>=0.3.2.2
, utf8-string ^>=1.0 , utf8-string ^>=1.0

View File

@@ -61,6 +61,8 @@ import Data.List
import Data.Maybe import Data.Maybe
import Data.String.Interpolate import Data.String.Interpolate
import Data.Text ( Text ) import Data.Text ( Text )
import Data.Time.Clock
import Data.Time.Format.ISO8601
import Data.Versions import Data.Versions
import Data.Word8 import Data.Word8
import GHC.IO.Exception import GHC.IO.Exception
@@ -103,6 +105,7 @@ installGHCBindist :: ( MonadFail m
, MonadLogger m , MonadLogger m
, MonadResource m , MonadResource m
, MonadIO m , MonadIO m
, MonadUnliftIO m
) )
=> DownloadInfo -- ^ where/how to download => DownloadInfo -- ^ where/how to download
-> Version -- ^ the version to install -> Version -- ^ the version to install
@@ -158,6 +161,7 @@ installPackedGHC :: ( MonadMask m
, MonadThrow m , MonadThrow m
, MonadLogger m , MonadLogger m
, MonadIO m , MonadIO m
, MonadUnliftIO m
) )
=> Path Abs -- ^ Path to the packed GHC bindist => Path Abs -- ^ Path to the packed GHC bindist
-> Maybe TarDir -- ^ Subdir of the archive -> Maybe TarDir -- ^ Subdir of the archive
@@ -230,6 +234,7 @@ installGHCBin :: ( MonadFail m
, MonadLogger m , MonadLogger m
, MonadResource m , MonadResource m
, MonadIO m , MonadIO m
, MonadUnliftIO m
) )
=> GHCupDownloads -- ^ the download info to look up the tarball from => GHCupDownloads -- ^ the download info to look up the tarball from
-> Version -- ^ the version to install -> Version -- ^ the version to install
@@ -262,6 +267,7 @@ installCabalBindist :: ( MonadMask m
, MonadLogger m , MonadLogger m
, MonadResource m , MonadResource m
, MonadIO m , MonadIO m
, MonadUnliftIO m
, MonadFail m , MonadFail m
) )
=> DownloadInfo => DownloadInfo
@@ -342,6 +348,7 @@ installCabalBin :: ( MonadMask m
, MonadLogger m , MonadLogger m
, MonadResource m , MonadResource m
, MonadIO m , MonadIO m
, MonadUnliftIO m
, MonadFail m , MonadFail m
) )
=> GHCupDownloads => GHCupDownloads
@@ -375,6 +382,7 @@ installHLSBindist :: ( MonadMask m
, MonadLogger m , MonadLogger m
, MonadResource m , MonadResource m
, MonadIO m , MonadIO m
, MonadUnliftIO m
, MonadFail m , MonadFail m
) )
=> DownloadInfo => DownloadInfo
@@ -464,6 +472,7 @@ installHLSBin :: ( MonadMask m
, MonadLogger m , MonadLogger m
, MonadResource m , MonadResource m
, MonadIO m , MonadIO m
, MonadUnliftIO m
, MonadFail m , MonadFail m
) )
=> GHCupDownloads => GHCupDownloads
@@ -1062,6 +1071,7 @@ compileGHC :: ( MonadMask m
, MonadResource m , MonadResource m
, MonadLogger m , MonadLogger m
, MonadIO m , MonadIO m
, MonadUnliftIO m
, MonadFail m , MonadFail m
) )
=> GHCupDownloads => GHCupDownloads
@@ -1244,9 +1254,10 @@ Stage1Only = YES|]
. B16.encode . B16.encode
. SHA256.hashlazy . SHA256.hashlazy
$ c $ c
cTime <- liftIO getCurrentTime
tarName <- tarName <-
parseRel parseRel
[i|ghc-#{tVerToText tver}-#{pfReqToString pfreq}-#{cDigest}.tar#{takeExtension (toFilePath tar)}|] [i|ghc-#{tVerToText tver}-#{pfReqToString pfreq}-#{iso8601Show cTime}-#{cDigest}.tar#{takeExtension (toFilePath tar)}|]
let tarPath = cacheDir </> tarName let tarPath = cacheDir </> tarName
handleIO (throwE . CopyError . show) $ liftIO $ copyFile (workdir </> tar) handleIO (throwE . CopyError . show) $ liftIO $ copyFile (workdir </> tar)
tarPath tarPath
@@ -1296,6 +1307,7 @@ upgradeGHCup :: ( MonadMask m
, MonadThrow m , MonadThrow m
, MonadResource m , MonadResource m
, MonadIO m , MonadIO m
, MonadUnliftIO m
) )
=> GHCupDownloads => GHCupDownloads
-> Maybe (Path Abs) -- ^ full file destination to write ghcup into -> Maybe (Path Abs) -- ^ full file destination to write ghcup into

View File

@@ -400,6 +400,7 @@ downloadCached :: ( MonadMask m
, MonadThrow m , MonadThrow m
, MonadLogger m , MonadLogger m
, MonadIO m , MonadIO m
, MonadUnliftIO m
, MonadReader AppState m , MonadReader AppState m
) )
=> DownloadInfo => DownloadInfo

View File

@@ -24,6 +24,8 @@ import GHCup.Utils.Prelude
#if !defined(TAR) #if !defined(TAR)
import Codec.Archive import Codec.Archive
#else
import qualified Codec.Archive.Tar as Tar
#endif #endif
import Control.Exception.Safe import Control.Exception.Safe
import Data.ByteString ( ByteString ) import Data.ByteString ( ByteString )
@@ -339,4 +341,14 @@ instance Pretty ArchiveResult where
pPrint ArchiveRetry = text "Archive result: retry" pPrint ArchiveRetry = text "Archive result: retry"
pPrint ArchiveOk = text "Archive result: Ok" pPrint ArchiveOk = text "Archive result: Ok"
pPrint ArchiveEOF = text "Archive result: EOF" pPrint ArchiveEOF = text "Archive result: EOF"
#else
instance Pretty Tar.FormatError where
pPrint Tar.TruncatedArchive = text "Truncated archive"
pPrint Tar.ShortTrailer = text "Short trailer"
pPrint Tar.BadTrailer = text "Bad trailer"
pPrint Tar.TrailingJunk = text "Trailing junk"
pPrint Tar.ChecksumIncorrect = text "Checksum incorrect"
pPrint Tar.NotTarFormat = text "Not a tar format"
pPrint Tar.UnrecognisedTarFormat = text "Unrecognised tar format"
pPrint Tar.HeaderBadNumericEncoding = text "Header has bad numeric encoding"
#endif #endif

View File

@@ -3,6 +3,7 @@
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TemplateHaskell #-}
{-| {-|
Module : GHCup.Utils.Dirs Module : GHCup.Utils.Dirs
@@ -16,6 +17,7 @@ Portability : POSIX
module GHCup.Utils.Dirs module GHCup.Utils.Dirs
( getDirs ( getDirs
, ghcupConfigFile , ghcupConfigFile
, ghcupCacheDir
, ghcupGHCBaseDir , ghcupGHCBaseDir
, ghcupGHCDir , ghcupGHCDir
, mkGhcupTmpDir , mkGhcupTmpDir
@@ -35,11 +37,14 @@ import GHCup.Utils.Prelude
import Control.Applicative import Control.Applicative
import Control.Exception.Safe import Control.Exception.Safe
import Control.Monad import Control.Monad
import Control.Monad.IO.Unlift
import Control.Monad.Logger
import Control.Monad.Reader import Control.Monad.Reader
import Control.Monad.Trans.Resource import Control.Monad.Trans.Resource hiding (throwM)
import Data.Bifunctor import Data.Bifunctor
import Data.ByteString ( ByteString ) import Data.ByteString ( ByteString )
import Data.Maybe import Data.Maybe
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
import HPath import HPath
@@ -49,6 +54,7 @@ import Prelude hiding ( abs
, readFile , readFile
, writeFile , writeFile
) )
import System.DiskSpace
import System.Posix.Env.ByteString ( getEnv import System.Posix.Env.ByteString ( getEnv
, getEnvDefault , getEnvDefault
) )
@@ -57,11 +63,13 @@ import System.Posix.Temp.ByteString ( mkdtemp )
import qualified Data.ByteString.Lazy as L import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.UTF8 as UTF8 import qualified Data.ByteString.UTF8 as UTF8
import qualified Data.Text as T
import qualified Data.Text.Encoding as E import qualified Data.Text.Encoding as E
import qualified Data.Yaml as Y import qualified Data.Yaml as Y
import qualified System.Posix.FilePath as FP import qualified System.Posix.FilePath as FP
import qualified System.Posix.User as PU import qualified System.Posix.User as PU
import qualified Text.Megaparsec as MP import qualified Text.Megaparsec as MP
import Control.Concurrent (threadDelay)
@@ -225,15 +233,31 @@ parseGHCupGHCDir (toFilePath -> f) = do
throwEither $ MP.parse ghcTargetVerP "" fp throwEither $ MP.parse ghcTargetVerP "" fp
mkGhcupTmpDir :: (MonadThrow m, MonadIO m) => m (Path Abs) mkGhcupTmpDir :: (MonadUnliftIO m, MonadLogger m, MonadCatch m, MonadThrow m, MonadIO m) => m (Path Abs)
mkGhcupTmpDir = do mkGhcupTmpDir = do
tmpdir <- liftIO $ getEnvDefault "TMPDIR" "/tmp" tmpdir <- liftIO $ getEnvDefault "TMPDIR" "/tmp"
tmp <- liftIO $ mkdtemp (tmpdir FP.</> "ghcup-") let fp = T.unpack $ decUTF8Safe tmpdir
let minSpace = 5000 -- a rough guess, aight?
space <- handleIO (\_ -> pure Nothing) $ fmap Just $ liftIO $ getAvailSpace fp
when (maybe False (toBytes minSpace >) space) $ do
$(logWarn) [i|Possibly insufficient disk space on #{fp}. At least #{minSpace} MB are recommended, but only #{toMB (fromJust space)} are free. Consider freeing up disk space or setting TMPDIR env variable.|]
$(logWarn)
"...waiting for 10 seconds before continuing anyway, you can still abort..."
liftIO $ threadDelay 10000000 -- give the user a sec to intervene
tmp <- liftIO $ mkdtemp (tmpdir FP.</> "ghcup-")
parseAbs tmp parseAbs tmp
where
toBytes mb = mb * 1024 * 1024
toMB b = show (truncate' (fromIntegral b / (1024 * 1024) :: Double) 2)
truncate' :: Double -> Int -> Double
truncate' x n = fromIntegral (floor (x * t) :: Integer) / t
where t = 10^n
withGHCupTmpDir :: (MonadResource m, MonadThrow m, MonadIO m) => m (Path Abs) withGHCupTmpDir :: (MonadUnliftIO m, MonadLogger m, MonadCatch m, MonadResource m, MonadThrow m, MonadIO m) => m (Path Abs)
withGHCupTmpDir = snd <$> allocate mkGhcupTmpDir deleteDirRecursive withGHCupTmpDir = snd <$> withRunInIO (\run -> run $ allocate (run mkGhcupTmpDir) deleteDirRecursive)
@@ -269,5 +293,3 @@ relativeSymlink (toFilePath -> p1) (toFilePath -> p2) =
<> joinPath ("/" : drop (length common) d2) <> joinPath ("/" : drop (length common) d2)