fix warnings (and disable some)

This commit is contained in:
Luite Stegeman 2012-04-03 21:07:18 +02:00
parent 69ce5fea57
commit 9194e45f3b
2 changed files with 20 additions and 5 deletions

View File

@ -30,10 +30,11 @@ import System.Process (createProcess, proc, terminateProcess, readProc
waitForProcess, rawSystem, runInteractiveProcess)
import System.IO (hClose, hIsEOF, hGetLine, stdout, stderr, hPutStrLn)
import Build (recompDeps, getDeps, isNewerThan)
import GhcBuild (getBuildFlags, buildPackage)
import Build (recompDeps, getDeps, isNewerThan)
import GhcBuild (getBuildFlags, buildPackage)
import qualified Config as GHC
import SrcLoc (Located)
lockFile :: FilePath
lockFile = "dist/devel-terminate"
@ -90,7 +91,7 @@ devel isCabalDev passThroughArgs = do
mainLoop :: [FilePath] -> FilePath -> IO ()
mainLoop hsSourceDirs cabal = do
ghcVer <- ghcVersion
rebuildCabal cmd
_ <- rebuildCabal cmd
pkgArgs <- ghcPackageArgs isCabalDev ghcVer
rebuild <- mkRebuild ghcVer cabal cmd
let devArgs = pkgArgs ++ ["devel.hs"] ++ passThroughArgs
@ -132,10 +133,12 @@ mkRebuild ghcVer cabalFile cabalCmd
putStrLn "WARNING: yesod is compiled with a different ghc version, falling back to cabal"
rebuildCabal cabalCmd
rebuildGhc :: [Located String] -> IO Bool
rebuildGhc bf = do
putStrLn "Rebuilding application... (GHC API)"
buildPackage bf
rebuildCabal :: String -> IO Bool
rebuildCabal cmd = do
putStrLn "Rebuilding application... (cabal)"
exit <- rawSystemFilter cmd ["build"]

View File

@ -1,4 +1,14 @@
{-# LANGUAGE CPP, ScopedTypeVariables #-}
{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
{-
There is a lot of code copied from GHC here, and some conditional
compilation. Instead of fixing all warnings and making it much more
difficult to compare the code to the original, just ignore unused
binds and imports.
-}
{-# LANGUAGE CPP, ScopedTypeVariables, PatternGuards #-}
{-
build package with the GHC API
@ -43,6 +53,7 @@ buildPackage a = buildPackage' a `Ex.catch` \(e::Ex.SomeException) -> do
putStrLn ("exception building package: " ++ show e)
return False
buildPackage' :: [Located String] -> IO Bool
buildPackage' argv2 = do
(mode, argv3, modeFlagWarnings) <- parseModeFlags argv2
GHC.runGhc (Just libdir) $ do
@ -85,12 +96,13 @@ buildPackage' argv2 = do
else liftIO linkPkg >> return True
-- fixme, find default ar and ld versions
linkPkg :: IO ()
linkPkg = do
arargs <- fmap read $ readFile "dist/arargs.txt"
rawSystem "ar" arargs
ldargs <- fmap read $ readFile "dist/ldargs.txt"
rawSystem "ld" ldargs
return ()
--------------------------------------------------------------------------------------------
-- stuff below copied from ghc main.hs