Compare commits

...

4 Commits

Author SHA1 Message Date
e4b0e8debf Use fixed bzlib 2024-03-11 17:31:57 +08:00
190d308ddf Bump ghcup to 0.1.22.0 2024-03-01 22:33:58 +08:00
4314146247 Merge remote-tracking branch 'origin/issue-1004' 2024-03-01 22:15:13 +08:00
be3db87410 Clean up on error, fixes #1004 2024-02-18 20:07:12 +08:00
15 changed files with 86 additions and 54 deletions

View File

@@ -1,5 +1,37 @@
# Revision history for ghcup # Revision history for ghcup
## 0.1.22.0 -- ????-??-??
### New features
* Beef up `--overwrite-version`, fixes [#998](https://github.com/haskell/ghcup-hs/issues/998)
* e.g. `ghcup compile hls -g master --overwrite-version='%v-%h' --ghc 9.4.8` will produce a binary called `haskell-language-server-wrapper-<version-from-cabal-file>-<short-git-commit-hash>`... refer to `ghcup compile hls --help` for more information
* Allow to set ghcup msys2 environment wrt [#982](https://github.com/haskell/ghcup-hs/issues/982)
* Add mechanism to warn on new metadata versions, fixes [#860](https://github.com/haskell/ghcup-hs/issues/860)
### Improvements and bug fixes
* Clean up on git clone errors, fixes [#1004](https://github.com/haskell/ghcup-hs/issues/1004)
* Error out on empty UserSettings wrt [#922](https://github.com/haskell/ghcup-hs/issues/922)
* Fix failure mode when metadata is garbage, fixes [#921](https://github.com/haskell/ghcup-hs/issues/921)
* Be less confusing when user tries to 'set' ghcup in TUI, fixes [#923](https://github.com/haskell/ghcup-hs/issues/923)
* Fix prefetch for cross bindists
* Fix misinterpretation of '+' in URI paths, fixes [#408](https://github.com/haskell/ghcup-hs/issues/408)
* Stricter (and better) file uri handling
* Set LD=ld.bfd on Alpine linux during bindist configure
* Add rocky/void detection
* Logging improvements
* Remove the "show all tool" config in the TUI
* Fix opening changelog on windows
* Don't remove share dir link prematurely
* Require user to explicitly choose subcommand for 'ghcup config'
* Don't download twice when trying stack decoding
### Refactoring and maintenance
* Large TUI code cleanup by @lsmor (Luis Morillo)... more coming up soon
* Allow building with `tar` instead of `libarchive` (mainly to make contributions easier)
## 0.1.20.0 -- 2023-11-10 ## 0.1.20.0 -- 2023-11-10
### New features ### New features

View File

@@ -10,7 +10,10 @@ else
flags: +tui +tar flags: +tui +tar
constraints: http-io-streams -brotli, constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0 any.aeson >= 2.0.1.0,
bzlib-conduit >= 0.3.0.3,
bz2 >= 1.0.1.1,
bzlib >= 0.5.2.0
if os(mingw32) if os(mingw32)
if impl(ghc >= 9.4) if impl(ghc >= 9.4)

View File

@@ -14,7 +14,7 @@ constraints: any.Cabal ==3.10.2.1,
aeson +ordered-keymap, aeson +ordered-keymap,
any.aeson-pretty ==0.8.10, any.aeson-pretty ==0.8.10,
aeson-pretty +lib-only, aeson-pretty +lib-only,
any.alex ==3.5.0.0, any.alex ==3.5.1.0,
any.ansi-terminal ==1.0.2, any.ansi-terminal ==1.0.2,
ansi-terminal -example, ansi-terminal -example,
any.ansi-terminal-types ==0.11.5, any.ansi-terminal-types ==0.11.5,
@@ -44,8 +44,9 @@ constraints: any.Cabal ==3.10.2.1,
any.brick ==2.1.1, any.brick ==2.1.1,
brick -demos, brick -demos,
any.bytestring ==0.11.5.3, any.bytestring ==0.11.5.3,
any.bz2 ==1.0.1.0, any.bz2 ==1.0.1.1,
bz2 -cross +with-bzlib, bz2 -cross +with-bzlib,
any.bzip2-clib ==1.0.8,
any.c2hs ==0.28.8, any.c2hs ==0.28.8,
c2hs +base3 -regression, c2hs +base3 -regression,
any.cabal-install-parsers ==0.6.1.1, any.cabal-install-parsers ==0.6.1.1,
@@ -241,7 +242,7 @@ constraints: any.Cabal ==3.10.2.1,
vector +boundschecks -internalchecks -unsafechecks -wall, vector +boundschecks -internalchecks -unsafechecks -wall,
any.vector-binary-instances ==0.2.5.2, any.vector-binary-instances ==0.2.5.2,
any.vector-stream ==0.1.0.1, any.vector-stream ==0.1.0.1,
any.versions ==6.0.5, any.versions ==6.0.6,
any.vty ==6.2, any.vty ==6.2,
any.vty-crossplatform ==0.4.0.0, any.vty-crossplatform ==0.4.0.0,
vty-crossplatform -demos, vty-crossplatform -demos,
@@ -255,4 +256,4 @@ constraints: any.Cabal ==3.10.2.1,
any.zlib ==0.6.3.0, any.zlib ==0.6.3.0,
zlib -bundled-c-zlib -non-blocking-ffi -pkg-config, zlib -bundled-c-zlib -non-blocking-ffi -pkg-config,
any.zlib-bindings ==0.1.1.5 any.zlib-bindings ==0.1.1.5
index-state: hackage.haskell.org 2024-02-18T14:07:35Z index-state: hackage.haskell.org 2024-03-10T10:13:56Z

View File

@@ -10,7 +10,10 @@ else
flags: +tui +tar flags: +tui +tar
constraints: http-io-streams -brotli, constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0 any.aeson >= 2.0.1.0,
bzlib-conduit >= 0.3.0.3,
bz2 >= 1.0.1.1,
bzlib >= 0.5.2.0
if os(mingw32) if os(mingw32)
if impl(ghc >= 9.4) if impl(ghc >= 9.4)

View File

@@ -14,7 +14,7 @@ constraints: any.Cabal ==3.10.2.1,
aeson +ordered-keymap, aeson +ordered-keymap,
any.aeson-pretty ==0.8.10, any.aeson-pretty ==0.8.10,
aeson-pretty +lib-only, aeson-pretty +lib-only,
any.alex ==3.5.0.0, any.alex ==3.5.1.0,
any.ansi-terminal ==1.0.2, any.ansi-terminal ==1.0.2,
ansi-terminal -example, ansi-terminal -example,
any.ansi-terminal-types ==0.11.5, any.ansi-terminal-types ==0.11.5,
@@ -47,9 +47,10 @@ constraints: any.Cabal ==3.10.2.1,
any.brick ==2.1.1, any.brick ==2.1.1,
brick -demos, brick -demos,
any.bytestring ==0.11.5.3, any.bytestring ==0.11.5.3,
any.bz2 ==1.0.1.0, any.bz2 ==1.0.1.1,
bz2 -cross +with-bzlib, bz2 -cross +with-bzlib,
any.bzlib-conduit ==0.3.0.2, any.bzip2-clib ==1.0.8,
any.bzlib-conduit ==0.3.0.3,
any.c2hs ==0.28.8, any.c2hs ==0.28.8,
c2hs +base3 -regression, c2hs +base3 -regression,
any.cabal-install-parsers ==0.6.1.1, any.cabal-install-parsers ==0.6.1.1,
@@ -140,7 +141,7 @@ constraints: any.Cabal ==3.10.2.1,
any.microlens-mtl ==0.2.0.3, any.microlens-mtl ==0.2.0.3,
any.microlens-th ==0.4.3.14, any.microlens-th ==0.4.3.14,
any.monad-control ==1.0.3.1, any.monad-control ==1.0.3.1,
any.mono-traversable ==1.0.15.3, any.mono-traversable ==1.0.17.0,
any.mtl ==2.2.2, any.mtl ==2.2.2,
any.mtl-compat ==0.2.2, any.mtl-compat ==0.2.2,
mtl-compat -two-point-one -two-point-two, mtl-compat -two-point-one -two-point-two,
@@ -250,7 +251,7 @@ constraints: any.Cabal ==3.10.2.1,
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
any.vector-binary-instances ==0.2.5.2, any.vector-binary-instances ==0.2.5.2,
any.vector-stream ==0.1.0.1, any.vector-stream ==0.1.0.1,
any.versions ==6.0.5, any.versions ==6.0.6,
any.vty ==6.2, any.vty ==6.2,
any.vty-crossplatform ==0.4.0.0, any.vty-crossplatform ==0.4.0.0,
vty-crossplatform -demos, vty-crossplatform -demos,
@@ -268,4 +269,4 @@ constraints: any.Cabal ==3.10.2.1,
any.zlib-bindings ==0.1.1.5, any.zlib-bindings ==0.1.1.5,
any.zstd ==0.1.3.0, any.zstd ==0.1.3.0,
zstd +standalone zstd +standalone
index-state: hackage.haskell.org 2024-02-18T14:07:35Z index-state: hackage.haskell.org 2024-03-10T10:13:56Z

View File

@@ -10,7 +10,10 @@ else
flags: +tui +tar flags: +tui +tar
constraints: http-io-streams -brotli, constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0 any.aeson >= 2.0.1.0,
bzlib-conduit >= 0.3.0.3,
bz2 >= 1.0.1.1,
bzlib >= 0.5.2.0
if os(mingw32) if os(mingw32)
if impl(ghc >= 9.4) if impl(ghc >= 9.4)

View File

@@ -14,7 +14,7 @@ constraints: any.Cabal ==3.10.2.1,
aeson +ordered-keymap, aeson +ordered-keymap,
any.aeson-pretty ==0.8.10, any.aeson-pretty ==0.8.10,
aeson-pretty +lib-only, aeson-pretty +lib-only,
any.alex ==3.5.0.0, any.alex ==3.5.1.0,
any.ansi-terminal ==1.0.2, any.ansi-terminal ==1.0.2,
ansi-terminal -example, ansi-terminal -example,
any.ansi-terminal-types ==0.11.5, any.ansi-terminal-types ==0.11.5,
@@ -47,9 +47,10 @@ constraints: any.Cabal ==3.10.2.1,
any.brick ==2.1.1, any.brick ==2.1.1,
brick -demos, brick -demos,
any.bytestring ==0.11.4.0, any.bytestring ==0.11.4.0,
any.bz2 ==1.0.1.0, any.bz2 ==1.0.1.1,
bz2 -cross +with-bzlib, bz2 -cross +with-bzlib,
any.bzlib-conduit ==0.3.0.2, any.bzip2-clib ==1.0.8,
any.bzlib-conduit ==0.3.0.3,
any.c2hs ==0.28.8, any.c2hs ==0.28.8,
c2hs +base3 -regression, c2hs +base3 -regression,
any.cabal-install-parsers ==0.6.1.1, any.cabal-install-parsers ==0.6.1.1,
@@ -140,7 +141,7 @@ constraints: any.Cabal ==3.10.2.1,
any.microlens-mtl ==0.2.0.3, any.microlens-mtl ==0.2.0.3,
any.microlens-th ==0.4.3.14, any.microlens-th ==0.4.3.14,
any.monad-control ==1.0.3.1, any.monad-control ==1.0.3.1,
any.mono-traversable ==1.0.15.3, any.mono-traversable ==1.0.17.0,
any.mtl ==2.2.2, any.mtl ==2.2.2,
any.mtl-compat ==0.2.2, any.mtl-compat ==0.2.2,
mtl-compat -two-point-one -two-point-two, mtl-compat -two-point-one -two-point-two,
@@ -249,7 +250,7 @@ constraints: any.Cabal ==3.10.2.1,
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
any.vector-binary-instances ==0.2.5.2, any.vector-binary-instances ==0.2.5.2,
any.vector-stream ==0.1.0.1, any.vector-stream ==0.1.0.1,
any.versions ==6.0.5, any.versions ==6.0.6,
any.vty ==6.2, any.vty ==6.2,
any.vty-crossplatform ==0.4.0.0, any.vty-crossplatform ==0.4.0.0,
vty-crossplatform -demos, vty-crossplatform -demos,
@@ -267,4 +268,4 @@ constraints: any.Cabal ==3.10.2.1,
any.zlib-bindings ==0.1.1.5, any.zlib-bindings ==0.1.1.5,
any.zstd ==0.1.3.0, any.zstd ==0.1.3.0,
zstd +standalone zstd +standalone
index-state: hackage.haskell.org 2024-02-18T14:07:35Z index-state: hackage.haskell.org 2024-03-10T10:13:56Z

View File

@@ -10,7 +10,10 @@ else
flags: +tui +tar flags: +tui +tar
constraints: http-io-streams -brotli, constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0 any.aeson >= 2.0.1.0,
bzlib-conduit >= 0.3.0.3,
bz2 >= 1.0.1.1,
bzlib >= 0.5.2.0
if os(mingw32) if os(mingw32)
if impl(ghc >= 9.4) if impl(ghc >= 9.4)

View File

@@ -14,7 +14,7 @@ constraints: any.Cabal ==3.10.2.1,
aeson +ordered-keymap, aeson +ordered-keymap,
any.aeson-pretty ==0.8.10, any.aeson-pretty ==0.8.10,
aeson-pretty +lib-only, aeson-pretty +lib-only,
any.alex ==3.5.0.0, any.alex ==3.5.1.0,
any.ansi-terminal ==1.0.2, any.ansi-terminal ==1.0.2,
ansi-terminal -example, ansi-terminal -example,
any.ansi-terminal-types ==0.11.5, any.ansi-terminal-types ==0.11.5,
@@ -47,9 +47,10 @@ constraints: any.Cabal ==3.10.2.1,
any.brick ==2.1.1, any.brick ==2.1.1,
brick -demos, brick -demos,
any.bytestring ==0.11.5.3, any.bytestring ==0.11.5.3,
any.bz2 ==1.0.1.0, any.bz2 ==1.0.1.1,
bz2 -cross +with-bzlib, bz2 -cross +with-bzlib,
any.bzlib-conduit ==0.3.0.2, any.bzip2-clib ==1.0.8,
any.bzlib-conduit ==0.3.0.3,
any.c2hs ==0.28.8, any.c2hs ==0.28.8,
c2hs +base3 -regression, c2hs +base3 -regression,
any.cabal-install-parsers ==0.6.1.1, any.cabal-install-parsers ==0.6.1.1,
@@ -139,7 +140,7 @@ constraints: any.Cabal ==3.10.2.1,
any.microlens-mtl ==0.2.0.3, any.microlens-mtl ==0.2.0.3,
any.microlens-th ==0.4.3.14, any.microlens-th ==0.4.3.14,
any.monad-control ==1.0.3.1, any.monad-control ==1.0.3.1,
any.mono-traversable ==1.0.15.3, any.mono-traversable ==1.0.17.0,
any.mtl ==2.2.2, any.mtl ==2.2.2,
any.mtl-compat ==0.2.2, any.mtl-compat ==0.2.2,
mtl-compat -two-point-one -two-point-two, mtl-compat -two-point-one -two-point-two,
@@ -248,7 +249,7 @@ constraints: any.Cabal ==3.10.2.1,
vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
any.vector-binary-instances ==0.2.5.2, any.vector-binary-instances ==0.2.5.2,
any.vector-stream ==0.1.0.1, any.vector-stream ==0.1.0.1,
any.versions ==6.0.5, any.versions ==6.0.6,
any.vty ==6.2, any.vty ==6.2,
any.vty-crossplatform ==0.4.0.0, any.vty-crossplatform ==0.4.0.0,
vty-crossplatform -demos, vty-crossplatform -demos,
@@ -266,4 +267,4 @@ constraints: any.Cabal ==3.10.2.1,
any.zlib-bindings ==0.1.1.5, any.zlib-bindings ==0.1.1.5,
any.zstd ==0.1.3.0, any.zstd ==0.1.3.0,
zstd +standalone zstd +standalone
index-state: hackage.haskell.org 2024-02-18T14:07:35Z index-state: hackage.haskell.org 2024-03-10T10:13:56Z

View File

@@ -10,7 +10,10 @@ else
flags: +tui +tar flags: +tui +tar
constraints: http-io-streams -brotli, constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0 any.aeson >= 2.0.1.0,
bzlib-conduit >= 0.3.0.3,
bz2 >= 1.0.1.1,
bzlib >= 0.5.2.0
if os(mingw32) if os(mingw32)
if impl(ghc >= 9.4) if impl(ghc >= 9.4)

View File

@@ -30,6 +30,9 @@ elif os(freebsd)
constraints: http-io-streams -brotli, constraints: http-io-streams -brotli,
any.aeson >= 2.0.1.0, any.aeson >= 2.0.1.0,
any.hsc2hs ==0.68.8, any.hsc2hs ==0.68.8,
bzlib-conduit >= 0.3.0.3,
bz2 >= 1.0.1.1,
bzlib >= 0.5.2.0
directory >= 1.3.8.3, directory >= 1.3.8.3,
filepath == 1.4.101.0 || == 1.4.300.1 || >= 1.5.2.0 filepath == 1.4.101.0 || == 1.4.300.1 || >= 1.5.2.0

View File

@@ -1,9 +1,9 @@
cabal-version: 2.4 cabal-version: 2.4
name: ghcup name: ghcup
version: 0.1.20.0 version: 0.1.22.0
license: LGPL-3.0-only license: LGPL-3.0-only
license-file: LICENSE license-file: LICENSE
copyright: Julian Ospald 2020 copyright: Julian Ospald 2024
maintainer: hasufell@posteo.de maintainer: hasufell@posteo.de
author: Julian Ospald author: Julian Ospald
homepage: https://github.com/haskell/ghcup-hs homepage: https://github.com/haskell/ghcup-hs
@@ -175,6 +175,7 @@ library
, base16-bytestring >=0.1.1.6 && <1.1 , base16-bytestring >=0.1.1.6 && <1.1
, binary ^>=0.8.6.0 , binary ^>=0.8.6.0
, bytestring >=0.10 && <0.12 , bytestring >=0.10 && <0.12
, bz2 ^>=1.0.1.1
, Cabal ^>=3.0.0.0 || ^>=3.2.0.0 || ^>=3.4.0.0 || ^>=3.6.0.0 || ^>=3.8.0.0 || ^>= 3.10.0.0 , Cabal ^>=3.0.0.0 || ^>=3.2.0.0 || ^>=3.4.0.0 || ^>=3.6.0.0 || ^>=3.8.0.0 || ^>= 3.10.0.0
, case-insensitive ^>=1.2.1.0 , case-insensitive ^>=1.2.1.0
, casing ^>=0.1.4.1 , casing ^>=0.1.4.1
@@ -244,7 +245,6 @@ library
-- GHCup.OptParse.Run uses this -- GHCup.OptParse.Run uses this
exposed-modules: GHCup.Prelude.Process.Windows exposed-modules: GHCup.Prelude.Process.Windows
build-depends: build-depends:
, bzlib
, process ^>=1.6.11.0 , process ^>=1.6.11.0
, Win32 >=2.10 , Win32 >=2.10
@@ -261,7 +261,6 @@ library
install-includes: dirutils.h install-includes: dirutils.h
c-sources: cbits/dirutils.c c-sources: cbits/dirutils.c
build-depends: build-depends:
, bz2 >=0.5.0.5 && <1.1
, terminal-size ^>=0.3.3 , terminal-size ^>=0.3.3
, unix ^>=2.7 || ^>=2.8 , unix ^>=2.7 || ^>=2.8
, unix-bytestring ^>=0.3.7.3 , unix-bytestring ^>=0.3.7.3

View File

@@ -908,7 +908,7 @@ compileGHC targetGhc crossTarget vps bstrap jobs mbuildConfig patches aargs buil
GitDist GitBranch{..} -> do GitDist GitBranch{..} -> do
tmpUnpack <- lift mkGhcupTmpDir tmpUnpack <- lift mkGhcupTmpDir
let git args = execLogged "git" ("--no-pager":args) (Just $ fromGHCupPath tmpUnpack) "git" Nothing let git args = execLogged "git" ("--no-pager":args) (Just $ fromGHCupPath tmpUnpack) "git" Nothing
(tver, ov) <- reThrowAll @_ @'[PatchFailed, ProcessError, NotFoundInPATH, DigestError, ContentLengthError, DownloadFailed, GPGError] DownloadFailed $ do (tver, ov) <- cleanUpOnError tmpUnpack $ reThrowAll @_ @'[PatchFailed, ProcessError, NotFoundInPATH, DigestError, ContentLengthError, DownloadFailed, GPGError] DownloadFailed $ do
let rep = fromMaybe "https://gitlab.haskell.org/ghc/ghc.git" repo let rep = fromMaybe "https://gitlab.haskell.org/ghc/ghc.git" repo
lift $ logInfo $ "Fetching git repo " <> T.pack rep <> " at ref " <> T.pack ref <> " (this may take a while)" lift $ logInfo $ "Fetching git repo " <> T.pack rep <> " at ref " <> T.pack ref <> " (this may take a while)"
lEM $ git [ "init" ] lEM $ git [ "init" ]

View File

@@ -437,7 +437,7 @@ compileHLS targetHLS ghcs jobs vps installDir cabalProject cabalProjectLocal upd
GitDist GitBranch{..} -> do GitDist GitBranch{..} -> do
tmpUnpack <- lift mkGhcupTmpDir tmpUnpack <- lift mkGhcupTmpDir
let git args = execLogged "git" ("--no-pager":args) (Just $ fromGHCupPath tmpUnpack) "git" Nothing let git args = execLogged "git" ("--no-pager":args) (Just $ fromGHCupPath tmpUnpack) "git" Nothing
reThrowAll @_ @'[ProcessError] DownloadFailed $ do cleanUpOnError tmpUnpack $ reThrowAll @_ @'[ProcessError] DownloadFailed $ do
let rep = fromMaybe "https://github.com/haskell/haskell-language-server.git" repo let rep = fromMaybe "https://github.com/haskell/haskell-language-server.git" repo
lift $ logInfo $ "Fetching git repo " <> T.pack rep <> " at ref " <> T.pack ref <> " (this may take a while)" lift $ logInfo $ "Fetching git repo " <> T.pack rep <> " at ref " <> T.pack ref <> " (this may take a while)"
lEM $ git [ "init" ] lEM $ git [ "init" ]

View File

@@ -1084,27 +1084,6 @@ cleanUpOnError bdir action = do
flip onException (lift exAction) $ onE_ exAction action flip onException (lift exAction) $ onE_ exAction action
-- | Clean up the given directory if the action fails,
-- depending on the Settings.
cleanFinally :: ( MonadReader env m
, HasDirs env
, HasSettings env
, MonadIO m
, MonadMask m
, HasLog env
, MonadUnliftIO m
, MonadFail m
, MonadCatch m
)
=> GHCupPath -- ^ build directory (cleaned up depending on Settings)
-> Excepts e m a
-> Excepts e m a
cleanFinally bdir action = do
Settings {..} <- lift getSettings
let exAction = when (keepDirs == Never) $ rmBDir bdir
flip finally (lift exAction) $ onE_ exAction action
-- | Remove a build directory, ignoring if it doesn't exist and gracefully -- | Remove a build directory, ignoring if it doesn't exist and gracefully
-- printing other errors without crashing. -- printing other errors without crashing.
rmBDir :: (MonadReader env m, HasLog env, MonadUnliftIO m, MonadIO m) => GHCupPath -> m () rmBDir :: (MonadReader env m, HasLog env, MonadUnliftIO m, MonadIO m) => GHCupPath -> m ()