diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2019-08-06 19:39:23 +0200 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2020-05-10 21:50:44 +0200 |
commit | bda559bf059ee42e3e01c1280f7a64dd2673d725 (patch) | |
tree | bdfe97db7a53bd68638a6a7f102cd0942456e948 /src/CabalHelper/Compiletime/Compile.hs | |
parent | f606584fd104f864694e4fb9b943ef13904cdc96 (diff) |
Refactor Program versions handling
This mainly renames the program version getters to get* and make them
consistenly return Version directly. Such that wrappers like GhcVersion
have to be added at the callsites of the relevant functions.
Diffstat (limited to 'src/CabalHelper/Compiletime/Compile.hs')
-rw-r--r-- | src/CabalHelper/Compiletime/Compile.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/CabalHelper/Compiletime/Compile.hs b/src/CabalHelper/Compiletime/Compile.hs index e468c1b..e5d7dcd 100644 --- a/src/CabalHelper/Compiletime/Compile.hs +++ b/src/CabalHelper/Compiletime/Compile.hs @@ -112,7 +112,7 @@ compileHelper' => CompHelperEnv' UnpackedCabalVersion -> IO (Either ExitCode FilePath) compileHelper' CompHelperEnv {..} = do - ghcVer <- ghcVersion + ghcVer <- GhcVersion <$> getGhcVersion Just (prepare, comp) <- case cheCabalVer of cabalVer@CabalHEAD {} -> runMaybeT $ msum $ map (\f -> f ghcVer cabalVer) [ compileWithCabalV2GhcEnv' @@ -217,7 +217,7 @@ compileHelper' CompHelperEnv {..} = do compileWithCabalV2GhcEnv' :: Env => GhcVersion -> UnpackedCabalVersion -> MaybeT IO (IO (), Compile) compileWithCabalV2GhcEnv' ghcVer cabalVer = do _ <- maybe mzero pure cheDistV2 -- bail if this isn't a v2-build project - CabalInstallVersion instVer <- liftIO cabalInstallVersion + instVer <- liftIO getCabalInstallVersion guard $ instVer >= (Version [2,4,1,0] []) -- ^ didn't test with older versions guard $ ghcVer >= (GhcVersion (Version [8,0] [])) |