Compare commits

..

22 Commits

Author SHA1 Message Date
f084fbce43 Fix f*ckup in docker image creation 2023-03-14 20:56:03 +08:00
c20deceaa8 Improve wording around FreeBSD support 2023-03-11 21:26:16 +08:00
89e4145baf Merge remote-tracking branch 'origin/pr/805' 2023-03-11 21:23:31 +08:00
Alexey Vyskubov
f5f7c26d8a Adds some information about FreeBSD installation. 2023-03-07 13:01:20 +02:00
784942ca58 Update submodule 2023-02-24 20:03:25 +08:00
75de2a7bc1 Merge branch 'ghcup-0.1.19.2' 2023-02-24 20:03:14 +08:00
ea6c8d338c Bump ghcup in bootstrap script 2023-02-24 19:52:50 +08:00
ae625b181c Improve pull_release_artifacts 2023-02-24 19:52:41 +08:00
89ae54a083 Set release date 2023-02-24 00:00:29 +08:00
1bd73591ba Update data/metadata 2023-02-23 23:58:16 +08:00
f709f6e714 Update ChangeLog 2023-02-23 23:56:46 +08:00
3d7e07c371 Merge branch 'issue-796' 2023-02-23 23:52:38 +08:00
8bf17379ac Fix windows bootstrap, fixes #796 2023-02-23 23:41:25 +08:00
4b1225ad71 Merge branch 'issue-797' 2023-02-23 23:15:48 +08:00
d628848af6 Silence hlint 2023-02-23 23:15:08 +08:00
48381be001 Bump GHC 9.2.5 to 9.2.6 2023-02-23 23:07:46 +08:00
b547324253 Smarter variants for 'listDirectory', fixing #797 2023-02-23 21:47:50 +08:00
2b1599c234 Fix windows golden file 2023-02-23 20:57:40 +08:00
7ac8989dfc Bump to 0.1.19.2 2023-02-21 23:01:08 +08:00
cd6666ed30 Merge branch 'latest-prerelease' 2023-02-21 23:00:47 +08:00
5b7478438a Merge branch 'issue-787' 2023-02-21 23:00:31 +08:00
785fb895b4 Implement 'latest-prerelease' tag wrt #788 2023-02-21 22:22:11 +08:00
17 changed files with 180 additions and 121 deletions

View File

@@ -51,5 +51,8 @@ jobs:
- if: runner.os == 'Windows' - if: runner.os == 'Windows'
name: Run bootstrap name: Run bootstrap
run: ./scripts/bootstrap/bootstrap-haskell.ps1 -InstallDir ${GITHUB_WORKSPACE} -BootstrapUrl ${GITHUB_WORKSPACE}/bootstrap-haskell -InBash run: |
$curDir = Get-Location
Write-Host "Current Working Directory: $curDir"
./scripts/bootstrap/bootstrap-haskell.ps1 -InstallDir ${GITHUB_WORKSPACE} -BootstrapUrl ("{0}/scripts/bootstrap/bootstrap-haskell" -f $curDir) -InBash
shell: pwsh shell: pwsh

View File

@@ -53,7 +53,7 @@ jobs:
platforms: linux/amd64 platforms: linux/amd64
docker-arm32: docker-arm32:
runs-on: [self-hosted, Linux, ARM64, aarch32-linux] runs-on: [self-hosted, Linux, ARM64]
steps: steps:
- uses: docker://arm64v8/ubuntu:focal - uses: docker://arm64v8/ubuntu:focal
name: Cleanup (aarch64 linux) name: Cleanup (aarch64 linux)
@@ -85,7 +85,7 @@ jobs:
with: with:
context: ./docker/arm32v7/focal context: ./docker/arm32v7/focal
push: true push: true
tags: hasufell/arm32v7-debian-haskell:10 tags: hasufell/arm32v7-ubuntu-haskell:focal
platforms: linux/arm platforms: linux/arm
docker-aarch: docker-aarch:
@@ -121,5 +121,5 @@ jobs:
with: with:
context: ./docker/arm64v8/focal context: ./docker/arm64v8/focal
push: true push: true
tags: hasufell/arm64v8-debian-haskell:10 tags: hasufell/arm64v8-ubuntu-haskell:focal
platforms: linux/arm64 platforms: linux/arm64

View File

