[commit: ghc] wip/nfs-locking: Enable optional UserSettings.hs file (123bdb3)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:34:09 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/123bdb37674bfe60509886ec92c99e80b0588966/ghc
>---------------------------------------------------------------
commit 123bdb37674bfe60509886ec92c99e80b0588966
Author: Kai Harries <kai.harries at gmail.com>
Date: Sat May 28 17:53:07 2016 +0200
Enable optional UserSettings.hs file
Fix #247
The defaul user settings are stored in ./src/UserSettings.hs. If the
user want to override these settings, he can copy this file into ./ and
make the desired changes to ./UserSettings.hs.
>---------------------------------------------------------------
123bdb37674bfe60509886ec92c99e80b0588966
.gitignore | 3 +
README.md | 3 +-
doc/user-settings.md | 5 +-
hadrian.cabal | 3 +-
src/Settings/User.hs | 103 ++----------------------------
src/{Settings/User.hs => UserSettings.hs} | 8 ++-
6 files changed, 20 insertions(+), 105 deletions(-)
diff --git a/.gitignore b/.gitignore
index b7bfddb..5307cdd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,6 @@ cabal.sandbox.config
# build.stack.sh specific
/.stack-work/
+
+# the user settings
+/UserSettings.hs
diff --git a/README.md b/README.md
index e4fb7dc..b1da6f7 100644
--- a/README.md
+++ b/README.md
@@ -88,7 +88,7 @@ by Shake oracles.
#### User settings
The `make`-based build system uses `mk/build.mk` to specify user build settings. We
-use [`src/Settings/User.hs`][user-settings] for the same purpose, see
+use `./UserSettings.hs` for the same purpose, see
[documentation](doc/user-settings.md).
#### Clean and full rebuild
@@ -155,7 +155,6 @@ helped me endure and enjoy the project.
[windows-build]: https://github.com/snowleopard/hadrian/blob/master/doc/windows.md
[build-artefacts-issue]: https://github.com/snowleopard/hadrian/issues/113
[ghc-split-objs-bug]: https://ghc.haskell.org/trac/ghc/ticket/11315
-[user-settings]: https://github.com/snowleopard/hadrian/blob/master/src/Settings/User.hs
[test-issue]: https://github.com/snowleopard/hadrian/issues/197
[dynamic-issue]: https://github.com/snowleopard/hadrian/issues/4
[validation-issue]: https://github.com/snowleopard/hadrian/issues/187
diff --git a/doc/user-settings.md b/doc/user-settings.md
index 1433ae9..a5185ad 100644
--- a/doc/user-settings.md
+++ b/doc/user-settings.md
@@ -1,7 +1,8 @@
# User settings
-You can customise Hadrian by specifying user build settings in file
-`src/Settings/User.hs`. Here we document currently supported settings.
+You can customise Hadrian by copying the file ./src/UserSettings.hs to
+./UserSettings.hs and specifying user build settings in
+`./UserSettings.hs`. Here we document currently supported settings.
## Build directory
diff --git a/hadrian.cabal b/hadrian.cabal
index c9d5551..3bbc2dd 100644
--- a/hadrian.cabal
+++ b/hadrian.cabal
@@ -16,7 +16,8 @@ source-repository head
executable hadrian
main-is: Main.hs
- hs-source-dirs: src
+ hs-source-dirs: .
+ , src
other-modules: Base
, Builder
, CmdLineFlag
diff --git a/src/Settings/User.hs b/src/Settings/User.hs
index 16c7c25..9588297 100644
--- a/src/Settings/User.hs
+++ b/src/Settings/User.hs
@@ -5,101 +5,8 @@ module Settings.User (
turnWarningsIntoErrors, splitObjects, verboseCommands, putBuild, putSuccess
) where
-import System.Console.ANSI
-
-import Base
-import CmdLineFlag
-import GHC
-import Predicate
-import Settings.Default
-
--- See doc/user-settings.md for instructions.
-
--- | All build results are put into 'buildRootPath' directory.
-buildRootPath :: FilePath
-buildRootPath = "_build"
-
--- | Modify default build command line arguments.
-userArgs :: Args
-userArgs = builder Ghc ? remove ["-Wall", "-fwarn-tabs"]
-
--- | Modify the set of packages that are built by default in each stage.
-userPackages :: Packages
-userPackages = mempty
-
--- | Add user defined packages. Don't forget to add them to 'userPackages' too.
-userKnownPackages :: [Package]
-userKnownPackages = []
-
--- | Choose the integer library: 'integerGmp' or 'integerSimple'.
-integerLibrary :: Package
-integerLibrary = integerGmp
-
--- FIXME: We skip 'dynamic' since it's currently broken #4.
--- | Modify the set of ways in which library packages are built.
-userLibraryWays :: Ways
-userLibraryWays = remove [dynamic]
-
--- | Modify the set of ways in which the 'rts' package is built.
-userRtsWays :: Ways
-userRtsWays = mempty
-
--- | User defined flags. Note the following type semantics:
--- * @Bool@: a plain Boolean flag whose value is known at compile time.
--- * @Action Bool@: a flag whose value can depend on the build environment.
--- * @Predicate@: a flag whose value can depend on the build environment and
--- on the current build target.
-
--- TODO: Drop 'trackBuildSystem' as it brings negligible gains.
--- | Set this to True if you are making any changes in the build system and want
--- appropriate rebuilds to be initiated. Switching this to False speeds things
--- up a little (particularly zero builds).
--- WARNING: a complete rebuild is required when changing this setting.
-trackBuildSystem :: Bool
-trackBuildSystem = True
-
--- TODO: This should be set automatically when validating.
-validating :: Bool
-validating = False
-
--- | Control when split objects are generated. Note, due to the GHC bug #11315
--- it is necessary to do a full clean rebuild when changing this option.
-splitObjects :: Predicate
-splitObjects = (return cmdSplitObjects) &&^ defaultSplitObjects
-
--- | Control when to build Haddock documentation.
-buildHaddock :: Predicate
-buildHaddock = return cmdBuildHaddock
-
--- TODO: Do we need to be able to set these from command line?
--- TODO: Turn the flags below into a simple list @ghcWays :: [Way]@?
-dynamicGhcPrograms :: Bool
-dynamicGhcPrograms = False
-
-ghciWithDebugger :: Bool
-ghciWithDebugger = False
-
-ghcProfiled :: Bool
-ghcProfiled = False
-
-ghcDebugged :: Bool
-ghcDebugged = False
-
--- TODO: Replace with stage2 ? arg "-Werror"? Also see #251.
--- | To enable -Werror in Stage2 set turnWarningsIntoErrors = stage2.
-turnWarningsIntoErrors :: Predicate
-turnWarningsIntoErrors = return False
-
--- | Set to True to print full command lines during the build process. Note,
--- this is a Predicate, hence you can enable verbose output only for certain
--- targets, e.g.: @verboseCommands = package ghcPrim at .
-verboseCommands :: Predicate
-verboseCommands = return False
-
--- | Customise build progress messages (e.g. executing a build command).
-putBuild :: String -> Action ()
-putBuild = putColoured Vivid White
-
--- | Customise build success messages (e.g. a package is built successfully).
-putSuccess :: String -> Action ()
-putSuccess = putColoured Vivid Green
+-- Import the actual user settings from the module UserSettings.
+-- The user can put an UserSettings.hs file into the hadrian root
+-- folder that takes precedence over the default UserSettings.hs
+-- file located in src/.
+import UserSettings
diff --git a/src/Settings/User.hs b/src/UserSettings.hs
similarity index 94%
copy from src/Settings/User.hs
copy to src/UserSettings.hs
index 16c7c25..7560aa1 100644
--- a/src/Settings/User.hs
+++ b/src/UserSettings.hs
@@ -1,4 +1,8 @@
-module Settings.User (
+--
+-- If you want to customize your build you should copy this file from
+-- ./src/UserSettings.hs to ./UserSettings.hs and only edit your copy.
+--
+module UserSettings (
buildRootPath, trackBuildSystem, userArgs, userPackages, userLibraryWays,
userRtsWays, userKnownPackages, integerLibrary, buildHaddock, validating,
ghciWithDebugger, ghcProfiled, ghcDebugged, dynamicGhcPrograms,
@@ -74,7 +78,7 @@ buildHaddock = return cmdBuildHaddock
-- TODO: Do we need to be able to set these from command line?
-- TODO: Turn the flags below into a simple list @ghcWays :: [Way]@?
dynamicGhcPrograms :: Bool
-dynamicGhcPrograms = False
+dynamicGhcPrograms = True
ghciWithDebugger :: Bool
ghciWithDebugger = False
More information about the ghc-commits
mailing list