Compare commits

...

10 Commits

Author SHA1 Message Date
68df6b8e50 Update ghcup URIs 2020-04-13 21:11:26 +02:00
ac73090784 Improve HACKING.md 2020-04-13 21:11:00 +02:00
faf4f3b7ca Rm foo 2020-04-13 17:13:47 +02:00
d888d11d59 Allow to control prettiness of JSON output 2020-04-13 15:25:50 +02:00
28a1077833 Add i386 ghcup binary 2020-04-13 15:25:43 +02:00
c40b9dbc0b Fix darwin 10.14 tarball, thanks to carter 2020-04-13 15:21:47 +02:00
6bbd262818 Update TODO 2020-04-13 15:21:16 +02:00
78d36bce24 Update hacking doc 2020-04-13 15:20:56 +02:00
aedfc19220 Remove homebrew trash 2020-04-12 21:50:07 +02:00
2f34fc7bef Update downloads 2020-04-12 21:32:07 +02:00
8 changed files with 89 additions and 2253 deletions

View File

@@ -4,29 +4,11 @@ jobs:
osx_image: xcode10.1
language: generic
env: ARTIFACT=x86_64-apple-darwin-10.13-ghcup
addons:
homebrew:
packages:
- curl
- libffi
- libiconv
- make
- ncurses
- xz
- os: osx
osx_image: xcode11.3
language: generic
env: ARTIFACT=x86_64-apple-darwin-10.14-ghcup
addons:
homebrew:
packages:
- curl
- libffi
- libiconv
- make
- ncurses
- xz
script: ".travis/build.sh"

View File

@@ -16,7 +16,23 @@ I consider haskell-TLS an interesting experiment, but not a battle-tested and pe
### Optics instead of lens
They're a little safer (less Monoid weirdness with view) and have better error messages. Consider: `view (_Just . to (++ "abc")) Nothing` (lens) vs `view (_Just % to (++ "abc")) Nothing` (optics). The latter does not compile (good).
They're a little safer (less Monoid weirdness with view) and have better error messages. Consider the following wit lens
```
> view (_Just . to (++ "abc")) Nothing
""
```
vs optics
```
> view (_Just % to (++ "abc")) Nothing
<interactive>:2:1: error:
• An_AffineFold cannot be used as A_Getter
• In the expression: view (_Just % to (++ "abc")) Nothing
In an equation for it: it = view (_Just % to (++ "abc")) Nothing
```
### Strict and StrictData on by default

22
TODO.md
View File

@@ -2,23 +2,10 @@
## Now
* travis
* ghcup migration
* update static links
* requirements
* for ghcup (bootstrap script)
* per tool
* mac build: xattr -cr .
* static binaries
* upgrade plan from old ghcup
* bootstrap-haskell with new ghcup
* add warning to ghcup script about new binary
* make sure smart-dl is not broken
* handle SIGINT better (remove dirs)
* review symlink handling (maybe fixed set of tools?)
* releases, update download info and bootstrap-haskell
## Maybe
@@ -28,16 +15,17 @@
## Later
* i386 support
* add support for RC/alpha/HEAD versions
## Cleanups
* too many decodeutf8
* avoid alternative for IO
* use plucky or oops instead of Excepts
## Questions
* fully static musl builds for linux?
* mirror support
* interactive handling when distro doesn't exist and we know the tarball is incompatible?
* ghcup-with wrapper to execute a command with a given ghc in PATH?

View File