@@ -96,7 +96,7 @@ jobs:
ARCH: ARM ARCH: ARM
- os: [self-hosted, Linux, ARM64] - os: [self-hosted, Linux, ARM64]
ARTIFACT: "aarch64-linux-ghcup" ARTIFACT: "aarch64-linux-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
steps: steps:
- uses: docker://arm64v8/debian:10 - uses: docker://arm64v8/debian:10
@@ -166,11 +166,11 @@ jobs:
include: include:
- os: [self-hosted, macOS, ARM64] - os: [self-hosted, macOS, ARM64]
ARTIFACT: "aarch64-apple-darwin-ghcup" ARTIFACT: "aarch64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
- os: macOS-10.15 - os: macOS-10.15
ARTIFACT: "x86_64-apple-darwin-ghcup" ARTIFACT: "x86_64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: 64 ARCH: 64
- os: windows-latest - os: windows-latest
ARTIFACT: "x86_64-mingw64-ghcup" ARTIFACT: "x86_64-mingw64-ghcup"
@@ -337,7 +337,7 @@ jobs:
DISTRO: Ubuntu DISTRO: Ubuntu
- os: [self-hosted, Linux, ARM64] - os: [self-hosted, Linux, ARM64]
ARTIFACT: "aarch64-linux-ghcup" ARTIFACT: "aarch64-linux-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
DISTRO: Ubuntu DISTRO: Ubuntu
@@ -400,12 +400,12 @@ jobs:
include: include:
- os: [self-hosted, macOS, ARM64] - os: [self-hosted, macOS, ARM64]
ARTIFACT: "aarch64-apple-darwin-ghcup" ARTIFACT: "aarch64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: ARM64 ARCH: ARM64
DISTRO: na DISTRO: na
- os: macOS-10.15 - os: macOS-10.15
ARTIFACT: "x86_64-apple-darwin-ghcup" ARTIFACT: "x86_64-apple-darwin-ghcup"
GHC_VER: 9.2.5 GHC_VER: 9.2.6
ARCH: 64 ARCH: 64
DISTRO: na DISTRO: na
- os: windows-latest - os: windows-latest

View File

