From 803b2cfd1b1d2dae1aba9b3a5365b705604cb536 Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Sun, 30 Jul 2023 12:30:49 +0530 Subject: [PATCH] fix: Upgrade to newest ghcup-hs master * Upgrades ghcup-metadata to use newest master branch commit. - updates cabal.project * fixes breaking changes when upgrading to new ghcup-hs - `listVersions` function changed type-signature, fixed useages - needed some GHCTargetVersion -> Version type conversions --- cabal.project | 2 +- ghcup-gen/Generate.hs | 2 +- ghcup-gen/Validate.hs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cabal.project b/cabal.project index f9c2d39..8cc890f 100644 --- a/cabal.project +++ b/cabal.project @@ -7,7 +7,7 @@ package ghcup source-repository-package type: git location: https://github.com/haskell/ghcup-hs.git - tag: v0.1.19.2 + tag: a2a605ad892675d317e8415522e2cf12d5e35571 constraints: http-io-streams -brotli, any.aeson >= 2.0.1.0 diff --git a/ghcup-gen/Generate.hs b/ghcup-gen/Generate.hs index b582ede..85f2801 100644 --- a/ghcup-gen/Generate.hs +++ b/ghcup-gen/Generate.hs @@ -157,7 +157,7 @@ generateTable output = do liftIO $ hPutStrLn handle $ "" liftIO $ hPutStrLn handle $ "" liftIO $ hPutStrLn handle $ "" - vers <- reverse <$> listVersions (Just tool) Nothing + vers <- reverse <$> listVersions (Just tool) [] False False (Nothing, Nothing) forM_ (filter (\ListResult{..} -> not lStray) vers) $ \ListResult{..} -> do liftIO $ hPutStrLn handle $ "
" <> show tool <> " VersionTags
" diff --git a/ghcup-gen/Validate.hs b/ghcup-gen/Validate.hs index 9db8c27..78d7cd0 100644 --- a/ghcup-gen/Validate.hs +++ b/ghcup-gen/Validate.hs @@ -81,7 +81,7 @@ validate = do forM_ (M.toList dls) $ \(t, versions) -> forM_ (M.toList versions) $ \(v, vi) -> forM_ (M.toList $ _viArch vi) $ \(arch, pspecs) -> do - checkHasRequiredPlatforms t v (_viTags vi) arch (M.keys pspecs) + checkHasRequiredPlatforms t (_tvVersion v) (_viTags vi) arch (M.keys pspecs) checkGHCVerIsValid forM_ (M.toList dls) $ \(t, _) -> checkMandatoryTags t @@ -154,7 +154,7 @@ validate = do checkGHCVerIsValid = do GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo - let ghcVers = toListOf (ix GHC % to M.keys % folded) dls + let ghcVers = toListOf (ix GHC % to M.keys % to (map _tvVersion) % folded) dls forM_ ghcVers $ \v -> case [ x | (x,"") <- readP_to_S V.parseVersion (T.unpack . prettyVer $ v) ] of [_] -> pure () @@ -178,7 +178,7 @@ validate = do let allTags = M.toList $ availableToolVersions dls GHC forM allTags $ \(ver, _viTags -> tags) -> case any isBase tags of False -> do - lift $ logError $ "Base tag missing from GHC ver " <> prettyVer ver + lift $ logError $ "Base tag missing from GHC ver " <> prettyVer (_tvVersion ver) addError True -> pure () @@ -211,7 +211,7 @@ validateTarballs (TarballFilter etool versionRegex) = do -- download/verify all tarballs let dlis = either (const []) (\tool -> nubOrd $ dls ^.. each %& indices (maybe (const True) (==) tool) - %> each %& indices (matchTest versionRegex . T.unpack . prettyVer) + %> each %& indices (matchTest versionRegex . T.unpack . prettyVer . _tvVersion) % (viTestDL % _Just `summing` viSourceDL % _Just `summing` viArch % each % each % each) ) etool