Commit 39f05090 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Clean up switching from Settings.User to UserSettings

parent c9e7570b
# This file is processed by the configure script
# See 'src/Settings/User.hs' for user-defined settings
#=====================================================
# This file is processed by the configure script.
# See hadrian/src/UserSettings.hs for user-defined settings.
#===========================================================
# Paths to builders:
#===================
......
......@@ -104,10 +104,10 @@ executable hadrian
, Settings.Packages.Touchy
, Settings.Packages.Unlit
, Settings.Paths
, Settings.User
, Settings.Ways
, Stage
, Target
, UserSettings
, Way
default-language: Haskell2010
......
......@@ -21,7 +21,7 @@ import Stage
-- all of them. However, not all of these packages will be built. For example,
-- package 'win32' is built only on Windows.
-- "Packages" defines default conditions for building each package, which can
-- be overridden in "Settings.User".
-- be overridden in @hadrian/src/UserSettings.hs@.
defaultKnownPackages :: [Package]
defaultKnownPackages =
[ array, base, binary, bytestring, cabal, checkApiAnnotations, compiler
......
......@@ -9,8 +9,8 @@ import GHC
import Rules.Actions
import Settings.Builders.GhcCabal
import Settings.Paths
import Settings.User
import Target
import UserSettings
packageDatabaseOracle :: Rules ()
packageDatabaseOracle = void $
......
......@@ -7,8 +7,8 @@ import Rules.Actions
import Rules.Generate
import Settings.Packages
import Settings.Paths
import Settings.User
import Stage
import UserSettings
cleanRules :: Rules ()
cleanRules = do
......
......@@ -9,9 +9,9 @@ import Context
import GHC
import Rules.Actions
import Rules.Generators.GhcAutoconfH
import Settings.User
import Stage
import Target
import UserSettings
configureRules :: Rules ()
configureRules = do
......
......@@ -2,10 +2,10 @@ module Rules.Generators.Common (trackSource, yesNo, cppify) where
import Base
import Expression
import Settings.User
import UserSettings
-- | Track a given source file when constructing an expression if the user
-- enabled 'trackBuildSystem' in "Settings.User".
-- enabled 'trackBuildSystem' in @hadrian/src/UserSettings.hs@.
trackSource :: FilePath -> Expr ()
trackSource file = lift $ when trackBuildSystem $ need [ sourcePath -/- file ]
......
......@@ -8,8 +8,8 @@ import Oracles.Config.Setting
import Rules.Actions
import Settings.Packages.IntegerGmp
import Settings.Paths
import Settings.User
import Target
import UserSettings
gmpBase :: FilePath
gmpBase = pkgPath integerGmp -/- "gmp"
......
......@@ -10,8 +10,8 @@ import Rules.Actions
import Settings.Builders.Common
import Settings.Packages.Rts
import Settings.Paths
import Settings.User
import Target
import UserSettings
-- TODO: this should be moved elsewhere
rtsBuildPath :: FilePath
......
......@@ -8,7 +8,7 @@ import Test.QuickCheck
import Base
import Oracles.ModuleFiles
import Settings.Builders.Ar
import Settings.User
import UserSettings
import Way
instance Arbitrary Way where
......
......@@ -9,8 +9,8 @@ import Oracles.Config.Setting
import Oracles.WindowsPath
import Rules.Actions
import Settings.Packages
import Settings.User
import Target
import UserSettings
-- TODO: clean up after testing
testRules :: Rules ()
......
module Settings (
module Settings.Packages,
module Settings.Paths,
module Settings.User,
module Settings.Ways,
module UserSettings,
getPkgData, getPkgDataList, getTopDirectory, isLibrary,
getPackagePath, getContextDirectory, getBuildPath
) where
......@@ -13,8 +13,8 @@ import Oracles.PackageData
import Oracles.WindowsPath
import Settings.Packages
import Settings.Paths
import Settings.User
import Settings.Ways
import UserSettings
getPackagePath :: Expr FilePath
getPackagePath = pkgPath <$> getPackage
......
......@@ -34,7 +34,7 @@ import Settings.Packages.Rts
import Settings.Packages.RunGhc
import Settings.Packages.Touchy
import Settings.Packages.Unlit
import Settings.User
import UserSettings
getArgs :: Expr [String]
getArgs = fromDiffExpr $ mconcat [ defaultBuilderArgs
......
......@@ -4,7 +4,7 @@ import Base
import GHC
import Predicate
import Oracles.Config.Setting
import Settings.User
import UserSettings
-- Combining default list of packages with user modifications
getPackages :: Expr [Package]
......
......@@ -10,7 +10,7 @@ import Context
import Expression
import GHC
import Oracles.PackageData
import Settings.User
import UserSettings
shakeFilesPath :: FilePath
shakeFilesPath = buildRootPath -/- "hadrian/shake-files"
......
module Settings.User (
buildRootPath, trackBuildSystem, userArgs, userPackages, userLibraryWays,
userRtsWays, userKnownPackages, integerLibrary, buildHaddock, validating,
ghciWithDebugger, ghcProfiled, ghcDebugged, dynamicGhcPrograms,
turnWarningsIntoErrors, splitObjects, verboseCommands, putBuild, putSuccess
) where
-- 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
......@@ -5,7 +5,7 @@ import CmdLineFlag
import Oracles.Config.Flag
import Predicate
import Settings.Flavours.Quick
import Settings.User
import UserSettings
-- | Combine default library ways with user modifications.
getLibraryWays :: Expr [Way]
......
--
-- If you want to customize your build you should copy this file from
-- ./src/UserSettings.hs to ./UserSettings.hs and only edit your copy.
--
-- If you want to customise your build you should copy this file from
-- hadrian/src/UserSettings.hs to hadrian/UserSettings.hs and edit your copy.
-- If you don't copy the file your changes will be tracked by git and you can
-- accidentally commit them.
module UserSettings (
buildRootPath, trackBuildSystem, userArgs, userPackages, userLibraryWays,
userRtsWays, userKnownPackages, integerLibrary, buildHaddock, validating,
......@@ -69,7 +69,7 @@ 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
splitObjects = return cmdSplitObjects &&^ defaultSplitObjects
-- | Control when to build Haddock documentation.
buildHaddock :: Predicate
......
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