Compare commits
23 Commits
alpine-bin
...
v0.1.8
| Author | SHA1 | Date | |
|---|---|---|---|
| b5440fc7d2 | |||
| 4b21adadf1 | |||
| 78ae77780b | |||
| ccb95bcbee | |||
| 21ac670bbe | |||
| 8b54dee66c | |||
| dad926f3ba | |||
| a298d949b5 | |||
| e1cf11f9d4 | |||
| 97cd43792d | |||
| 08693e6d3a | |||
| e2227da8d2 | |||
| 5f20e4c583 | |||
| f82f1a12dd | |||
| 53148fd1c9 | |||
| 8985101b2a | |||
| d1949c8490 | |||
| b7faae1203 | |||
| b6a9d35c3e | |||
| 6cb6c7a448 | |||
| 22a5ad739e | |||
| 14c91bdd78 | |||
| 2c638cd2e2 |
@@ -97,7 +97,7 @@ variables:
|
|||||||
test:linux:recommended:
|
test:linux:recommended:
|
||||||
extends: .test_ghcup_version:linux
|
extends: .test_ghcup_version:linux
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.8.3"
|
GHC_VERSION: "8.8.4"
|
||||||
CABAL_VERSION: "3.2.0.0"
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
test:linux:latest:
|
test:linux:latest:
|
||||||
@@ -113,7 +113,7 @@ test:linux:latest:
|
|||||||
test:mac:recommended:
|
test:mac:recommended:
|
||||||
extends: .test_ghcup_version:darwin
|
extends: .test_ghcup_version:darwin
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.8.3"
|
GHC_VERSION: "8.8.4"
|
||||||
CABAL_VERSION: "3.2.0.0"
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
test:mac:latest:
|
test:mac:latest:
|
||||||
@@ -129,7 +129,7 @@ test:mac:latest:
|
|||||||
test:freebsd:recommended:
|
test:freebsd:recommended:
|
||||||
extends: .test_ghcup_version:freebsd
|
extends: .test_ghcup_version:freebsd
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "8.8.3"
|
GHC_VERSION: "8.8.4"
|
||||||
CABAL_VERSION: "3.2.0.0"
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
test:freebsd:latest:
|
test:freebsd:latest:
|
||||||
@@ -150,7 +150,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.8.3"
|
GHC_VERSION: "8.8.4"
|
||||||
CABAL_VERSION: "3.2.0.0"
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
|
|
||||||
@@ -162,7 +162,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.8.3"
|
GHC_VERSION: "8.8.4"
|
||||||
CABAL_VERSION: "3.2.0.0"
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -44,12 +44,6 @@ ghcup-gen check -f ghcup-${JSON_VERSION}.json
|
|||||||
|
|
||||||
eghcup --numeric-version
|
eghcup --numeric-version
|
||||||
|
|
||||||
# TODO: rm once we have tarballs
|
|
||||||
if [ "${OS}" = "FREEBSD" ] ; then
|
|
||||||
GHC_VERSION=8.6.3
|
|
||||||
CABAL_VERSION=2.4.1.0
|
|
||||||
fi
|
|
||||||
|
|
||||||
eghcup install ${GHC_VERSION}
|
eghcup install ${GHC_VERSION}
|
||||||
eghcup set ${GHC_VERSION}
|
eghcup set ${GHC_VERSION}
|
||||||
eghcup install-cabal ${CABAL_VERSION}
|
eghcup install-cabal ${CABAL_VERSION}
|
||||||
|
|||||||
12
3rdparty/libarchive/c/archive_write_disk_posix.c
vendored
12
3rdparty/libarchive/c/archive_write_disk_posix.c
vendored
@@ -546,6 +546,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
|
|||||||
{
|
{
|
||||||
struct archive_write_disk *a = (struct archive_write_disk *)_a;
|
struct archive_write_disk *a = (struct archive_write_disk *)_a;
|
||||||
struct fixup_entry *fe;
|
struct fixup_entry *fe;
|
||||||
|
const char *linkname;
|
||||||
int ret, r;
|
int ret, r;
|
||||||
|
|
||||||
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
|
archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC,
|
||||||
@@ -590,6 +591,17 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
|
|||||||
if (ret != ARCHIVE_OK)
|
if (ret != ARCHIVE_OK)
|
||||||
return (ret);
|
return (ret);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if we have a hardlink that points to itself.
|
||||||
|
*/
|
||||||
|
linkname = archive_entry_hardlink(a->entry);
|
||||||
|
if (linkname != NULL && strcmp(a->name, linkname) == 0) {
|
||||||
|
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
||||||
|
"Skipping hardlink pointing to itself: %s",
|
||||||
|
a->name);
|
||||||
|
return (ARCHIVE_WARN);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Query the umask so we get predictable mode settings.
|
* Query the umask so we get predictable mode settings.
|
||||||
* This gets done on every call to _write_header in case the
|
* This gets done on every call to _write_header in case the
|
||||||
|
|||||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,5 +1,21 @@
|
|||||||
# Revision history for ghcup
|
# Revision history for ghcup
|
||||||
|
|
||||||
|
## 0.1.8 -- 2020-07-21
|
||||||
|
|
||||||
|
* Fix bug in logging thread dying on newlines
|
||||||
|
* Allow to install from arbitrary bindists: `ghcup -n install ghc -u '{"dlHash": "", "dlSubdir": "ghc-8.10.1", "dlUri": "https://github.com/commercialhaskell/ghc/releases/download/ghc-8.10.1-release/ghc-8.10.1-x86_64-deb9-linux.tar.xz"}' 8.10.1`
|
||||||
|
|
||||||
|
## 0.1.7 -- 2020-07-20
|
||||||
|
|
||||||
|
* Fix a bug in libarchive not unpacking some uncleanly packed bindists
|
||||||
|
* Improved fish support in bootstrap-haskell
|
||||||
|
* Only check for upgrades when not upgrading
|
||||||
|
* Fix platform detection for i386 docker images
|
||||||
|
* Improve alpine support
|
||||||
|
- more/proper bindists
|
||||||
|
- don't fall back to glibc based bindists
|
||||||
|
- install bindists with `--disable-ld-override` to avoid ld.gold bugs
|
||||||
|
|
||||||
## 0.1.6 -- 2020-07-13
|
## 0.1.6 -- 2020-07-13
|
||||||
|
|
||||||
* Create a new curses (brick) based TUI, accessible via `ghcup tui` #24
|
* Create a new curses (brick) based TUI, accessible via `ghcup tui` #24
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import Control.Monad.Fail ( MonadFail )
|
|||||||
import Control.Monad.Logger
|
import Control.Monad.Logger
|
||||||
import Control.Monad.Reader
|
import Control.Monad.Reader
|
||||||
import Control.Monad.Trans.Resource
|
import Control.Monad.Trans.Resource
|
||||||
|
import Data.Aeson ( eitherDecode )
|
||||||
import Data.Bifunctor
|
import Data.Bifunctor
|
||||||
import Data.Char
|
import Data.Char
|
||||||
import Data.Either
|
import Data.Either
|
||||||
@@ -68,6 +69,7 @@ import URI.ByteString
|
|||||||
|
|
||||||
import qualified Data.ByteString as B
|
import qualified Data.ByteString as B
|
||||||
import qualified Data.ByteString.UTF8 as UTF8
|
import qualified Data.ByteString.UTF8 as UTF8
|
||||||
|
import qualified Data.ByteString.Lazy.UTF8 as BLU
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.IO as T
|
import qualified Data.Text.IO as T
|
||||||
import qualified Data.Text.Encoding as E
|
import qualified Data.Text.Encoding as E
|
||||||
@@ -119,6 +121,7 @@ data InstallCommand = InstallGHC InstallOptions
|
|||||||
data InstallOptions = InstallOptions
|
data InstallOptions = InstallOptions
|
||||||
{ instVer :: Maybe ToolVersion
|
{ instVer :: Maybe ToolVersion
|
||||||
, instPlatform :: Maybe PlatformRequest
|
, instPlatform :: Maybe PlatformRequest
|
||||||
|
, instBindist :: Maybe DownloadInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
data SetCommand = SetGHC SetOptions
|
data SetCommand = SetGHC SetOptions
|
||||||
@@ -405,7 +408,7 @@ installParser =
|
|||||||
|
|
||||||
installOpts :: Parser InstallOptions
|
installOpts :: Parser InstallOptions
|
||||||
installOpts =
|
installOpts =
|
||||||
(flip InstallOptions)
|
(\p u v -> InstallOptions v p u)
|
||||||
<$> (optional
|
<$> (optional
|
||||||
(option
|
(option
|
||||||
(eitherReader platformParser)
|
(eitherReader platformParser)
|
||||||
@@ -417,6 +420,17 @@ installOpts =
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
<*> (optional
|
||||||
|
(option
|
||||||
|
(eitherReader bindistParser)
|
||||||
|
( short 'u'
|
||||||
|
<> long "url"
|
||||||
|
<> metavar "BINDIST_URL"
|
||||||
|
<> help
|
||||||
|
"Provide DownloadInfo as json string, e.g.: '{ \"dlHash\": \"<sha256 hash>\", \"dlSubdir\": \"ghc-<ver>\", \"dlUri\": \"<uri>\" }'"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
<*> optional toolVersionArgument
|
<*> optional toolVersionArgument
|
||||||
|
|
||||||
|
|
||||||
@@ -800,6 +814,8 @@ platformParser s' = case MP.parse (platformP <* MP.eof) "" (T.pack s') of
|
|||||||
pure v
|
pure v
|
||||||
|
|
||||||
|
|
||||||
|
bindistParser :: String -> Either String DownloadInfo
|
||||||
|
bindistParser = eitherDecode . BLU.fromString
|
||||||
|
|
||||||
|
|
||||||
toSettings :: Options -> Settings
|
toSettings :: Options -> Settings
|
||||||
@@ -1047,7 +1063,9 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
let installGHC InstallOptions{..} =
|
let installGHC InstallOptions{..} =
|
||||||
(runInstTool $ do
|
(runInstTool $ do
|
||||||
v <- liftE $ fromVersion dls instVer GHC
|
v <- liftE $ fromVersion dls instVer GHC
|
||||||
liftE $ installGHCBin dls (_tvVersion v) (fromMaybe pfreq instPlatform) -- FIXME: ugly sharing of tool version
|
case instBindist of
|
||||||
|
Nothing -> liftE $ installGHCBin dls (_tvVersion v) (fromMaybe pfreq instPlatform)
|
||||||
|
Just uri -> liftE $ installGHCBindist uri (_tvVersion v) (fromMaybe pfreq instPlatform)
|
||||||
)
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ -> do
|
VRight _ -> do
|
||||||
@@ -1081,7 +1099,9 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
|||||||
let installCabal InstallOptions{..} =
|
let installCabal InstallOptions{..} =
|
||||||
(runInstTool $ do
|
(runInstTool $ do
|
||||||
v <- liftE $ fromVersion dls instVer Cabal
|
v <- liftE $ fromVersion dls instVer Cabal
|
||||||
liftE $ installCabalBin dls (_tvVersion v) (fromMaybe pfreq instPlatform) -- FIXME: ugly sharing of tool version
|
case instBindist of
|
||||||
|
Nothing -> liftE $ installCabalBin dls (_tvVersion v) (fromMaybe pfreq instPlatform)
|
||||||
|
Just uri -> liftE $ installCabalBindist uri (_tvVersion v) (fromMaybe pfreq instPlatform)
|
||||||
)
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ -> do
|
VRight _ -> do
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ eghcup() {
|
|||||||
download_ghcup() {
|
download_ghcup() {
|
||||||
_plat="$(uname -s)"
|
_plat="$(uname -s)"
|
||||||
_arch=$(uname -m)
|
_arch=$(uname -m)
|
||||||
_ghver="0.1.6"
|
_ghver="0.1.7"
|
||||||
_base_url="https://downloads.haskell.org/~ghcup"
|
_base_url="https://downloads.haskell.org/~ghcup"
|
||||||
|
|
||||||
case "${_plat}" in
|
case "${_plat}" in
|
||||||
|
|||||||
@@ -214,7 +214,7 @@
|
|||||||
"A_64": {
|
"A_64": {
|
||||||
"Linux_Alpine": {
|
"Linux_Alpine": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "325b48b2ea199b4f62c16dc9c3ff99b42ea6bb1dde5a74fa640dfeb8d63894d0",
|
"dlHash": "517783b660a27ebf95b2568d47292fd633d5f9a4de4c80ad1ccf05e1b9d7313f",
|
||||||
"dlSubdir": "ghc-8.0.2",
|
"dlSubdir": "ghc-8.0.2",
|
||||||
"dlUri": "https://files.hasufell.de/ghc/ghc-8.0.2-x86_64-alpine-linux.tar.xz"
|
"dlUri": "https://files.hasufell.de/ghc/ghc-8.0.2-x86_64-alpine-linux.tar.xz"
|
||||||
}
|
}
|
||||||
@@ -744,6 +744,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"A_32": {
|
"A_32": {
|
||||||
|
"Linux_Alpine": {
|
||||||
|
"unknown_versioning": {
|
||||||
|
"dlHash": "7360cc6b29e9b4ab08f6ea5bc3bcca6f5c216933e81ef1620dcdd700f1fdb289",
|
||||||
|
"dlSubdir": "ghc-8.10.1",
|
||||||
|
"dlUri": "https://files.hasufell.de/ghc/ghc-8.10.1-i386-alpine-linux.tar.xz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Linux_Debian": {
|
"Linux_Debian": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "8b53eef2c827b5f634d72920a93c0c9dd66ea288691a2bfe28def45d3c686ee2",
|
"dlHash": "8b53eef2c827b5f634d72920a93c0c9dd66ea288691a2bfe28def45d3c686ee2",
|
||||||
@@ -887,6 +894,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"A_32": {
|
"A_32": {
|
||||||
|
"Linux_Alpine": {
|
||||||
|
"unknown_versioning": {
|
||||||
|
"dlHash": "3737837550d9b177acfe150e3a3cd4545427ded020487c2ed5194d7b8f116349",
|
||||||
|
"dlSubdir": "ghc-8.6.5",
|
||||||
|
"dlUri": "https://files.hasufell.de/ghc/ghc-8.6.5-i386-alpine-linux.tar.xz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Linux_Debian": {
|
"Linux_Debian": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "1cddb907393a669342b1a922dd16d505d9d93d50bd9433a54a8162f8701250dc",
|
"dlHash": "1cddb907393a669342b1a922dd16d505d9d93d50bd9433a54a8162f8701250dc",
|
||||||
@@ -1256,6 +1270,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"A_32": {
|
"A_32": {
|
||||||
|
"Linux_Alpine": {
|
||||||
|
"unknown_versioning": {
|
||||||
|
"dlHash": "1d18e89ee031197e55c48683e78a7ffc67601ac5fd9f73aac555eb064b3859a2",
|
||||||
|
"dlSubdir": "ghc-8.8.4",
|
||||||
|
"dlUri": "https://files.hasufell.de/ghc/ghc-8.8.4-i386-alpine-linux.tar.xz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Linux_Debian": {
|
"Linux_Debian": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "43dd954910c9027694312cef0aabc7774d102d0422b7172802cfb72f7d5da3a0",
|
"dlHash": "43dd954910c9027694312cef0aabc7774d102d0422b7172802cfb72f7d5da3a0",
|
||||||
@@ -1293,6 +1314,7 @@
|
|||||||
},
|
},
|
||||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.8.4/docs/html/users_guide/8.8.4-notes.html",
|
"viChangeLog": "https://downloads.haskell.org/~ghc/8.8.4/docs/html/users_guide/8.8.4-notes.html",
|
||||||
"viTags": [
|
"viTags": [
|
||||||
|
"Recommended",
|
||||||
"base-4.13.0.0"
|
"base-4.13.0.0"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -1755,6 +1777,13 @@
|
|||||||
"8.2.2": {
|
"8.2.2": {
|
||||||
"viArch": {
|
"viArch": {
|
||||||
"A_64": {
|
"A_64": {
|
||||||
|
"Linux_Alpine": {
|
||||||
|
"unknown_versioning": {
|
||||||
|
"dlHash": "adcf3a320a3c402aba07ae9586990dc3c0b550e96aeffb1b9e194313d3ba716d",
|
||||||
|
"dlSubdir": "ghc-8.2.2",
|
||||||
|
"dlUri": "https://files.hasufell.de/ghc/ghc-8.2.2-x86_64-alpine-linux.tar.xz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"FreeBSD": {
|
"FreeBSD": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "cd351c704b92b9af23994024df07de8ca7090ea7675d5c8b14b2be857a46d804",
|
"dlHash": "cd351c704b92b9af23994024df07de8ca7090ea7675d5c8b14b2be857a46d804",
|
||||||
@@ -1869,6 +1898,13 @@
|
|||||||
"8.4.4": {
|
"8.4.4": {
|
||||||
"viArch": {
|
"viArch": {
|
||||||
"A_64": {
|
"A_64": {
|
||||||
|
"Linux_Alpine": {
|
||||||
|
"unknown_versioning": {
|
||||||
|
"dlHash": "336affff8314d3dc5e85d9c09015ae2ba8a7658b459c8c8ae77ecaa551a56ae7",
|
||||||
|
"dlSubdir": "ghc-8.4.4",
|
||||||
|
"dlUri": "https://files.hasufell.de/ghc/ghc-8.4.4-x86_64-alpine-linux.tar.xz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"FreeBSD": {
|
"FreeBSD": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "44fbd142d1c355d6110595c59c760e2c73866ff9259ec85ebf814edb244d1940",
|
"dlHash": "44fbd142d1c355d6110595c59c760e2c73866ff9259ec85ebf814edb244d1940",
|
||||||
@@ -1956,6 +1992,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"A_32": {
|
"A_32": {
|
||||||
|
"Linux_Alpine": {
|
||||||
|
"unknown_versioning": {
|
||||||
|
"dlHash": "892888d388ef5c9cadf5cfba1146d62237c25b9b066fb62fee940b2b285fd308",
|
||||||
|
"dlSubdir": "ghc-8.4.4",
|
||||||
|
"dlUri": "https://files.hasufell.de/ghc/ghc-8.4.4-i386-alpine-linux.tar.xz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"Linux_Debian": {
|
"Linux_Debian": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "678bafaabea6af70ba71ccf0210bb437f9f5591ec28ac1cbbbd5f7aa6894e450",
|
"dlHash": "678bafaabea6af70ba71ccf0210bb437f9f5591ec28ac1cbbbd5f7aa6894e450",
|
||||||
@@ -2123,7 +2166,6 @@
|
|||||||
},
|
},
|
||||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html",
|
"viChangeLog": "https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html",
|
||||||
"viTags": [
|
"viTags": [
|
||||||
"Recommended",
|
|
||||||
"base-4.13.0.0"
|
"base-4.13.0.0"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -2298,37 +2340,37 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GHCup": {
|
"GHCup": {
|
||||||
"0.1.6": {
|
"0.1.7": {
|
||||||
"viArch": {
|
"viArch": {
|
||||||
"A_64": {
|
"A_64": {
|
||||||
"FreeBSD": {
|
"FreeBSD": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "6bbfb1047691ff3ae9249e8805cf9f37bab30a008dae130cb2a4b3aa5253e6e5",
|
"dlHash": "54b9b6f98908f6679dda6db025b4047dfe82e6b57ae82c547a9d611b9e4ff105",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.6/x86_64-portbld-freebsd-ghcup-0.1.6"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.7/x86_64-portbld-freebsd-ghcup-0.1.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Darwin": {
|
"Darwin": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "1e025e66d7f7b75d94f17a7da6120efd7e2df918a8eac88c4711ed11d2aac4ec",
|
"dlHash": "00b2c04755d2b40e568afbfc2a485c36697fc55f210eae0d4cd80413c71032ed",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.6/x86_64-apple-darwin-ghcup-0.1.6"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.7/x86_64-apple-darwin-ghcup-0.1.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Linux_UnknownLinux": {
|
"Linux_UnknownLinux": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "bdbec0cdf4c8511c4082dd83993d15034c0fbcb5722ecf418c1cee40667da8af",
|
"dlHash": "a1d1e8b3c2b00186957c927d09f2cfb457bbfa65c1ab562ff5683963e205bdd5",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.6/x86_64-linux-ghcup-0.1.6"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.7/x86_64-linux-ghcup-0.1.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"A_32": {
|
"A_32": {
|
||||||
"Linux_UnknownLinux": {
|
"Linux_UnknownLinux": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "0366ed6c00862c3c002cdefc3e37523ad80e655387956c7ab58b268aaa6fae5d",
|
"dlHash": "1651cc196e4fdd18995054edebe109833535961f0e2b0d505f1714e83f3e8808",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.6/i386-linux-ghcup-0.1.6"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.7/i386-linux-ghcup-0.1.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cabal-version: 3.0
|
cabal-version: 3.0
|
||||||
name: ghcup
|
name: ghcup
|
||||||
version: 0.1.6
|
version: 0.1.8
|
||||||
synopsis: ghc toolchain installer as an exe/library
|
synopsis: ghc toolchain installer as an exe/library
|
||||||
description:
|
description:
|
||||||
A rewrite of the shell script ghcup, for providing
|
A rewrite of the shell script ghcup, for providing
|
||||||
@@ -341,6 +341,7 @@ executable ghcup
|
|||||||
import:
|
import:
|
||||||
config
|
config
|
||||||
, base
|
, base
|
||||||
|
, aeson
|
||||||
, bytestring
|
, bytestring
|
||||||
, containers
|
, containers
|
||||||
, haskus-utils-variant
|
, haskus-utils-variant
|
||||||
|
|||||||
124
lib/GHCup.hs
124
lib/GHCup.hs
@@ -77,7 +77,7 @@ import qualified Data.Text.Encoding as E
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
installGHCBin :: ( MonadFail m
|
installGHCBindist :: ( MonadFail m
|
||||||
, MonadMask m
|
, MonadMask m
|
||||||
, MonadCatch m
|
, MonadCatch m
|
||||||
, MonadReader Settings m
|
, MonadReader Settings m
|
||||||
@@ -85,7 +85,7 @@ installGHCBin :: ( MonadFail m
|
|||||||
, MonadResource m
|
, MonadResource m
|
||||||
, MonadIO m
|
, MonadIO m
|
||||||
)
|
)
|
||||||
=> GHCupDownloads
|
=> DownloadInfo
|
||||||
-> Version
|
-> Version
|
||||||
-> PlatformRequest
|
-> PlatformRequest
|
||||||
-> Excepts
|
-> Excepts
|
||||||
@@ -102,14 +102,13 @@ installGHCBin :: ( MonadFail m
|
|||||||
]
|
]
|
||||||
m
|
m
|
||||||
()
|
()
|
||||||
installGHCBin bDls ver pfreq@(PlatformRequest {..}) = do
|
installGHCBindist dlinfo ver (PlatformRequest {..}) = do
|
||||||
let tver = (mkTVer ver)
|
let tver = (mkTVer ver)
|
||||||
lift $ $(logDebug) [i|Requested to install GHC with #{ver}|]
|
lift $ $(logDebug) [i|Requested to install GHC with #{ver}|]
|
||||||
whenM (liftIO $ ghcInstalled tver)
|
whenM (liftIO $ ghcInstalled tver)
|
||||||
$ (throwE $ AlreadyInstalled GHC ver)
|
$ (throwE $ AlreadyInstalled GHC ver)
|
||||||
|
|
||||||
-- download (or use cached version)
|
-- download (or use cached version)
|
||||||
dlinfo <- lE $ getDownloadInfo GHC ver pfreq bDls
|
|
||||||
dl <- liftE $ downloadCached dlinfo Nothing
|
dl <- liftE $ downloadCached dlinfo Nothing
|
||||||
|
|
||||||
-- unpack
|
-- unpack
|
||||||
@@ -137,40 +136,75 @@ installGHCBin bDls ver pfreq@(PlatformRequest {..}) = do
|
|||||||
lift $ $(logInfo) "Installing GHC (this may take a while)"
|
lift $ $(logInfo) "Installing GHC (this may take a while)"
|
||||||
lEM $ execLogged "./configure"
|
lEM $ execLogged "./configure"
|
||||||
False
|
False
|
||||||
["--prefix=" <> toFilePath inst]
|
(["--prefix=" <> toFilePath inst] ++ alpineArgs)
|
||||||
[rel|ghc-configure|]
|
[rel|ghc-configure|]
|
||||||
(Just path)
|
(Just path)
|
||||||
Nothing
|
Nothing
|
||||||
lEM $ make ["install"] (Just path)
|
lEM $ make ["install"] (Just path)
|
||||||
pure ()
|
pure ()
|
||||||
|
|
||||||
|
alpineArgs
|
||||||
|
| ver >= [vver|8.2.2|]
|
||||||
|
, Linux Alpine <- _rPlatform = ["--disable-ld-override"]
|
||||||
|
| otherwise = []
|
||||||
|
|
||||||
installCabalBin :: ( MonadMask m
|
|
||||||
, MonadCatch m
|
installGHCBin :: ( MonadFail m
|
||||||
, MonadReader Settings m
|
, MonadMask m
|
||||||
, MonadLogger m
|
, MonadCatch m
|
||||||
, MonadResource m
|
, MonadReader Settings m
|
||||||
, MonadIO m
|
, MonadLogger m
|
||||||
, MonadFail m
|
, MonadResource m
|
||||||
)
|
, MonadIO m
|
||||||
=> GHCupDownloads
|
)
|
||||||
-> Version
|
=> GHCupDownloads
|
||||||
-> PlatformRequest
|
-> Version
|
||||||
-> Excepts
|
-> PlatformRequest
|
||||||
'[ AlreadyInstalled
|
-> Excepts
|
||||||
, CopyError
|
'[ AlreadyInstalled
|
||||||
, DigestError
|
, BuildFailed
|
||||||
, DownloadFailed
|
, DigestError
|
||||||
, NoDownload
|
, DownloadFailed
|
||||||
, NotInstalled
|
, NoDownload
|
||||||
, UnknownArchive
|
, NotInstalled
|
||||||
|
, UnknownArchive
|
||||||
#if !defined(TAR)
|
#if !defined(TAR)
|
||||||
, ArchiveResult
|
, ArchiveResult
|
||||||
#endif
|
#endif
|
||||||
]
|
]
|
||||||
m
|
m
|
||||||
()
|
()
|
||||||
installCabalBin bDls ver pfreq@(PlatformRequest {..}) = do
|
installGHCBin bDls ver pfreq = do
|
||||||
|
dlinfo <- lE $ getDownloadInfo GHC ver pfreq bDls
|
||||||
|
installGHCBindist dlinfo ver pfreq
|
||||||
|
|
||||||
|
|
||||||
|
installCabalBindist :: ( MonadMask m
|
||||||
|
, MonadCatch m
|
||||||
|
, MonadReader Settings m
|
||||||
|
, MonadLogger m
|
||||||
|
, MonadResource m
|
||||||
|
, MonadIO m
|
||||||
|
, MonadFail m
|
||||||
|
)
|
||||||
|
=> DownloadInfo
|
||||||
|
-> Version
|
||||||
|
-> PlatformRequest
|
||||||
|
-> Excepts
|
||||||
|
'[ AlreadyInstalled
|
||||||
|
, CopyError
|
||||||
|
, DigestError
|
||||||
|
, DownloadFailed
|
||||||
|
, NoDownload
|
||||||
|
, NotInstalled
|
||||||
|
, UnknownArchive
|
||||||
|
#if !defined(TAR)
|
||||||
|
, ArchiveResult
|
||||||
|
#endif
|
||||||
|
]
|
||||||
|
m
|
||||||
|
()
|
||||||
|
installCabalBindist dlinfo ver (PlatformRequest {..}) = do
|
||||||
lift $ $(logDebug) [i|Requested to install cabal version #{ver}|]
|
lift $ $(logDebug) [i|Requested to install cabal version #{ver}|]
|
||||||
|
|
||||||
bindir <- liftIO ghcupBinDir
|
bindir <- liftIO ghcupBinDir
|
||||||
@@ -185,7 +219,6 @@ installCabalBin bDls ver pfreq@(PlatformRequest {..}) = do
|
|||||||
$ (throwE $ AlreadyInstalled Cabal ver)
|
$ (throwE $ AlreadyInstalled Cabal ver)
|
||||||
|
|
||||||
-- download (or use cached version)
|
-- download (or use cached version)
|
||||||
dlinfo <- lE $ getDownloadInfo Cabal ver pfreq bDls
|
|
||||||
dl <- liftE $ downloadCached dlinfo Nothing
|
dl <- liftE $ downloadCached dlinfo Nothing
|
||||||
|
|
||||||
-- unpack
|
-- unpack
|
||||||
@@ -222,6 +255,37 @@ installCabalBin bDls ver pfreq@(PlatformRequest {..}) = do
|
|||||||
Overwrite
|
Overwrite
|
||||||
|
|
||||||
|
|
||||||
|
installCabalBin :: ( MonadMask m
|
||||||
|
, MonadCatch m
|
||||||
|
, MonadReader Settings m
|
||||||
|
, MonadLogger m
|
||||||
|
, MonadResource m
|
||||||
|
, MonadIO m
|
||||||
|
, MonadFail m
|
||||||
|
)
|
||||||
|
=> GHCupDownloads
|
||||||
|
-> Version
|
||||||
|
-> PlatformRequest
|
||||||
|
-> Excepts
|
||||||
|
'[ AlreadyInstalled
|
||||||
|
, CopyError
|
||||||
|
, DigestError
|
||||||
|
, DownloadFailed
|
||||||
|
, NoDownload
|
||||||
|
, NotInstalled
|
||||||
|
, UnknownArchive
|
||||||
|
#if !defined(TAR)
|
||||||
|
, ArchiveResult
|
||||||
|
#endif
|
||||||
|
]
|
||||||
|
m
|
||||||
|
()
|
||||||
|
installCabalBin bDls ver pfreq = do
|
||||||
|
dlinfo <- lE $ getDownloadInfo Cabal ver pfreq bDls
|
||||||
|
installCabalBindist dlinfo ver pfreq
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
--[ Set GHC/cabal ]--
|
--[ Set GHC/cabal ]--
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ ghc_802_64_alpine :: DownloadInfo
|
|||||||
ghc_802_64_alpine = DownloadInfo
|
ghc_802_64_alpine = DownloadInfo
|
||||||
[uri|https://files.hasufell.de/ghc/ghc-8.0.2-x86_64-alpine-linux.tar.xz|]
|
[uri|https://files.hasufell.de/ghc/ghc-8.0.2-x86_64-alpine-linux.tar.xz|]
|
||||||
(Just [rel|ghc-8.0.2|])
|
(Just [rel|ghc-8.0.2|])
|
||||||
"325b48b2ea199b4f62c16dc9c3ff99b42ea6bb1dde5a74fa640dfeb8d63894d0"
|
"517783b660a27ebf95b2568d47292fd633d5f9a4de4c80ad1ccf05e1b9d7313f"
|
||||||
|
|
||||||
ghc_802_32_alpine :: DownloadInfo
|
ghc_802_32_alpine :: DownloadInfo
|
||||||
ghc_802_32_alpine = DownloadInfo
|
ghc_802_32_alpine = DownloadInfo
|
||||||
@@ -180,6 +180,13 @@ ghc_822_32_alpine = DownloadInfo
|
|||||||
(Just [rel|ghc-8.2.2|])
|
(Just [rel|ghc-8.2.2|])
|
||||||
"467534c32552cfd318753112dbc70af003693aad4b0081f2a07e61f5b5ea2c22"
|
"467534c32552cfd318753112dbc70af003693aad4b0081f2a07e61f5b5ea2c22"
|
||||||
|
|
||||||
|
ghc_822_64_alpine :: DownloadInfo
|
||||||
|
ghc_822_64_alpine = DownloadInfo
|
||||||
|
[uri|https://files.hasufell.de/ghc/ghc-8.2.2-x86_64-alpine-linux.tar.xz|]
|
||||||
|
(Just [rel|ghc-8.2.2|])
|
||||||
|
"adcf3a320a3c402aba07ae9586990dc3c0b550e96aeffb1b9e194313d3ba716d"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----------------
|
-----------------
|
||||||
@@ -352,6 +359,17 @@ ghc_844_64_freebsd = DownloadInfo
|
|||||||
(Just [rel|ghc-8.4.4|])
|
(Just [rel|ghc-8.4.4|])
|
||||||
"44fbd142d1c355d6110595c59c760e2c73866ff9259ec85ebf814edb244d1940"
|
"44fbd142d1c355d6110595c59c760e2c73866ff9259ec85ebf814edb244d1940"
|
||||||
|
|
||||||
|
ghc_844_32_alpine :: DownloadInfo
|
||||||
|
ghc_844_32_alpine = DownloadInfo
|
||||||
|
[uri|https://files.hasufell.de/ghc/ghc-8.4.4-i386-alpine-linux.tar.xz|]
|
||||||
|
(Just [rel|ghc-8.4.4|])
|
||||||
|
"892888d388ef5c9cadf5cfba1146d62237c25b9b066fb62fee940b2b285fd308"
|
||||||
|
|
||||||
|
ghc_844_64_alpine :: DownloadInfo
|
||||||
|
ghc_844_64_alpine = DownloadInfo
|
||||||
|
[uri|https://files.hasufell.de/ghc/ghc-8.4.4-x86_64-alpine-linux.tar.xz|]
|
||||||
|
(Just [rel|ghc-8.4.4|])
|
||||||
|
"336affff8314d3dc5e85d9c09015ae2ba8a7658b459c8c8ae77ecaa551a56ae7"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -569,6 +587,12 @@ ghc_865_64_alpine = DownloadInfo
|
|||||||
(Just [rel|ghc-8.6.5|])
|
(Just [rel|ghc-8.6.5|])
|
||||||
"b9d3ed7f7aa24ef2d58bb579252289caa0b8877adee3685e3af2fb73d440afdc"
|
"b9d3ed7f7aa24ef2d58bb579252289caa0b8877adee3685e3af2fb73d440afdc"
|
||||||
|
|
||||||
|
ghc_865_32_alpine :: DownloadInfo
|
||||||
|
ghc_865_32_alpine = DownloadInfo
|
||||||
|
[uri|https://files.hasufell.de/ghc/ghc-8.6.5-i386-alpine-linux.tar.xz|]
|
||||||
|
(Just [rel|ghc-8.6.5|])
|
||||||
|
"3737837550d9b177acfe150e3a3cd4545427ded020487c2ed5194d7b8f116349"
|
||||||
|
|
||||||
ghc_865_64_freebsd :: DownloadInfo
|
ghc_865_64_freebsd :: DownloadInfo
|
||||||
ghc_865_64_freebsd = DownloadInfo
|
ghc_865_64_freebsd = DownloadInfo
|
||||||
[uri|https://files.hasufell.de/ghc/ghc-8.6.5-x86_64-portbld-freebsd.tar.xz|]
|
[uri|https://files.hasufell.de/ghc/ghc-8.6.5-x86_64-portbld-freebsd.tar.xz|]
|
||||||
@@ -771,6 +795,13 @@ ghc_884_64_alpine = DownloadInfo
|
|||||||
(Just [rel|ghc-8.8.4|])
|
(Just [rel|ghc-8.8.4|])
|
||||||
"90c6a1661de7f20c7d169cd6270125035b3332063e45103ce028df0beecf434e"
|
"90c6a1661de7f20c7d169cd6270125035b3332063e45103ce028df0beecf434e"
|
||||||
|
|
||||||
|
ghc_884_32_alpine :: DownloadInfo
|
||||||
|
ghc_884_32_alpine = DownloadInfo
|
||||||
|
[uri|https://files.hasufell.de/ghc/ghc-8.8.4-i386-alpine-linux.tar.xz|]
|
||||||
|
(Just [rel|ghc-8.8.4|])
|
||||||
|
"1d18e89ee031197e55c48683e78a7ffc67601ac5fd9f73aac555eb064b3859a2"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----------------
|
-----------------
|
||||||
@@ -827,12 +858,17 @@ ghc_8101_64_alpine = DownloadInfo
|
|||||||
(Just [rel|ghc-8.10.1-x86_64-unknown-linux|])
|
(Just [rel|ghc-8.10.1-x86_64-unknown-linux|])
|
||||||
"cb13b645d103e2fba2eb8dfcc4e5f2fbd9550c00c4df42f342b4210436dcb8a8"
|
"cb13b645d103e2fba2eb8dfcc4e5f2fbd9550c00c4df42f342b4210436dcb8a8"
|
||||||
|
|
||||||
|
ghc_8101_32_alpine :: DownloadInfo
|
||||||
|
ghc_8101_32_alpine = DownloadInfo
|
||||||
|
[uri|https://files.hasufell.de/ghc/ghc-8.10.1-i386-alpine-linux.tar.xz|]
|
||||||
|
(Just [rel|ghc-8.10.1|])
|
||||||
|
"7360cc6b29e9b4ab08f6ea5bc3bcca6f5c216933e81ef1620dcdd700f1fdb289"
|
||||||
|
|
||||||
ghc_8101_64_freebsd :: DownloadInfo
|
ghc_8101_64_freebsd :: DownloadInfo
|
||||||
ghc_8101_64_freebsd = DownloadInfo
|
ghc_8101_64_freebsd = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/ghc/8.10.1/ghc-8.10.1-x86_64-portbld-freebsd.tar.xz|]
|
[uri|https://files.hasufell.de/ghc/ghc-8.10.1-x86_64-portbld-freebsd.tar.xz|]
|
||||||
(Just [rel|ghc-8.10.1|])
|
(Just [rel|ghc-8.10.1|])
|
||||||
"52d27dbf9de82005dde9bfc521bff612e381b5228af194259c2306d2b75825c2"
|
"e8646ec9b60fd40aa9505ee055f22f04601290ab7a1342c2cf37c34de9d3f142"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -966,32 +1002,32 @@ cabal_3200_64_alpine = DownloadInfo
|
|||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
||||||
ghcup_016_32_linux :: DownloadInfo
|
ghcup_017_32_linux :: DownloadInfo
|
||||||
ghcup_016_32_linux = DownloadInfo
|
ghcup_017_32_linux = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghcup/0.1.6/i386-linux-ghcup-0.1.6|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.7/i386-linux-ghcup-0.1.7|]
|
||||||
Nothing
|
Nothing
|
||||||
"0366ed6c00862c3c002cdefc3e37523ad80e655387956c7ab58b268aaa6fae5d"
|
"1651cc196e4fdd18995054edebe109833535961f0e2b0d505f1714e83f3e8808"
|
||||||
|
|
||||||
|
|
||||||
ghcup_016_64_linux :: DownloadInfo
|
ghcup_017_64_linux :: DownloadInfo
|
||||||
ghcup_016_64_linux = DownloadInfo
|
ghcup_017_64_linux = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghcup/0.1.6/x86_64-linux-ghcup-0.1.6|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.7/x86_64-linux-ghcup-0.1.7|]
|
||||||
Nothing
|
Nothing
|
||||||
"bdbec0cdf4c8511c4082dd83993d15034c0fbcb5722ecf418c1cee40667da8af"
|
"a1d1e8b3c2b00186957c927d09f2cfb457bbfa65c1ab562ff5683963e205bdd5"
|
||||||
|
|
||||||
|
|
||||||
ghcup_016_64_freebsd :: DownloadInfo
|
ghcup_017_64_freebsd :: DownloadInfo
|
||||||
ghcup_016_64_freebsd = DownloadInfo
|
ghcup_017_64_freebsd = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghcup/0.1.6/x86_64-portbld-freebsd-ghcup-0.1.6|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.7/x86_64-portbld-freebsd-ghcup-0.1.7|]
|
||||||
Nothing
|
Nothing
|
||||||
"6bbfb1047691ff3ae9249e8805cf9f37bab30a008dae130cb2a4b3aa5253e6e5"
|
"54b9b6f98908f6679dda6db025b4047dfe82e6b57ae82c547a9d611b9e4ff105"
|
||||||
|
|
||||||
|
|
||||||
ghcup_016_64_darwin10_13 :: DownloadInfo
|
ghcup_017_64_darwin10_13 :: DownloadInfo
|
||||||
ghcup_016_64_darwin10_13 = DownloadInfo
|
ghcup_017_64_darwin10_13 = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghcup/0.1.6/x86_64-apple-darwin-ghcup-0.1.6|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.7/x86_64-apple-darwin-ghcup-0.1.7|]
|
||||||
Nothing
|
Nothing
|
||||||
"1e025e66d7f7b75d94f17a7da6120efd7e2df918a8eac88c4711ed11d2aac4ec"
|
"00b2c04755d2b40e568afbfc2a485c36697fc55f210eae0d4cd80413c71032ed"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1130,6 +1166,7 @@ ghcupDownloads = M.fromList
|
|||||||
, (Just [vers|11|], ghc_822_64_freebsd11)
|
, (Just [vers|11|], ghc_822_64_freebsd11)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
, (Linux Alpine , M.fromList [(Nothing, ghc_822_64_alpine)])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
, ( A_32
|
, ( A_32
|
||||||
@@ -1321,6 +1358,7 @@ ghcupDownloads = M.fromList
|
|||||||
)
|
)
|
||||||
, (Darwin , M.fromList [(Nothing, ghc_844_64_darwin)])
|
, (Darwin , M.fromList [(Nothing, ghc_844_64_darwin)])
|
||||||
, (FreeBSD , M.fromList [(Nothing, ghc_844_64_freebsd)])
|
, (FreeBSD , M.fromList [(Nothing, ghc_844_64_freebsd)])
|
||||||
|
, (Linux Alpine, M.fromList [(Nothing, ghc_844_64_alpine)])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
, ( A_32
|
, ( A_32
|
||||||
@@ -1331,6 +1369,7 @@ ghcupDownloads = M.fromList
|
|||||||
, (Linux Ubuntu, M.fromList [(Nothing, ghc_844_32_deb8)])
|
, (Linux Ubuntu, M.fromList [(Nothing, ghc_844_32_deb8)])
|
||||||
, (Linux Mint , M.fromList [(Nothing, ghc_844_32_deb8)])
|
, (Linux Mint , M.fromList [(Nothing, ghc_844_32_deb8)])
|
||||||
, (Linux Debian, M.fromList [(Nothing, ghc_844_32_deb8)])
|
, (Linux Debian, M.fromList [(Nothing, ghc_844_32_deb8)])
|
||||||
|
, (Linux Alpine, M.fromList [(Nothing, ghc_844_32_alpine)])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -1575,6 +1614,7 @@ ghcupDownloads = M.fromList
|
|||||||
, (Linux Ubuntu, M.fromList [(Nothing, ghc_865_32_deb9)])
|
, (Linux Ubuntu, M.fromList [(Nothing, ghc_865_32_deb9)])
|
||||||
, (Linux Mint , M.fromList [(Nothing, ghc_865_32_deb9)])
|
, (Linux Mint , M.fromList [(Nothing, ghc_865_32_deb9)])
|
||||||
, (Linux Debian, M.fromList [(Nothing, ghc_865_32_deb9)])
|
, (Linux Debian, M.fromList [(Nothing, ghc_865_32_deb9)])
|
||||||
|
, (Linux Alpine, M.fromList [(Nothing, ghc_865_32_alpine)])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -1685,7 +1725,7 @@ ghcupDownloads = M.fromList
|
|||||||
)
|
)
|
||||||
, ( [vver|8.8.3|]
|
, ( [vver|8.8.3|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[Recommended, Base [pver|4.13.0.0|]]
|
[Base [pver|4.13.0.0|]]
|
||||||
(Just
|
(Just
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html|]
|
[uri|https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html|]
|
||||||
)
|
)
|
||||||
@@ -1738,7 +1778,7 @@ ghcupDownloads = M.fromList
|
|||||||
)
|
)
|
||||||
, ( [vver|8.8.4|]
|
, ( [vver|8.8.4|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[Base [pver|4.13.0.0|]]
|
[Recommended, Base [pver|4.13.0.0|]]
|
||||||
(Just
|
(Just
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.8.4/docs/html/users_guide/8.8.4-notes.html|]
|
[uri|https://downloads.haskell.org/~ghc/8.8.4/docs/html/users_guide/8.8.4-notes.html|]
|
||||||
)
|
)
|
||||||
@@ -1786,6 +1826,7 @@ ghcupDownloads = M.fromList
|
|||||||
, (Linux Ubuntu, M.fromList [(Nothing, ghc_884_32_deb9)])
|
, (Linux Ubuntu, M.fromList [(Nothing, ghc_884_32_deb9)])
|
||||||
, (Linux Mint , M.fromList [(Nothing, ghc_884_32_deb9)])
|
, (Linux Mint , M.fromList [(Nothing, ghc_884_32_deb9)])
|
||||||
, (Linux Debian, M.fromList [(Nothing, ghc_884_32_deb9)])
|
, (Linux Debian, M.fromList [(Nothing, ghc_884_32_deb9)])
|
||||||
|
, (Linux Alpine, M.fromList [(Nothing, ghc_884_32_alpine)])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -1856,6 +1897,7 @@ ghcupDownloads = M.fromList
|
|||||||
, (Just [vers|9|], ghc_8101_32_deb9)
|
, (Just [vers|9|], ghc_8101_32_deb9)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
, (Linux Alpine, M.fromList [(Nothing, ghc_8101_32_alpine)])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -1963,7 +2005,7 @@ ghcupDownloads = M.fromList
|
|||||||
)
|
)
|
||||||
, ( GHCup
|
, ( GHCup
|
||||||
, M.fromList
|
, M.fromList
|
||||||
[ ( [vver|0.1.6|]
|
[ ( [vver|0.1.7|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[Recommended, Latest]
|
[Recommended, Latest]
|
||||||
(Just
|
(Just
|
||||||
@@ -1974,16 +2016,16 @@ ghcupDownloads = M.fromList
|
|||||||
[ ( A_64
|
[ ( A_64
|
||||||
, M.fromList
|
, M.fromList
|
||||||
[ ( Linux UnknownLinux
|
[ ( Linux UnknownLinux
|
||||||
, M.fromList [(Nothing, ghcup_016_64_linux)]
|
, M.fromList [(Nothing, ghcup_017_64_linux)]
|
||||||
)
|
)
|
||||||
, (Darwin , M.fromList [(Nothing, ghcup_016_64_darwin10_13)])
|
, (Darwin , M.fromList [(Nothing, ghcup_017_64_darwin10_13)])
|
||||||
, (FreeBSD, M.fromList [(Nothing, ghcup_016_64_freebsd)])
|
, (FreeBSD, M.fromList [(Nothing, ghcup_017_64_freebsd)])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
, ( A_32
|
, ( A_32
|
||||||
, M.fromList
|
, M.fromList
|
||||||
[ ( Linux UnknownLinux
|
[ ( Linux UnknownLinux
|
||||||
, M.fromList [(Nothing, ghcup_016_32_linux)]
|
, M.fromList [(Nothing, ghcup_017_32_linux)]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -270,7 +270,10 @@ getDownloadInfo :: Tool
|
|||||||
getDownloadInfo t v (PlatformRequest a p mv) dls = maybe
|
getDownloadInfo t v (PlatformRequest a p mv) dls = maybe
|
||||||
(Left NoDownload)
|
(Left NoDownload)
|
||||||
Right
|
Right
|
||||||
(with_distro <|> without_distro_ver <|> without_distro)
|
(case p of
|
||||||
|
-- non-musl won't work on alpine
|
||||||
|
Linux Alpine -> with_distro <|> without_distro_ver
|
||||||
|
_ -> with_distro <|> without_distro_ver <|> without_distro)
|
||||||
|
|
||||||
where
|
where
|
||||||
with_distro = distro_preview id id
|
with_distro = distro_preview id id
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import GHCup.Utils.Prelude
|
|||||||
import GHCup.Types
|
import GHCup.Types
|
||||||
|
|
||||||
import Control.Concurrent
|
import Control.Concurrent
|
||||||
|
import Control.Concurrent.Async
|
||||||
import Control.Exception ( evaluate )
|
import Control.Exception ( evaluate )
|
||||||
import Control.Exception.Safe
|
import Control.Exception.Safe
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
@@ -57,14 +58,6 @@ import qualified "unix-bytestring" System.Posix.IO.ByteString
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- | Bool signals whether the regions should be cleaned.
|
|
||||||
data StopThread = StopThread Bool
|
|
||||||
deriving Show
|
|
||||||
|
|
||||||
instance Exception StopThread
|
|
||||||
|
|
||||||
|
|
||||||
data ProcessError = NonZeroExit Int ByteString [ByteString]
|
data ProcessError = NonZeroExit Int ByteString [ByteString]
|
||||||
| PTerminated ByteString [ByteString]
|
| PTerminated ByteString [ByteString]
|
||||||
| PStopped ByteString [ByteString]
|
| PStopped ByteString [ByteString]
|
||||||
@@ -131,10 +124,9 @@ execLogged exe spath args lfile chdir env = do
|
|||||||
pState <- newEmptyMVar
|
pState <- newEmptyMVar
|
||||||
done <- newEmptyMVar
|
done <- newEmptyMVar
|
||||||
void
|
void
|
||||||
$ forkOS
|
$ forkIO
|
||||||
$ EX.handle (\(_ :: StopThread) -> pure ())
|
|
||||||
$ EX.handle (\(_ :: IOException) -> pure ())
|
$ EX.handle (\(_ :: IOException) -> pure ())
|
||||||
$ flip finally (putMVar done ())
|
$ flip EX.finally (putMVar done ())
|
||||||
$ (if verbose
|
$ (if verbose
|
||||||
then tee fd stdoutRead
|
then tee fd stdoutRead
|
||||||
else printToRegion fd stdoutRead 6 pState
|
else printToRegion fd stdoutRead 6 pState
|
||||||
@@ -157,7 +149,7 @@ execLogged exe spath args lfile chdir env = do
|
|||||||
e <- toProcessError exe args <$!> SPPB.getProcessStatus True True pid
|
e <- toProcessError exe args <$!> SPPB.getProcessStatus True True pid
|
||||||
putMVar pState (either (const False) (const True) e)
|
putMVar pState (either (const False) (const True) e)
|
||||||
|
|
||||||
takeMVar done
|
void $ race (takeMVar done) (threadDelay (1000000 * 3))
|
||||||
closeFd stdoutRead
|
closeFd stdoutRead
|
||||||
|
|
||||||
pure e
|
pure e
|
||||||
@@ -225,33 +217,41 @@ execLogged exe spath args lfile chdir env = do
|
|||||||
| BS.length bs > w && w > 5 -> BS.take (w - 4) bs <> "..."
|
| BS.length bs > w && w > 5 -> BS.take (w - 4) bs <> "..."
|
||||||
| otherwise -> bs
|
| otherwise -> bs
|
||||||
|
|
||||||
-- read an entire line from the file descriptor (removes the newline char)
|
-- Consecutively read from Fd in 512 chunks until we hit
|
||||||
readLine :: MonadIO m => Fd -> ByteString -> m (ByteString, ByteString)
|
-- newline or EOF.
|
||||||
readLine fd = go
|
readLine :: MonadIO m
|
||||||
|
=> Fd -- ^ input file descriptor
|
||||||
|
-> ByteString -- ^ rest buffer (read across newline)
|
||||||
|
-> m (ByteString, ByteString, Bool) -- ^ (full line, rest, eof)
|
||||||
|
readLine fd = \inBs -> go inBs
|
||||||
where
|
where
|
||||||
go inBs = do
|
go inBs = do
|
||||||
bs <-
|
-- if buffer is not empty, process it first
|
||||||
liftIO
|
mbs <- if BS.length inBs == 0
|
||||||
$ handleIO (\e -> if isEOFError e then pure "" else ioError e)
|
-- otherwise attempt read
|
||||||
$ SPIB.fdRead fd 512
|
then liftIO
|
||||||
let nbs = BS.append inBs bs
|
$ handleIO (\e -> if isEOFError e then pure Nothing else ioError e)
|
||||||
(line, rest) = BS.span (/= _lf) nbs
|
$ fmap Just
|
||||||
if
|
$ SPIB.fdRead fd 512
|
||||||
| BS.length rest /= 0 -> pure (line, BS.tail rest)
|
else pure $ Just inBs
|
||||||
| BS.length line == 0 -> pure (mempty, mempty)
|
case mbs of
|
||||||
| otherwise -> (\(l, r) -> (line <> l, r)) <$!> go mempty
|
Nothing -> pure ("", "", True)
|
||||||
|
Just bs -> do
|
||||||
|
-- split on newline
|
||||||
|
let (line, rest) = BS.span (/= _lf) bs
|
||||||
|
if
|
||||||
|
| BS.length rest /= 0 -> pure (line, BS.tail rest, False)
|
||||||
|
-- if rest is empty, then there was no newline, process further
|
||||||
|
| otherwise -> (\(l, r, b) -> (line <> l, r, b)) <$!> go mempty
|
||||||
|
|
||||||
readTilEOF :: MonadIO m => (ByteString -> m a) -> Fd -> m ()
|
readTilEOF :: MonadIO m => (ByteString -> m a) -> Fd -> m ()
|
||||||
readTilEOF ~action' fd' = go mempty
|
readTilEOF ~action' fd' = go mempty
|
||||||
where
|
where
|
||||||
go bs' = do
|
go bs' = do
|
||||||
(bs, rest) <- readLine fd' bs'
|
(bs, rest, eof) <- readLine fd' bs'
|
||||||
if
|
if eof
|
||||||
| BS.length bs == 0 -> liftIO
|
then liftIO $ ioError (mkIOError eofErrorType "" Nothing Nothing)
|
||||||
$ ioError (mkIOError eofErrorType "" Nothing Nothing)
|
else (void $ action' bs) >> go rest
|
||||||
| otherwise -> do
|
|
||||||
void $ action' bs
|
|
||||||
go rest
|
|
||||||
|
|
||||||
|
|
||||||
-- | Capture the stdout and stderr of the given action, which
|
-- | Capture the stdout and stderr of the given action, which
|
||||||
@@ -288,13 +288,12 @@ captureOutStreams action = do
|
|||||||
done <- newEmptyMVar
|
done <- newEmptyMVar
|
||||||
_ <-
|
_ <-
|
||||||
forkIO
|
forkIO
|
||||||
$ EX.handle (\(_ :: StopThread) -> pure ())
|
|
||||||
$ EX.handle (\(_ :: IOException) -> pure ())
|
$ EX.handle (\(_ :: IOException) -> pure ())
|
||||||
$ flip finally (putMVar done ())
|
$ flip EX.finally (putMVar done ())
|
||||||
$ writeStds parentStdoutRead parentStderrRead refOut refErr
|
$ writeStds parentStdoutRead parentStderrRead refOut refErr
|
||||||
|
|
||||||
status <- SPPB.getProcessStatus True True pid
|
status <- SPPB.getProcessStatus True True pid
|
||||||
takeMVar done
|
void $ race (takeMVar done) (threadDelay (1000000 * 3))
|
||||||
|
|
||||||
case status of
|
case status of
|
||||||
-- readFd will take care of closing the fd
|
-- readFd will take care of closing the fd
|
||||||
@@ -314,13 +313,13 @@ captureOutStreams action = do
|
|||||||
void
|
void
|
||||||
$ forkIO
|
$ forkIO
|
||||||
$ hideError eofErrorType
|
$ hideError eofErrorType
|
||||||
$ flip finally (putMVar doneOut ())
|
$ flip EX.finally (putMVar doneOut ())
|
||||||
$ readTilEOF (\x -> modifyIORef' rout (<> x)) pout
|
$ readTilEOF (\x -> modifyIORef' rout (<> x)) pout
|
||||||
doneErr <- newEmptyMVar
|
doneErr <- newEmptyMVar
|
||||||
void
|
void
|
||||||
$ forkIO
|
$ forkIO
|
||||||
$ hideError eofErrorType
|
$ hideError eofErrorType
|
||||||
$ flip finally (putMVar doneErr ())
|
$ flip EX.finally (putMVar doneErr ())
|
||||||
$ readTilEOF (\x -> modifyIORef' rerr (<> x)) perr
|
$ readTilEOF (\x -> modifyIORef' rerr (<> x)) perr
|
||||||
takeMVar doneOut
|
takeMVar doneOut
|
||||||
takeMVar doneErr
|
takeMVar doneErr
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ ghcupURL :: URI
|
|||||||
ghcupURL = [uri|https://www.haskell.org/ghcup/data/ghcup-0.0.2.json|]
|
ghcupURL = [uri|https://www.haskell.org/ghcup/data/ghcup-0.0.2.json|]
|
||||||
|
|
||||||
ghcUpVer :: PVP
|
ghcUpVer :: PVP
|
||||||
ghcUpVer = [pver|0.1.6|]
|
ghcUpVer = [pver|0.1.8|]
|
||||||
|
|
||||||
numericVer :: String
|
numericVer :: String
|
||||||
numericVer = T.unpack . prettyPVP $ ghcUpVer
|
numericVer = T.unpack . prettyPVP $ ghcUpVer
|
||||||
|
|||||||
Reference in New Issue
Block a user