@@ -984,33 +984,34 @@ cabal_3200_64_darwin = DownloadInfo
-------------
ghcup_010_32_linux :: DownloadInfo
ghcup_010_32_linux = DownloadInfo
[uri|https://downloads.haskell.org/~ghcup/i386-linux-ghcup|]
Nothing
"ce95fd3044ea249c2ea02e122112a787d710cc4be2dcf1e78d8c68b540a70920"
ghcup_010_64_linux :: DownloadInfo
ghcup_010_64_linux = DownloadInfo
[uri|https://github.com/hasufell/ghcup-hs/releases/download/v0.1.0/x86_64-linux-ghcup-0.1.0|]
[uri|https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup|]
Nothing
"b2dc576926c74336805a30c647056eeb1b4204742bcfc5c51680d4e7c34b87a1"
"9281da4d8db628bbfbf1d3f3b748a2556f828cc60308559bc87c5d657cb06bdf"
ghcup_010_64_freebsd :: DownloadInfo
ghcup_010_64_freebsd = DownloadInfo
[uri|https://github.com/hasufell/ghcup-hs/releases/download/v0.1.0/x86_64-portbld-freebsd-ghcup-0.1.0|]
[uri|https://downloads.haskell.org/~ghcup/x86_64-portbld-freebsd-ghcup|]
Nothing
"d300e36beb63eb5199169b669cc0550e581d871f404f2ce1a2581829c1d2f431"
"992a375cc4d296a9ceed3712b8bb329a0ac605a614b5a9b8a5f3dba05183d2a5"
ghcup_010_64_darwin10_13 :: DownloadInfo
ghcup_010_64_darwin10_13 = DownloadInfo
[uri|https://github.com/hasufell/ghcup-hs/releases/download/v0.1.0/x86_64-apple-darwin-10.13-ghcup-0.1.0|]
[uri|https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup|]
Nothing
"3f8fd787c25f6b9b990c968f79c423036155733d7ec8531a84e2cda874e26a32"
"adeaa6943611cf68c0c8224037788eac2a84a9136c59685eaea28ed16f3953c7"
ghcup_010_64_darwin10_14 :: DownloadInfo
ghcup_010_64_darwin10_14 = DownloadInfo
[uri|https://github.com/hasufell/ghcup-hs/releases/download/v0.1.0/x86_64-apple-darwin-10.14-ghcup-0.1.0|]
Nothing
"f89fadbecabae0aeb97ed33687c133845dffc0530a9a71a408024e6bbebf46c9"
@@ -1881,17 +1882,14 @@ ghcupDownloads = M.fromList
[ ( A_64
, M.fromList
[ (Linux UnknownLinux, M.fromList [(Nothing, ghcup_010_64_linux)])
, ( Darwin
, M.fromList
[ (Nothing , ghcup_010_64_darwin10_13)
, (Just [vers|10.13|], ghcup_010_64_darwin10_13)
, (Just [vers|10.14|], ghcup_010_64_darwin10_14)
, (Just [vers|10.15|], ghcup_010_64_darwin10_14)
]
)
, (Darwin, M.fromList [(Nothing, ghcup_010_64_darwin10_13)])
, (FreeBSD, M.fromList [(Nothing, ghcup_010_64_freebsd)])
]
)
, ( A_32
, M.fromList
[(Linux UnknownLinux, M.fromList [(Nothing, ghcup_010_32_linux)])]
)
]
)
]

View File

@@ -1,10 +1,11 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Main where
@@ -14,7 +15,7 @@ import GHCup.Types.JSON ( )
import GHCup.Utils.Logger
import GHCupInfo
import Data.Aeson ( eitherDecode )
import Data.Aeson ( eitherDecode, encode )
import Data.Aeson.Encode.Pretty
#if !MIN_VERSION_base(4,13,0)
import Data.Semigroup ( (<>) )
@@ -61,10 +62,13 @@ outputP = fileOutput <|> stdOutput
data GenJSONOpts = GenJSONOpts
{ output :: Maybe Output
, pretty :: Bool
}
genJSONOpts :: Parser GenJSONOpts
genJSONOpts = GenJSONOpts <$> optional outputP
genJSONOpts = GenJSONOpts <$> optional outputP <*> switch
(short 'p' <> long "pretty" <> help "Make JSON output pretty (human readable)"
)
data Input
@@ -134,14 +138,16 @@ main = do
customExecParser (prefs showHelpOnError) (info (opts <**> helper) idm)
>>= \Options {..} -> case optCommand of
GenJSON gopts -> do
let
bs = encodePretty' (defConfig { confIndent = Spaces 2 })
ghcupInfo
let bs True =
encodePretty' (defConfig { confIndent = Spaces 2 }) ghcupInfo
bs False = encode ghcupInfo
case gopts of
GenJSONOpts { output = Nothing } -> L.hPutStr stdout bs
GenJSONOpts { output = Just StdOutput } -> L.hPutStr stdout bs
GenJSONOpts { output = Just (FileOutput file) } ->
L.writeFile file bs
GenJSONOpts { output = Nothing, pretty } ->
L.hPutStr stdout (bs pretty)
GenJSONOpts { output = Just StdOutput, pretty } ->
L.hPutStr stdout (bs pretty)
GenJSONOpts { output = Just (FileOutput file), pretty } ->
L.writeFile file (bs pretty)
ValidateJSON vopts -> case vopts of
ValidateJSONOpts { input = Nothing } ->
L.getContents >>= valAndExit validate
@@ -165,4 +171,3 @@ main = do
Left e -> die (color Red $ show e)
myLoggerT (LoggerConfig True (B.hPut stdout) (\_ -> pure ())) (f av)
>>= exitWith

View File

@@ -27,31 +27,42 @@ download_ghcup() {
_plat="$(uname -s)"
_arch=$(uname -m)
case "${_arch}" in
x86_64|amd64)
;;
i*86)
die "i386 currently not supported!"
;;
*) die "Unknown architecture: ${_arch}"
;;
esac
case "${_plat}" in
"linux"|"Linux")
_url=https://www.haskell.org/ghcup/bin/x86_64-linux-ghcup
case "${_arch}" in
x86_64|amd64)
_url=https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup
;;
i*86)
_url=https://downloads.haskell.org/~ghcup/i386-linux-ghcup
;;
*) die "Unknown architecture: ${_arch}"
;;
esac
;;
"FreeBSD"|"freebsd")
_url=https://www.haskell.org/ghcup/bin/x86_64-portbld-freebsd-ghcup
case "${_arch}" in
x86_64|amd64)
;;
i*86)
die "i386 currently not supported!"
;;
*) die "Unknown architecture: ${_arch}"
;;
esac
_url=https://downloads.haskell.org/~ghcup/x86_64-portbld-freebsd-ghcup
;;
"Darwin"|"darwin")
case "$(sw_vers -productVersion || echo "none")" in
10.15.*) _url=https://www.haskell.org/ghcup/bin/x86_64-apple-darwin-10.14-ghcup ;;
10.14.*) _url=https://www.haskell.org/ghcup/bin/x86_64-apple-darwin-10.14-ghcup ;;
10.13.*) _url=https://www.haskell.org/ghcup/bin/x86_64-apple-darwin-10.13-ghcup ;;
*) _url=https://www.haskell.org/ghcup/bin/x86_64-apple-darwin-10.13-ghcup ;;
case "${_arch}" in
x86_64|amd64)
;;
i*86)
die "i386 currently not supported!"
;;
*) die "Unknown architecture: ${_arch}"
;;
esac
;;
_url=https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup ;;
*) die "Unknown platform: ${_plat}"
;;
esac

0
foo
View File

File diff suppressed because one or more lines are too long