@@ -1,5 +1,12 @@
# Revision history for ghcup # Revision history for ghcup
## 0.1.19.2 -- 2023-2-24
* Follow-up fix for JFS/ReiserFS and other filesystem that don't support `d_type`, fixes [#787](https://github.com/haskell/ghcup-hs/issues/787)
- the previous release had a bug that invalidated that broke it
* Implement 'latest-prerelease' tag wrt [#788](https://github.com/haskell/ghcup-hs/issues/788)
* Fix 'Could not parse version of stray directory.DS_Store' warnings on macOs wrt [#797](https://github.com/haskell/ghcup-hs/issues/797)
## 0.1.19.1 -- 2023-2-19 ## 0.1.19.1 -- 2023-2-19
* Fix GHCup on JFS/ReiserFS and other filesystem that don't support `d_type`, fixes [#766](https://github.com/haskell/ghcup-hs/issues/766) * Fix GHCup on JFS/ReiserFS and other filesystem that don't support `d_type`, fixes [#766](https://github.com/haskell/ghcup-hs/issues/766)

View File

@@ -4,6 +4,7 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeApplications #-}
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
module BrickMain where module BrickMain where
@@ -154,8 +155,11 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
<+> minHSize 15 (str "Version") <+> minHSize 15 (str "Version")
<+> padLeft (Pad 1) (minHSize 25 $ str "Tags") <+> padLeft (Pad 1) (minHSize 25 $ str "Tags")
<+> padLeft (Pad 5) (str "Notes") <+> padLeft (Pad 5) (str "Notes")
renderList' = withDefAttr listAttr . drawListElements renderItem True renderList' bis@BrickInternalState{..} =
renderItem _ b listResult@ListResult{..} = let getMinLength = length . intercalate "," . fmap tagToString
minLength = V.maximum $ V.map (getMinLength . lTag) clr
in withDefAttr listAttr . drawListElements (renderItem minLength) True $ bis
renderItem minTagSize _ b listResult@ListResult{lTag = lTag', ..} =
let marks = if let marks = if
| lSet -> (withAttr (attrName "set") $ str "✔✔") | lSet -> (withAttr (attrName "set") $ str "✔✔")
| lInstalled -> (withAttr (attrName "installed") $ str "") | lInstalled -> (withAttr (attrName "installed") $ str "")
@@ -170,7 +174,7 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
= updateAttrMap (const dimAttrs) . withAttr (attrName "no-bindist") = updateAttrMap (const dimAttrs) . withAttr (attrName "no-bindist")
| otherwise = id | otherwise = id
hooray hooray
| elem Latest lTag && not lInstalled = | elem Latest lTag' && not lInstalled =
withAttr (attrName "hooray") withAttr (attrName "hooray")
| otherwise = id | otherwise = id
active = if b then putCursor "GHCup" (Location (0,0)) . forceAttr (attrName "active") else id active = if b then putCursor "GHCup" (Location (0,0)) . forceAttr (attrName "active") else id
@@ -181,8 +185,8 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
(printTool lTool) (printTool lTool)
) )
<+> minHSize 15 (str ver) <+> minHSize 15 (str ver)
<+> (let l = catMaybes . fmap printTag $ sort lTag <+> (let l = catMaybes . fmap printTag $ sort lTag'
in padLeft (Pad 1) $ minHSize 25 $ if null l in padLeft (Pad 1) $ minHSize minTagSize $ if null l
then emptyWidget then emptyWidget
else foldr1 (\x y -> x <+> str "," <+> y) l else foldr1 (\x y -> x <+> str "," <+> y) l
) )
@@ -200,6 +204,7 @@ ui dimAttrs BrickState{ appSettings = as@BrickSettings{}, ..}
printTag Prerelease = Just $ withAttr (attrName "prerelease") $ str "prerelease" printTag Prerelease = Just $ withAttr (attrName "prerelease") $ str "prerelease"
printTag (Base pvp'') = Just $ str ("base-" ++ T.unpack (prettyPVP pvp'')) printTag (Base pvp'') = Just $ str ("base-" ++ T.unpack (prettyPVP pvp''))
printTag Old = Nothing printTag Old = Nothing
printTag LatestPrerelease = Just $ withAttr (attrName "latest-prerelease") $ str "latest-prerelease"
printTag (UnknownTag t) = Just $ str t printTag (UnknownTag t) = Just $ str t
printTool Cabal = str "cabal" printTool Cabal = str "cabal"
@@ -274,6 +279,7 @@ defaultAttributes no_color = attrMap
, (attrName "recommended" , Vty.defAttr `withForeColor` Vty.green) , (attrName "recommended" , Vty.defAttr `withForeColor` Vty.green)
, (attrName "hls-powered" , Vty.defAttr `withForeColor` Vty.green) , (attrName "hls-powered" , Vty.defAttr `withForeColor` Vty.green)
, (attrName "latest" , Vty.defAttr `withForeColor` Vty.yellow) , (attrName "latest" , Vty.defAttr `withForeColor` Vty.yellow)
, (attrName "latest-prerelease" , Vty.defAttr `withForeColor` Vty.red)
, (attrName "prerelease" , Vty.defAttr `withForeColor` Vty.red) , (attrName "prerelease" , Vty.defAttr `withForeColor` Vty.red)
, (attrName "compiled" , Vty.defAttr `withForeColor` Vty.blue) , (attrName "compiled" , Vty.defAttr `withForeColor` Vty.blue)
, (attrName "stray" , Vty.defAttr `withForeColor` Vty.blue) , (attrName "stray" , Vty.defAttr `withForeColor` Vty.blue)

View File

@@ -246,8 +246,9 @@ toolVersionTagEither s' =
tagEither :: String -> Either String Tag tagEither :: String -> Either String Tag
tagEither s' = case fmap toLower s' of tagEither s' = case fmap toLower s' of
"recommended" -> Right Recommended "recommended" -> Right Recommended
"latest" -> Right Latest "latest" -> Right Latest
"latest-prerelease" -> Right LatestPrerelease
('b':'a':'s':'e':'-':ver') -> case pvp (T.pack ver') of ('b':'a':'s':'e':'-':ver') -> case pvp (T.pack ver') of
Right x -> Right (Base x) Right x -> Right (Base x)
Left _ -> Left $ "Invalid PVP version for base " <> ver' Left _ -> Left $ "Invalid PVP version for base " <> ver'
@@ -452,7 +453,7 @@ tagCompleter tool add = listIOCompleter $ do
let allTags = filter (/= Old) let allTags = filter (/= Old)
$ _viTags =<< M.elems (availableToolVersions (_ghcupDownloads ghcupInfo) tool) $ _viTags =<< M.elems (availableToolVersions (_ghcupDownloads ghcupInfo) tool)
pure $ nub $ (add ++) $ fmap tagToString allTags pure $ nub $ (add ++) $ fmap tagToString allTags
VLeft _ -> pure (nub $ ["recommended", "latest"] ++ add) VLeft _ -> pure (nub $ ["recommended", "latest", "latest-prerelease"] ++ add)
versionCompleter :: Maybe ListCriteria -> Tool -> Completer versionCompleter :: Maybe ListCriteria -> Tool -> Completer
versionCompleter criteria tool = versionCompleter' criteria tool (const True) versionCompleter criteria tool = versionCompleter' criteria tool (const True)
@@ -706,6 +707,9 @@ fromVersion' (SetToolVersion v) tool = do
fromVersion' (SetToolTag Latest) tool = do fromVersion' (SetToolTag Latest) tool = do
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
bimap mkTVer Just <$> getLatest dls tool ?? TagNotFound Latest tool bimap mkTVer Just <$> getLatest dls tool ?? TagNotFound Latest tool
fromVersion' (SetToolTag LatestPrerelease) tool = do
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
bimap mkTVer Just <$> getLatestPrerelease dls tool ?? TagNotFound LatestPrerelease tool
fromVersion' (SetToolTag Recommended) tool = do fromVersion' (SetToolTag Recommended) tool = do
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
bimap mkTVer Just <$> getRecommended dls tool ?? TagNotFound Recommended tool bimap mkTVer Just <$> getRecommended dls tool ?? TagNotFound Recommended tool

View File

@@ -107,6 +107,7 @@ printListResult no_color raw lr = do
printTag Prerelease = color Red "prerelease" printTag Prerelease = color Red "prerelease"
printTag (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'') printTag (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'')
printTag (UnknownTag t ) = t printTag (UnknownTag t ) = t
printTag LatestPrerelease = color Red "latest-prerelease"
printTag Old = "" printTag Old = ""
let let

View File

@@ -77,6 +77,8 @@ On Darwin M1 you might also need a working llvm installed (e.g. via brew) and ha
The following distro packages are required: `curl gcc gmp gmake ncurses perl5 libffi libiconv` The following distro packages are required: `curl gcc gmp gmake ncurses perl5 libffi libiconv`
Notice that only FreeBSD 13.x is supported. If the installation fails, complaining about `libncursesw.8.so`, you will need to install FreeBSD 12 compat package first, for example, `pkg install misc/compat12x`.
### Windows ### Windows
On Windows, msys2 should already have been set up during the installation, so most users should just proceed. If you are installing manually, make sure to have a working mingw64 toolchain and shell. On Windows, msys2 should already have been set up during the installation, so most users should just proceed. If you are installing manually, make sure to have a working mingw64 toolchain and shell.
@@ -231,8 +233,9 @@ There are various issues with GHC itself.
### FreeBSD ### FreeBSD
Lacks some upstream bindists and may need compat libs, since most bindists are built on FreeBSD-12. Lacks some upstream bindists and may need compat libs (such as `misc/compat12x`).
HLS bindists are experimental. HLS bindists are experimental.
Only latest FreeBSD is generally supported.
### Linux ARMv7/AARCH64 ### Linux ARMv7/AARCH64

View File

@@ -1,6 +1,6 @@
cabal-version: 2.4 cabal-version: 2.4
name: ghcup name: ghcup
version: 0.1.19.1 version: 0.1.19.2
license: LGPL-3.0-only license: LGPL-3.0-only
license-file: LICENSE license-file: LICENSE
copyright: Julian Ospald 2020 copyright: Julian Ospald 2020

View File

@@ -154,6 +154,7 @@ instance NFData VersionInfo
data Tag = Latest data Tag = Latest
| Recommended | Recommended
| Prerelease | Prerelease
| LatestPrerelease
| Base PVP | Base PVP
| Old -- ^ old versions are hidden by default in TUI | Old -- ^ old versions are hidden by default in TUI
| UnknownTag String -- ^ used for upwardscompat | UnknownTag String -- ^ used for upwardscompat
@@ -167,6 +168,7 @@ tagToString Latest = "latest"
tagToString Prerelease = "prerelease" tagToString Prerelease = "prerelease"
tagToString (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'') tagToString (Base pvp'') = "base-" ++ T.unpack (prettyPVP pvp'')
tagToString (UnknownTag t ) = t tagToString (UnknownTag t ) = t
tagToString LatestPrerelease = "latest-prerelease"
tagToString Old = "" tagToString Old = ""
instance Pretty Tag where instance Pretty Tag where
@@ -175,6 +177,7 @@ instance Pretty Tag where
pPrint Prerelease = text "prerelease" pPrint Prerelease = text "prerelease"
pPrint (Base pvp'') = text ("base-" ++ T.unpack (prettyPVP pvp'')) pPrint (Base pvp'') = text ("base-" ++ T.unpack (prettyPVP pvp''))
pPrint (UnknownTag t ) = text t pPrint (UnknownTag t ) = text t
pPrint LatestPrerelease = text "latest-prerelease"
pPrint Old = mempty pPrint Old = mempty
data Architecture = A_64 data Architecture = A_64

View File

@@ -66,6 +66,7 @@ instance ToJSON Tag where
toJSON Prerelease = String "Prerelease" toJSON Prerelease = String "Prerelease"
toJSON Old = String "old" toJSON Old = String "old"
toJSON (Base pvp'') = String ("base-" <> prettyPVP pvp'') toJSON (Base pvp'') = String ("base-" <> prettyPVP pvp'')
toJSON LatestPrerelease = String "LatestPrerelease"
toJSON (UnknownTag x ) = String (T.pack x) toJSON (UnknownTag x ) = String (T.pack x)
instance FromJSON Tag where instance FromJSON Tag where
@@ -73,6 +74,7 @@ instance FromJSON Tag where
"Latest" -> pure Latest "Latest" -> pure Latest
"Recommended" -> pure Recommended "Recommended" -> pure Recommended
"Prerelease" -> pure Prerelease "Prerelease" -> pure Prerelease
"LatestPrerelease" -> pure LatestPrerelease
"old" -> pure Old "old" -> pure Old
('b' : 'a' : 's' : 'e' : '-' : ver') -> case pvp (T.pack ver') of ('b' : 'a' : 's' : 'e' : '-' : ver') -> case pvp (T.pack ver') of
Right x -> pure $ Base x Right x -> pure $ Base x

View File

@@ -335,7 +335,7 @@ ghcSet mtarget = do
getInstalledGHCs :: (MonadReader env m, HasDirs env, MonadIO m) => m [Either FilePath GHCTargetVersion] getInstalledGHCs :: (MonadReader env m, HasDirs env, MonadIO m) => m [Either FilePath GHCTargetVersion]
getInstalledGHCs = do getInstalledGHCs = do
ghcdir <- ghcupGHCBaseDir ghcdir <- ghcupGHCBaseDir
fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectory (fromGHCupPath ghcdir) fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectoryDirs (fromGHCupPath ghcdir)
forM fs $ \f -> case parseGHCupGHCDir f of forM fs $ \f -> case parseGHCupGHCDir f of
Right r -> pure $ Right r Right r -> pure $ Right r
Left _ -> pure $ Left f Left _ -> pure $ Left f
@@ -438,7 +438,7 @@ getInstalledHLSs = do
Nothing -> pure $ Left f Nothing -> pure $ Left f
hlsdir <- ghcupHLSBaseDir hlsdir <- ghcupHLSBaseDir
fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectory (fromGHCupPath hlsdir) fs <- liftIO $ hideErrorDef [NoSuchThing] [] $ listDirectoryDirs (fromGHCupPath hlsdir)
new <- forM fs $ \f -> case parseGHCupHLSDir f of new <- forM fs $ \f -> case parseGHCupHLSDir f of
Right r -> pure $ Right r Right r -> pure $ Right r
Left _ -> pure $ Left f Left _ -> pure $ Left f
@@ -626,7 +626,7 @@ hlsInternalServerScripts ver mghcVer = do
dir <- ghcupHLSDir ver dir <- ghcupHLSDir ver
let bdir = fromGHCupPath dir </> "bin" let bdir = fromGHCupPath dir </> "bin"
fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer) fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer)
<$> liftIO (listDirectory bdir) <$> liftIO (listDirectoryFiles bdir)
-- | Get all binaries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/bin directory, if any. -- | Get all binaries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/bin directory, if any.
-- Returns the full path. -- Returns the full path.
@@ -639,7 +639,7 @@ hlsInternalServerBinaries ver mghcVer = do
let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString) let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString)
(Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left "bin"] (Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left "bin"]
fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer) fmap (bdir </>) . filter (\f -> maybe True (\gv -> ("-" <> T.unpack (prettyVer gv)) `isSuffixOf` f) mghcVer)
<$> liftIO (listDirectory bdir) <$> liftIO (listDirectoryFiles bdir)
-- | Get all libraries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/lib/<ghc-ver>/ -- | Get all libraries for a hls version from the ~/.ghcup/hls/<ver>/lib/haskell-language-server-<ver>/lib/<ghc-ver>/
-- directory, if any. -- directory, if any.
@@ -652,7 +652,7 @@ hlsInternalServerLibs ver ghcVer = do
dir <- fromGHCupPath <$> ghcupHLSDir ver dir <- fromGHCupPath <$> ghcupHLSDir ver
let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString) let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-.*$|] :: ByteString)
(Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left ("lib" </> T.unpack (prettyVer ghcVer))] (Just bdir) <- fmap headMay $ liftIO $ expandFilePath [Left (dir </> "lib"), Right regex, Left ("lib" </> T.unpack (prettyVer ghcVer))]
fmap (bdir </>) <$> liftIO (listDirectory bdir) fmap (bdir </>) <$> liftIO (listDirectoryFiles bdir)
-- | Get the wrapper binary for an hls version, if any. -- | Get the wrapper binary for an hls version, if any.
@@ -892,6 +892,9 @@ getTagged tag =
getLatest :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo) getLatest :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo)
getLatest av tool = headOf (ix tool % getTagged Latest) av getLatest av tool = headOf (ix tool % getTagged Latest) av
getLatestPrerelease :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo)
getLatestPrerelease av tool = headOf (ix tool % getTagged LatestPrerelease) av
getRecommended :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo) getRecommended :: GHCupDownloads -> Tool -> Maybe (Version, VersionInfo)
getRecommended av tool = headOf (ix tool % getTagged Recommended) av getRecommended av tool = headOf (ix tool % getTagged Recommended) av
@@ -933,7 +936,7 @@ ghcToolFiles ver = do
whenM (fmap not $ ghcInstalled ver) whenM (fmap not $ ghcInstalled ver)
(throwE (NotInstalled GHC ver)) (throwE (NotInstalled GHC ver))
files <- liftIO (listDirectory bindir >>= filterM (doesFileExist . (bindir </>))) files <- liftIO (listDirectoryFiles bindir >>= filterM (doesFileExist . (bindir </>)))
pure (getUniqueTools . groupToolFiles . fmap (dropSuffix exeExt) $ files) pure (getUniqueTools . groupToolFiles . fmap (dropSuffix exeExt) $ files)
where where

