[commit: ghc] wip/nfs-locking: Allow splitObjects to be controlled in Settings/User.hs, see #84. (b18f0e3)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:24:31 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/b18f0e3f79ee051e9d384b508f0ca3eaa902d80b/ghc

>---------------------------------------------------------------

commit b18f0e3f79ee051e9d384b508f0ca3eaa902d80b
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Jan 5 11:08:20 2016 +0000

    Allow splitObjects to be controlled in Settings/User.hs, see #84.


>---------------------------------------------------------------

b18f0e3f79ee051e9d384b508f0ca3eaa902d80b
 shaking-up-ghc.cabal    |  1 +
 src/Predicates.hs       | 12 +-----------
 src/Rules/Library.hs    |  1 -
 src/Settings/Default.hs | 15 +++++++++++++++
 src/Settings/User.hs    |  6 +++++-
 5 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/shaking-up-ghc.cabal b/shaking-up-ghc.cabal
index 334cd59..2eb9f72 100644
--- a/shaking-up-ghc.cabal
+++ b/shaking-up-ghc.cabal
@@ -76,6 +76,7 @@ executable ghc-shake
                        , Settings.Builders.HsCpp
                        , Settings.Builders.Ld
                        , Settings.Builders.Tar
+                       , Settings.Default
                        , Settings.Packages
                        , Settings.Packages.Base
                        , Settings.Packages.Compiler
diff --git a/src/Predicates.hs b/src/Predicates.hs
index 7b788fe..ad63598 100644
--- a/src/Predicates.hs
+++ b/src/Predicates.hs
@@ -1,13 +1,11 @@
 -- | Convenient predicates
 module Predicates (
     stage, package, builder, stagedBuilder, builderGcc, builderGhc, file, way,
-    stage0, stage1, stage2, notStage0, notPackage, registerPackage, splitObjects
+    stage0, stage1, stage2, notStage0, notPackage, registerPackage
     ) where
 
 import Base
 import Expression
-import GHC
-import Oracles.Config.Flag
 
 -- Basic predicates
 stage :: Stage -> Predicate
@@ -55,11 +53,3 @@ notPackage = notM . package
 -- TODO: Actually, we don't register compiler in some circumstances -- fix.
 registerPackage :: Predicate
 registerPackage = return True
-
-splitObjects :: Predicate
-splitObjects = do
-    goodStage <- notStage0 -- We don't split bootstrap (stage 0) packages
-    pkg       <- getPackage
-    supported <- lift supportsSplitObjects
-    let goodPackage = isLibrary pkg && pkg /= compiler && pkg /= rts
-    return $ goodStage && goodPackage && supported
diff --git a/src/Rules/Library.hs b/src/Rules/Library.hs
index 8633c69..d9a1a48 100644
--- a/src/Rules/Library.hs
+++ b/src/Rules/Library.hs
@@ -6,7 +6,6 @@ import Base hiding (splitPath)
 import Expression
 import GHC
 import Oracles
-import Predicates (splitObjects)
 import Rules.Actions
 import Rules.IntegerGmp
 import Rules.Resources
diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs
new file mode 100644
index 0000000..93b647a
--- /dev/null
+++ b/src/Settings/Default.hs
@@ -0,0 +1,15 @@
+module Settings.Default (defaultSplitObjects) where
+
+import Base
+import Expression
+import GHC
+import Oracles.Config.Flag
+import Predicates
+
+defaultSplitObjects :: Predicate
+defaultSplitObjects = do
+    goodStage <- notStage0 -- We don't split bootstrap (stage 0) packages
+    pkg       <- getPackage
+    supported <- lift supportsSplitObjects
+    let goodPackage = isLibrary pkg && pkg /= compiler && pkg /= rts
+    return $ goodStage && goodPackage && supported
diff --git a/src/Settings/User.hs b/src/Settings/User.hs
index cad2578..6107f6f 100644
--- a/src/Settings/User.hs
+++ b/src/Settings/User.hs
@@ -3,7 +3,7 @@ module Settings.User (
     userProgramPath, userKnownPackages, integerLibrary,
     trackBuildSystem, buildHaddock, validating, ghciWithDebugger, ghcProfiled,
     ghcDebugged, dynamicGhcPrograms, laxDependencies, buildSystemConfigFile,
-    verboseCommands, turnWarningsIntoErrors
+    verboseCommands, turnWarningsIntoErrors, splitObjects
     ) where
 
 import GHC
@@ -57,6 +57,10 @@ trackBuildSystem = True
 validating :: Bool
 validating = False
 
+-- To switch off split objects change to 'return False'
+splitObjects :: Predicate
+splitObjects = return False -- FIXME: should be defaultSplitObjects, see #84.
+
 dynamicGhcPrograms :: Bool
 dynamicGhcPrograms = False
 



More information about the ghc-commits mailing list