Commit 8d0581ed authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Drop laxDependencies. To be replaced by Shake's skip feature.

parent ed4cdd8c
......@@ -141,21 +141,11 @@ getBuilderPath = lift . builderPath
specified :: Builder -> Action Bool
specified = fmap (not . null) . builderPath
-- TODO: Get rid of laxDependencies -- we no longer need it (use Shake's skip).
-- | Make sure a builder exists on the given path and rebuild it if out of date.
-- If 'laxDependencies' is True then we do not rebuild GHC even if it is out of
-- date (can save a lot of build time when changing GHC).
needBuilder :: Bool -> Builder -> Action ()
needBuilder laxDependencies builder = when (isInternal builder) $ do
-- | Make sure a Builder exists on the given path and rebuild it if out of date.
needBuilder :: Builder -> Action ()
needBuilder builder = when (isInternal builder) $ do
path <- builderPath builder
if laxDependencies && allowOrderOnlyDependency builder
then orderOnly [path]
else need [path]
where
allowOrderOnlyDependency :: Builder -> Bool
allowOrderOnlyDependency = \case
Ghc _ _ -> True
_ -> False
need [path]
-- Instances for storing in the Shake database
instance Binary CompilerMode
......
......@@ -15,7 +15,6 @@ stage s = (s ==) <$> getStage
package :: Package -> Predicate
package p = (p ==) <$> getPackage
-- TODO: Also add needBuilder, builderPath, etc.
-- | Is a particular builder being used?
class BuilderLike a where
builder :: a -> Predicate
......
......@@ -24,7 +24,7 @@ import Target
-- built (that is, track changes in the build system).
buildWithResources :: [(Resource, Int)] -> Target -> Action ()
buildWithResources rs target@Target {..} = do
needBuilder laxDependencies builder
needBuilder builder
path <- builderPath builder
argList <- interpret target getArgs
verbose <- interpret target verboseCommands
......@@ -140,14 +140,14 @@ applyPatch :: FilePath -> FilePath -> Action ()
applyPatch dir patch = do
let file = dir -/- patch
need [file]
needBuilder False Patch -- TODO: add a specialised version ~needBuilderFalse?
needBuilder Patch
path <- builderPath Patch
putBuild $ "| Apply patch " ++ file
quietly $ cmd Shell (EchoStdout False) [Cwd dir] [path, "-p0 <", patch]
runBuilder :: Builder -> [String] -> Action ()
runBuilder builder args = do
needBuilder laxDependencies builder
needBuilder builder
path <- builderPath builder
let note = if null args then "" else " (" ++ intercalate ", " args ++ ")"
putBuild $ "| Run " ++ show builder ++ note
......
......@@ -42,7 +42,7 @@ configureEnvironment = do
, builderEnv "NM" Nm ]
where
builderEnv var bld = do
needBuilder False bld
needBuilder bld
path <- builderPath bld
return $ AddEnv var path
......
......@@ -53,7 +53,7 @@ configureEnvironment = do
, return . AddEnv "LDFLAGS" $ unwords ldFlags ++ " -w" ]
where
builderEnv var bld = do
needBuilder False bld
needBuilder bld
path <- builderPath bld
return $ AddEnv var path
......
......@@ -15,9 +15,9 @@ import Settings.User
testRules :: Rules ()
testRules = do
"validate" ~> do
needBuilder False $ Ghc Compile Stage2 -- TODO: get rid of False
needBuilder False $ GhcPkg Stage1
needBuilder False $ Hpc
needBuilder $ Ghc Compile Stage2
needBuilder $ GhcPkg Stage1
needBuilder Hpc
runMakeVerbose "testsuite/tests" ["fast"]
"test" ~> do
......
......@@ -127,7 +127,7 @@ with :: Builder -> Args
with b = specified b ? do
top <- getTopDirectory
path <- getBuilderPath b
lift $ needBuilder laxDependencies b
lift $ needBuilder b
append [withBuilderKey b ++ top -/- path]
withStaged :: (Stage -> Builder) -> Args
......
......@@ -2,7 +2,7 @@ module Settings.User (
buildRootPath, trackBuildSystem, userArgs, userPackages, userLibraryWays,
userRtsWays, userKnownPackages, integerLibrary, buildHaddock, validating,
ghciWithDebugger, ghcProfiled, ghcDebugged, dynamicGhcPrograms,
laxDependencies, verboseCommands, turnWarningsIntoErrors, splitObjects
verboseCommands, turnWarningsIntoErrors, splitObjects
) where
import Base
......@@ -74,13 +74,6 @@ ghcProfiled = False
ghcDebugged :: Bool
ghcDebugged = False
-- | When laxDependencies is set to True, dependencies on the GHC executable
-- are turned into order-only dependencies to avoid needless recompilation when
-- making changes to GHC's sources. In certain situations this can lead to build
-- failures, in which case you should reset the flag (at least temporarily).
laxDependencies :: Bool
laxDependencies = False
buildHaddock :: Predicate
buildHaddock = return cmdBuildHaddock
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment