mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-04-27 23:07:46 +02:00
Ghc major version whitelist is now drawn from stackage-content
This commit is contained in:
parent
8a3f199ebb
commit
90ad3afe19
@ -6,6 +6,7 @@ module Data.GhcLinks
|
||||
import ClassyPrelude.Yesod
|
||||
import Control.Monad.State.Strict (modify, execStateT)
|
||||
import qualified Data.HashMap.Strict as HashMap
|
||||
import qualified Data.Yaml as Yaml
|
||||
import Filesystem (readTextFile, isFile)
|
||||
|
||||
import Types
|
||||
@ -18,16 +19,16 @@ newtype GhcLinks = GhcLinks
|
||||
supportedArches :: [SupportedArch]
|
||||
supportedArches = [minBound .. maxBound]
|
||||
|
||||
supportedGhcMajorVersions :: [GhcMajorVersion]
|
||||
supportedGhcMajorVersions = ["7.8", "7.10"]
|
||||
|
||||
|
||||
readGhcLinks :: FilePath -> IO GhcLinks
|
||||
readGhcLinks dir = do
|
||||
let ghcMajorVersionsPath = dir </> "supported-ghc-major-versions.yaml"
|
||||
Yaml.decodeFile (fpToString ghcMajorVersionsPath) >>= \case
|
||||
Nothing -> return $ GhcLinks HashMap.empty
|
||||
Just (ghcMajorVersions :: [GhcMajorVersion]) -> do
|
||||
let opts =
|
||||
[ (arch, ver)
|
||||
| arch <- supportedArches
|
||||
, ver <- supportedGhcMajorVersions
|
||||
, ver <- ghcMajorVersions
|
||||
]
|
||||
hashMap <- flip execStateT HashMap.empty
|
||||
$ forM_ opts $ \(arch, ver) -> do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user