View File

@@ -42,6 +42,9 @@ module GHCup.Utils.Dirs
, removeDirectoryRecursive , removeDirectoryRecursive
, removePathForcibly , removePathForcibly
, listDirectoryFiles
, listDirectoryDirs
-- System.Directory re-exports -- System.Directory re-exports
, createDirectory , createDirectory
, createDirectoryIfMissing , createDirectoryIfMissing
@@ -130,7 +133,7 @@ import Data.Maybe
import Data.Versions import Data.Versions
import GHC.IO.Exception ( IOErrorType(NoSuchThing) ) import GHC.IO.Exception ( IOErrorType(NoSuchThing) )
import Haskus.Utils.Variant.Excepts import Haskus.Utils.Variant.Excepts
import Optics import Optics hiding ( uncons )
import Safe import Safe
import System.Directory hiding ( removeDirectory import System.Directory hiding ( removeDirectory
, removeDirectoryRecursive , removeDirectoryRecursive
@@ -529,6 +532,29 @@ cleanupTrash = do
) $ liftIO $ removePathForcibly (recycleDir `appendGHCupPath` fp)) ) $ liftIO $ removePathForcibly (recycleDir `appendGHCupPath` fp))
-- | List *actual files* in a directory, ignoring empty files and a couple
-- of blacklisted files, such as '.DS_Store' on mac.
listDirectoryFiles :: FilePath -> IO [FilePath]
listDirectoryFiles fp = do
listDirectory fp >>= filterM (doesFileExist . (fp </>)) <&> filter (\fp' -> not (isHidden fp') && not (isBlacklisted fp'))
-- | List *actual directories* in a directory, ignoring empty directories and a couple
-- of blacklisted files, such as '.DS_Store' on mac.
listDirectoryDirs :: FilePath -> IO [FilePath]
listDirectoryDirs fp = do
listDirectory fp >>= filterM (doesDirectoryExist . (fp </>)) <&> filter (\fp' -> not (isHidden fp') && not (isBlacklisted fp'))
isHidden :: FilePath -> Bool
isHidden fp'
| isWindows = False
| Just ('.', _) <- uncons fp' = True
| otherwise = False
isBlacklisted :: FilePath -> Bool
{- HLINT ignore "Use ==" -}
isBlacklisted fp' = fp' `elem` [".DS_Store"]
-- System.Directory re-exports with GHCupPath -- System.Directory re-exports with GHCupPath

View File

@@ -28,7 +28,7 @@
plat="$(uname -s)" plat="$(uname -s)"
arch=$(uname -m) arch=$(uname -m)
ghver="0.1.19.1" ghver="0.1.19.2"
: "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}" : "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}"
export GHCUP_SKIP_UPDATE_CHECK=yes export GHCUP_SKIP_UPDATE_CHECK=yes

View File

@@ -7,6 +7,7 @@ shopt -s extglob
RELEASE=$1 RELEASE=$1
SIGNER=$2 SIGNER=$2
TAG=${RELEASE/v/}
echo "RELEASE: $RELEASE" echo "RELEASE: $RELEASE"
echo "SIGNER: $SIGNER" echo "SIGNER: $SIGNER"
@@ -19,7 +20,7 @@ done
mkdir -p "gh-release-artifacts/${RELEASE}" mkdir -p "gh-release-artifacts/${RELEASE}"
git archive --format=tar.gz -o "gh-release-artifacts/${RELEASE}/ghcup-${RELEASE}-src.tar.gz" --prefix="ghcup-${RELEASE}/" HEAD git archive --format=tar.gz -o "gh-release-artifacts/${RELEASE}/ghcup-${TAG}-src.tar.gz" --prefix="ghcup-${TAG}/" HEAD
cd "gh-release-artifacts/${RELEASE}" cd "gh-release-artifacts/${RELEASE}"
@@ -27,10 +28,10 @@ cd "gh-release-artifacts/${RELEASE}"
gh release download "$RELEASE" gh release download "$RELEASE"
# cirrus # cirrus
curl -L -o "x86_64-portbld-freebsd-ghcup-${RELEASE}" \ curl -L -o "x86_64-portbld-freebsd-ghcup-${TAG}" \
"https://api.cirrus-ci.com/v1/artifact/github/haskell/ghcup-hs/build/binaries/out/x86_64-portbld-freebsd-ghcup-${RELEASE}?branch=${RELEASE}" "https://api.cirrus-ci.com/v1/artifact/github/haskell/ghcup-hs/build/binaries/out/x86_64-portbld-freebsd-ghcup-${RELEASE}?branch=${RELEASE}"
sha256sum ./*-ghcup-* > SHA256SUMS sha256sum ./*-ghcup-* > SHA256SUMS
gpg --detach-sign -u "${SIGNER}" SHA256SUMS gpg --detach-sign -u "${SIGNER}" SHA256SUMS
gh release upload "$RELEASE" "ghcup-${RELEASE}-src.tar.gz" "x86_64-portbld-freebsd-ghcup-${RELEASE}" SHA256SUMS SHA256SUMS.sig gh release upload "$RELEASE" "ghcup-${TAG}-src.tar.gz" "x86_64-portbld-freebsd-ghcup-${TAG}" SHA256SUMS SHA256SUMS.sig

View File

@@ -195,8 +195,8 @@
"dlUri": "https:g" "dlUri": "https:g"
}, },
"viTags": [ "viTags": [
"base-3.2.2", "base-6.5.1",
"Prerelease", "base-2.2.5",
"𪔊\u0007\u0015" "𪔊\u0007\u0015"
], ],
"viTestDL": { "viTestDL": {
@@ -271,7 +271,7 @@
"viPreCompile": "thzbtjc", "viPreCompile": "thzbtjc",
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"old", "LatestPrerelease",
"old" "old"
], ],
"viTestDL": { "viTestDL": {
@@ -993,8 +993,8 @@
"Latest", "Latest",
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"base-2.3.5", "base-6.3.2",
"\u0005EL" "base-6.3.1"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -1140,9 +1140,9 @@
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"Latest", "Latest",
"base-2.1.2", "LatestPrerelease",
"base-5.2.1", "base-5.6.5",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -5, "dlCSize": -5,
@@ -1584,13 +1584,13 @@
"dlUri": "https:l" "dlUri": "https:l"
}, },
"viTags": [ "viTags": [
"base-1.1.6", "LatestPrerelease",
"Latest", "Latest",
"old", "old",
"base-4.6.2", "base-4.2.4",
"􀜶l􀻈𠹟󿴠F", "􀜶l􀻈𠹟󿴠F",
"old", "old",
"Recommended" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 0, "dlCSize": 0,
@@ -1897,7 +1897,7 @@
"old", "old",
"Latest", "Latest",
"Recommended", "Recommended",
"Prerelease" "base-1.3.3"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 5, "dlCSize": 5,
@@ -2348,10 +2348,10 @@
"dlUri": "http:" "dlUri": "http:"
}, },
"viTags": [ "viTags": [
"t\u001e\u001aB8", "base-5.5.1",
"old", "old",
"", "",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -4, "dlCSize": -4,
@@ -3337,9 +3337,9 @@
}, },
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"base-5.6.1", "old",
"base-3.3.3", "*𭡕󼅇󰢑3i",
"base-3.2.1", "base-5.1.4",
"Latest", "Latest",
":ᄻ[" ":ᄻ["
], ],
@@ -3767,9 +3767,9 @@
}, },
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"base-2.4.6", "base-2.2.4",
"base-4.1.3", "\u0008",
"base-4.4.6" "LatestPrerelease"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -3901,8 +3901,8 @@
}, },
"viTags": [ "viTags": [
"Latest", "Latest",
"Latest", "base-3.3.5",
"base-3.1.4", "LatestPrerelease",
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"old", "old",
@@ -4030,8 +4030,8 @@
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"Recommended", "Recommended",
"Latest", "base-2.4.6",
"old" "LatestPrerelease"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -4212,7 +4212,7 @@
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"X\u001d^Y󶹬", "X\u001d^Y󶹬",
"base-2.3.5" "base-3.5.1"
], ],
"viTestDL": null "viTestDL": null
}, },
@@ -4497,10 +4497,10 @@
"viTags": [ "viTags": [
"old", "old",
"Latest", "Latest",
"base-5.6.4", "oj&,m",
"\u0019\u0007", "\u0019\u0007",
"Recommended", "Recommended",
"Latest" "LatestPrerelease"
], ],
"viTestDL": null "viTestDL": null
} }
@@ -4718,12 +4718,12 @@
"dlUri": "http:k" "dlUri": "http:k"
}, },
"viTags": [ "viTags": [
"base-5.3.4", "old",
"Recommended", "Recommended",
"Recommended", "Recommended",
"base-4.3.5", "base-3.5.1",
"Latest", "LatestPrerelease",
"󲨆Rs;h~" "base-3.3.3"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -3, "dlCSize": -3,
@@ -4928,12 +4928,12 @@
"viPreCompile": null, "viPreCompile": null,
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"base-1.5.5", "LatestPrerelease",
"Latest", "Latest",
"Latest", "Latest",
"old", "old",
"Latest", "Latest",
"base-3.6.4", "LatestPrerelease",
"old" "old"
], ],
"viTestDL": { "viTestDL": {
@@ -5027,12 +5027,12 @@
}, },
"viTags": [ "viTags": [
"Latest", "Latest",
"base-3.6.5", "old",
"base-3.4.1", "base-1.6.1",
"𬰗𗛞Q#", "𬰗𗛞Q#",
"", "",
"Prerelease", "Prerelease",
"base-5.1.4" "base-6.6.2"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 6, "dlCSize": 6,
@@ -5368,12 +5368,12 @@
"dlUri": "http:rjevxi" "dlUri": "http:rjevxi"
}, },
"viTags": [ "viTags": [
"base-1.6.1", "󿿁U:3\u000fd",
"S󶱩󳷐I🢐", "S󶱩󳷐I🢐",
"old", "old",
"󼗛𤔄\u001a~F", "󼗛𤔄\u001a~F",
"Latest", "Latest",
"base-4.5.4" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -5697,10 +5697,10 @@
"dlUri": "http:viiv" "dlUri": "http:viiv"
}, },
"viTags": [ "viTags": [
"base-3.1.6", "base-1.5.6",
"Prerelease", "Prerelease",
"Recommended", "Recommended",
")\u0005\u0015" "base-1.3.2"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 5, "dlCSize": 5,
@@ -7482,7 +7482,7 @@
"Recommended", "Recommended",
"old", "old",
"old", "old",
"Latest" "(>"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -8175,11 +8175,11 @@
"dlUri": "http:ndqpk" "dlUri": "http:ndqpk"
}, },
"viTags": [ "viTags": [
"\"􁫳5\u0006F", "base-2.1.6",
"Recommended", "Recommended",
"Prerelease", "Prerelease",
"LatestPrerelease",
"old", "old",
"base-3.3.1",
"Recommended" "Recommended"
], ],
"viTestDL": null "viTestDL": null
@@ -8199,10 +8199,10 @@
"dlUri": "https:gqhlp" "dlUri": "https:gqhlp"
}, },
"viTags": [ "viTags": [
"base-4.3.4",
"Recommended",
"old", "old",
"base-4.1.4" "Recommended",
"LatestPrerelease",
"base-6.5.6"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -8400,7 +8400,7 @@
"\u0001", "\u0001",
"Prerelease", "Prerelease",
"Prerelease", "Prerelease",
"base-3.6.3", "1Aⳃ",
"Latest" "Latest"
], ],
"viTestDL": { "viTestDL": {
@@ -8427,13 +8427,13 @@
"dlUri": "http:pvmi" "dlUri": "http:pvmi"
}, },
"viTags": [ "viTags": [
"old", "LatestPrerelease",
"old", "LatestPrerelease",
"Latest", "LatestPrerelease",
"old", "old",
")", ")",
"Recommended", "Recommended",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -2, "dlCSize": -2,
@@ -8941,9 +8941,9 @@
"dlUri": "http:oth" "dlUri": "http:oth"
}, },
"viTags": [ "viTags": [
"base-4.1.5", "􄖛\u001c\u001f",
"フ􍋦", "フ􍋦",
"base-1.4.5" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -5, "dlCSize": -5,
@@ -10152,9 +10152,9 @@
"viPreCompile": "deajwn", "viPreCompile": "deajwn",
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"base-6.4.5", "base-1.4.3",
"base-5.1.1", "LatestPrerelease",
"base-4.4.6", "LatestPrerelease",
"Latest", "Latest",
"Latest", "Latest",
"Prerelease", "Prerelease",
@@ -10479,11 +10479,11 @@
"viPreCompile": "", "viPreCompile": "",
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"Prerelease", "󻦧s",
"Recommended", "Recommended",
"old", "old",
"N\u001b", "N\u001b",
"base-5.5.2", "LatestPrerelease",
"", "",
"Recommended" "Recommended"
], ],
@@ -10716,8 +10716,8 @@
"viSourceDL": null, "viSourceDL": null,
"viTags": [ "viTags": [
"Recommended", "Recommended",
"base-3.6.1", "base-4.3.2",
"base-4.3.3", "base-2.3.4",
"Recommended", "Recommended",
"Latest" "Latest"
], ],
@@ -11178,8 +11178,8 @@
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"Latest", "Latest",
"base-5.3.2", "5𨥶$𬰇",
"[3憥􋉞" "base-3.1.6"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 1, "dlCSize": 1,
@@ -11698,7 +11698,7 @@
"viTags": [ "viTags": [
"𥭏}\u000e", "𥭏}\u000e",
"\u0007/", "\u0007/",
"base-6.5.3", "LatestPrerelease",
"Latest" "Latest"
], ],
"viTestDL": { "viTestDL": {
@@ -13992,7 +13992,7 @@
}, },
"viTags": [ "viTags": [
"Prerelease", "Prerelease",
"base-4.6.2", "base-7.5.2",
"3g7", "3g7",
"Recommended" "Recommended"
], ],
@@ -14463,10 +14463,10 @@
}, },
"viTags": [ "viTags": [
"Recommended", "Recommended",
"base-3.4.3", "LatestPrerelease",
"base-4.3.5", "base-1.2.2",
"Latest", "Latest",
"base-5.4.2" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -14650,8 +14650,8 @@
}, },
"viTags": [ "viTags": [
"Latest", "Latest",
"", "base-5.6.2",
"base-3.5.6" "old"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": -1, "dlCSize": -1,
@@ -14735,11 +14735,11 @@
"dlUri": "http:koxgqu" "dlUri": "http:koxgqu"
}, },
"viTags": [ "viTags": [
"base-6.3.3", "base-4.4.6",
"base-2.4.2", "B\u0004",
"Latest", "old",
"base-3.1.6", "LatestPrerelease",
"", "base-4.5.5",
"Latest" "Latest"
], ],
"viTestDL": { "viTestDL": {
@@ -15054,12 +15054,12 @@
"dlUri": "http:s" "dlUri": "http:s"
}, },
"viTags": [ "viTags": [
"Latest", "9􀦐or𰉒",
"base-5.1.1", "old",
"𫠼", "base-2.4.4",
"Recommended", "Recommended",
"OHk(\u0007󹌞", "OHk(\u0007󹌞",
"old" "LatestPrerelease"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 1, "dlCSize": 1,
@@ -15251,10 +15251,10 @@
"viTags": [ "viTags": [
"Latest", "Latest",
"Latest", "Latest",
"Latest", "old",
"𮧬", "𮧬",
"old", "old",
"old", "LatestPrerelease",
"" ""
], ],
"viTestDL": { "viTestDL": {
@@ -15615,11 +15615,11 @@
"dlUri": "https:oat" "dlUri": "https:oat"
}, },
"viTags": [ "viTags": [
"base-6.6.4", "",
"Recommended", "old",
"Recommended", "Recommended",
"old", "old",
"Prerelease" "base-6.3.4"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": null, "dlCSize": null,
@@ -15904,13 +15904,13 @@
"dlUri": "https:rwxmrn" "dlUri": "https:rwxmrn"
}, },
"viTags": [ "viTags": [
"base-7.2.1",
"Prerelease",
"X",
"Latest",
"z 7\u0008N\u000e",
"old", "old",
"󱕠\u0006g" "Prerelease",
"base-2.5.3",
"Latest",
"base-5.3.3",
"old",
"base-7.2.1"
], ],
"viTestDL": { "viTestDL": {
"dlCSize": 5, "dlCSize": 5,