summaryrefslogtreecommitdiff
path: root/hadrian/src/Settings.hs
diff options
context:
space:
mode:
authorArtem Pyanykh <artempyanykh@gmail.com>2019-09-11 21:12:32 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-23 17:54:04 -0400
commitd0c2f3a2b6ec2d3ee2b9f017eb52c72cf6187d6f (patch)
tree8d1499509979fe3fc2363188664fb8168bdd013d /hadrian/src/Settings.hs
parent2778929466dafefd55a0673625f4520a234df986 (diff)
downloadhaskell-d0c2f3a2b6ec2d3ee2b9f017eb52c72cf6187d6f.tar.gz
[hadrian] Rebuild programs on dynamicGhcPrograms/ghcProfiled change
Currently, if you change these ^ flavour parameters, rebuilding is not triggered, since `programContext` doesn't set up a dependency on those values. Exposing these values via an oracle does set the dependency and properly triggers a rebuild of binaries. Several attempts to factor out these actions ended up in cyclic dependency here or there. I'm not absolutely happy with this variant either, but at least it works. ==== Issue repro: In UserSettings.hs: ``` dbgDynamic = defaultFlavour { name = "dbg-dynamic" , dynamicGhcPrograms = pure True, ... } dbgStatic = defaultFlavour { name = "dbg-static" , dynamicGhcPrograms = pure False ... } ``` Then in console: ``` $ hadrian/build.sh -j --flavour=dbg-dynamic ... does the build $ hadrian/build.sh -j --flavour=dbg-static ... does nothing, considers binaries up to date ```
Diffstat (limited to 'hadrian/src/Settings.hs')
-rwxr-xr-xhadrian/src/Settings.hs19
1 files changed, 1 insertions, 18 deletions
diff --git a/hadrian/src/Settings.hs b/hadrian/src/Settings.hs
index 0548bccfae..ba0cff770a 100755
--- a/hadrian/src/Settings.hs
+++ b/hadrian/src/Settings.hs
@@ -1,8 +1,7 @@
module Settings (
getArgs, getLibraryWays, getRtsWays, flavour, knownPackages,
findPackageByName, unsafeFindPackageByName, unsafeFindPackageByPath,
- isLibrary, stagePackages, programContext, getIntegerPackage,
- completeSetting
+ isLibrary, stagePackages, getIntegerPackage, completeSetting
) where
import CommandLine
@@ -68,22 +67,6 @@ flavour = do
getIntegerPackage :: Expr Package
getIntegerPackage = expr (integerLibrary =<< flavour)
--- TODO: there is duplication and inconsistency between this and
--- Rules.Program.getProgramContexts. There should only be one way to get a
--- context / contexts for a given stage and package.
-programContext :: Stage -> Package -> Action Context
-programContext stage pkg = do
- profiled <- ghcProfiled <$> flavour
- dynGhcProgs <- dynamicGhcPrograms =<< flavour
- return $ Context stage pkg (wayFor profiled dynGhcProgs)
-
- where wayFor prof dyn
- | prof && dyn =
- error "programContext: profiling+dynamic not supported"
- | pkg == ghc && prof && stage > Stage0 = profiling
- | dyn && stage > Stage0 = dynamic
- | otherwise = vanilla
-
-- TODO: switch to Set Package as the order of packages should not matter?
-- Otherwise we have to keep remembering to sort packages from time to time.
knownPackages :: [Package]