From 9d2ebcb74d1c53183808577993ecd8dbe22e6aeb Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 13 Mar 2022 00:28:34 +0100 Subject: [PATCH] Fix hls-metadata for windows --- ghcup-gen/Generate.hs | 14 +++++-- ghcup-gen/Main.hs | 4 +- ghcup-gen/ghcup-gen.cabal | 1 + hls-metadata-0.0.1.json | 81 ++++++++++++++++++++++++++++++++---- hls-metadata-0.0.1.json.sig | Bin 682 -> 682 bytes 5 files changed, 87 insertions(+), 13 deletions(-) diff --git a/ghcup-gen/Generate.hs b/ghcup-gen/Generate.hs index 60e88ef..d86366a 100644 --- a/ghcup-gen/Generate.hs +++ b/ghcup-gen/Generate.hs @@ -18,6 +18,8 @@ import GHCup.Utils import Codec.Archive +import Control.DeepSeq +import Control.Exception ( evaluate ) import Control.Exception.Safe hiding ( handle ) import Control.Monad import Control.Monad.IO.Class @@ -82,12 +84,14 @@ generateHLSGhc format output = do , ArchiveResult ] $ do fp <- liftE $ downloadCached dli Nothing - files <- liftE $ getArchiveFiles fp - let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-([0-9]+\.)*([0-9]+)$|] :: ByteString) + filesL <- liftE $ getArchiveFiles fp + files <- liftIO $ evaluate $ force filesL + let regex = makeRegexOpts compExtended execBlank ([s|^haskell-language-server-([0-9]+\.)*([0-9]+)(\.exe)?$|] :: ByteString) let ghcs = rights $ MP.parse version' "" . T.pack . fromJust . stripPrefix "haskell-language-server-" + . stripExe <$> filter (match regex) files pure ghcs pure r @@ -98,7 +102,11 @@ generateHLSGhc format output = do StdOut -> liftIO $ BSL.putStr w FileOutput f -> liftIO $ BSL.writeFile f w pure ExitSuccess - + where + stripExe :: String -> String + stripExe f = case reverse f of + ('e':'x':'e':'.':r) -> reverse r + _ -> f generateTable :: ( MonadFail m , MonadMask m diff --git a/ghcup-gen/Main.hs b/ghcup-gen/Main.hs index f739ff8..d0d34af 100644 --- a/ghcup-gen/Main.hs +++ b/ghcup-gen/Main.hs @@ -170,7 +170,7 @@ main = do , fancyColors = not no_color } dirs <- liftIO getAllDirs - let leanAppstate = LeanAppState (Settings True 0 False Never Curl True GHCupURL False GPGNone False) dirs defaultKeyBindings loggerConfig + let leanAppstate = LeanAppState (Settings True 0 False Never Curl True GHCupURL False GPGNone True) dirs defaultKeyBindings loggerConfig pfreq <- ( flip runReaderT leanAppstate . runE @'[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] $ platformRequest @@ -180,7 +180,7 @@ main = do flip runReaderT leanAppstate $ logError $ T.pack $ prettyShow e liftIO $ exitWith (ExitFailure 2) - let appstate = AppState (Settings True 0 False Never Curl True GHCupURL False GPGNone False) dirs defaultKeyBindings (GHCupInfo mempty mempty mempty) pfreq loggerConfig + let appstate = AppState (Settings True 0 False Never Curl True GHCupURL False GPGNone True) dirs defaultKeyBindings (GHCupInfo mempty mempty mempty) pfreq loggerConfig let withValidateYamlOpts vopts f = case vopts of ValidateYAMLOpts { vInput = Nothing } -> diff --git a/ghcup-gen/ghcup-gen.cabal b/ghcup-gen/ghcup-gen.cabal index 9d625b3..7f61509 100644 --- a/ghcup-gen/ghcup-gen.cabal +++ b/ghcup-gen/ghcup-gen.cabal @@ -49,6 +49,7 @@ executable ghcup-gen , base >=4.13 && <5 , bytestring ^>=0.10 , containers ^>=0.6 + , deepseq ^>=1.4 , filepath ^>=1.4.2.1 , ghcup ^>=0.1.17.3 , haskus-utils-variant ^>=3.2 diff --git a/hls-metadata-0.0.1.json b/hls-metadata-0.0.1.json index 7e23594..03da9c7 100644 --- a/hls-metadata-0.0.1.json +++ b/hls-metadata-0.0.1.json @@ -31,7 +31,14 @@ "8.8.3", "8.8.4" ], - "Windows": [] + "Windows": [ + "8.6.4", + "8.6.5", + "8.8.4", + "8.10.2", + "8.10.3", + "8.10.4" + ] } }, "1.2.0": { @@ -69,7 +76,15 @@ "8.8.3", "8.8.4" ], - "Windows": [] + "Windows": [ + "8.10.2", + "8.10.3", + "8.10.4", + "8.10.5", + "8.6.4", + "8.6.5", + "8.8.4" + ] } }, "1.3.0": { @@ -107,7 +122,16 @@ "8.8.4", "9.0.1" ], - "Windows": [] + "Windows": [ + "8.10.2", + "8.10.3", + "8.10.4", + "8.10.5", + "8.6.4", + "8.6.5", + "8.8.4", + "9.0.1" + ] } }, "1.4.0": { @@ -154,7 +178,18 @@ "8.8.4", "9.0.1" ], - "Windows": [] + "Windows": [ + "8.10.2", + "8.10.3", + "8.10.4", + "8.10.5", + "8.10.6", + "8.10.7", + "8.6.4", + "8.6.5", + "8.8.4", + "9.0.1" + ] }, "A_ARM": { "Linux_UnknownLinux": [ @@ -207,7 +242,14 @@ "8.8.4", "9.0.1" ], - "Windows": [] + "Windows": [ + "8.10.5", + "8.10.6", + "8.10.7", + "8.6.5", + "8.8.4", + "9.0.1" + ] }, "A_ARM": { "Linux_UnknownLinux": [ @@ -257,7 +299,14 @@ "8.8.4", "9.0.1" ], - "Windows": [] + "Windows": [ + "8.10.5", + "8.10.6", + "8.10.7", + "8.6.5", + "8.8.4", + "9.0.1" + ] }, "A_ARM": { "Linux_UnknownLinux": [ @@ -307,7 +356,15 @@ "9.0.2", "9.2.1" ], - "Windows": [] + "Windows": [ + "8.10.6", + "8.10.7", + "8.6.5", + "8.8.4", + "9.0.1", + "9.0.2", + "9.2.1" + ] }, "A_ARM": { "Linux_UnknownLinux": [ @@ -354,7 +411,15 @@ "9.0.2", "9.2.1" ], - "Windows": [] + "Windows": [ + "8.10.6", + "8.10.7", + "8.6.5", + "8.8.4", + "9.0.1", + "9.0.2", + "9.2.1" + ] }, "A_ARM": { "Linux_UnknownLinux": [ diff --git a/hls-metadata-0.0.1.json.sig b/hls-metadata-0.0.1.json.sig index c1467db98934e8e6a181535c265e63e70e3c1de2..ea5de2ad597b6497d3d0d644c91ea5f9f46a5da7 100644 GIT binary patch delta 534 zcmV+x0_pv#1*!#*BLgigw2>x&f0~yM{ysG;Jm765z?aZj=wtLyoY{*DSw#l5O>zGb z@qo94^H700O8b1EVz}J*KgD8{kPHqbBpp!my2UQyHo}afJfYvW>1VNy zH*2P~*4jFaEITd90*%~dzOyxH1g|?KXQS5`B4CbShFF+HX$+Mib9EVH^Lb&526vC1 zGpVXb55TE-^s^KFp~7Bz+w{9e(^@B{5%3Y1Hh=axtBT6Tu+b??XqZ9Dg+mRU@jYNJ z>ntW{WoNr={Pmi4g-{8#f4Lf=99K>Awb>A!q-T(N?FLon`&84?ValjTgxS>(f1mxR8uJFAJe=L`WWa)n37$-y- z<%wBv{g<7+(>8%sj!gN^g5&|HMIH>#kdQBo+Bd*yHs9Pr@eZoSXQ|-_l@TvBDJtul z{sAU^Vk)OR61S&8bnLq`hRL@x7ehe1#j(9H*U$@bG~Z*`4=&A`uxWD_KnEdP)(OF< Ygh9p?fo2sRsDixK2$julD*ckqi^Na_9RL6T delta 534 zcmV+x0_pv#1*!#*BLgR4T9GDze}|tB{v~flRgZ~QS~TAhb7psyYF;K_gCD+-b~0on zb&=PwLxA;rK9N2(!L$QuVyanxcGGB=#!OdpRUQC<&0894^%hQWkdDzq@y`MrYFSH6 z%EhvM~}^pR>_>jy%a4DqX*_lk@#e-otbe<8F$Gy`pH z)ZFps56kN>+{c6NxT-W9TIIDLl*_Jbc#;`G8=UEVfl$*8HZ(+s+o^rd&r{(52e5;3rl{l+l93ba&rJo#KJhL^e_VRb67Ua!p-fTR zY&bL`wQSM)2_gI)@@(&d1iX&#rL3@~6oe<*riH7qAqFbh1Sl>8RFZ!vZcukK+|iA7)FMo^J6Z?bl;x*vp%l!ZHk&cOGu7?g`LS*1J#)YWB>pF