mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-03-11 11:16:34 +01:00
Check build tools
This commit is contained in:
parent
69b30063ff
commit
6613ea7e16
@ -15,7 +15,7 @@ import Stackage.CheckBuildPlan
|
|||||||
import Stackage.GhcPkg
|
import Stackage.GhcPkg
|
||||||
import Stackage.PackageDescription
|
import Stackage.PackageDescription
|
||||||
import Stackage.PerformBuild (PerformBuild(..),copyBuiltInHaddocks,renameOrCopy)
|
import Stackage.PerformBuild (PerformBuild(..),copyBuiltInHaddocks,renameOrCopy)
|
||||||
import Stackage.Prelude (unFlagName)
|
import Stackage.Prelude (unFlagName,unExeName)
|
||||||
|
|
||||||
import Control.Concurrent
|
import Control.Concurrent
|
||||||
import Control.Concurrent.STM
|
import Control.Concurrent.STM
|
||||||
@ -76,6 +76,7 @@ performBuild pb' = do
|
|||||||
, envPB = pb
|
, envPB = pb
|
||||||
, envRegistered = pkgs
|
, envRegistered = pkgs
|
||||||
}
|
}
|
||||||
|
checkBuildTools env
|
||||||
cleanOldPackages env
|
cleanOldPackages env
|
||||||
printNewPackages env
|
printNewPackages env
|
||||||
startShake num shakeDir (shakePlan env)
|
startShake num shakeDir (shakePlan env)
|
||||||
@ -205,6 +206,31 @@ printNewPackages Env{..} = do
|
|||||||
M.filter (not . S.null . sdModules . ppDesc) .
|
M.filter (not . S.null . sdModules . ppDesc) .
|
||||||
bpPackages . pbPlan) envPB
|
bpPackages . pbPlan) envPB
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Checking for build tools
|
||||||
|
|
||||||
|
-- | Check that all build tools are available.
|
||||||
|
-- https://github.com/jgm/zip-archive/issues/23
|
||||||
|
checkBuildTools :: Env -> IO ()
|
||||||
|
checkBuildTools Env{..} =
|
||||||
|
forM_ normalPackages
|
||||||
|
(\(pname,plan) -> mapM_ (checkTool pname) (M.keys (sdTools (ppDesc plan))))
|
||||||
|
where normalPackages = filter (not . (`elem` corePackages) . fst) $
|
||||||
|
M.toList $ bpPackages $ pbPlan envPB
|
||||||
|
where corePackages = M.keys $ siCorePackages $ bpSystemInfo $ pbPlan envPB
|
||||||
|
checkTool pname name =
|
||||||
|
case M.lookup name (makeToolMap (bpPackages (pbPlan envPB))) of
|
||||||
|
Nothing
|
||||||
|
| not (isCoreExe name) ->
|
||||||
|
putStrLn ("Warning: No executable " <>
|
||||||
|
T.unpack (unExeName name) <>
|
||||||
|
" for " <> display pname)
|
||||||
|
|
||||||
|
Just pkgs
|
||||||
|
-> return ()
|
||||||
|
_ -> return ()
|
||||||
|
isCoreExe = (`S.member` siCoreExecutables (bpSystemInfo (pbPlan envPB)))
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Clean/purging of old packages
|
-- Clean/purging of old packages
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user