Fix broken colours with `-j` (#484)
[hadrian.git] / src / UserSettings.hs
1 -- If you want to customise your build you should copy this file from
2 -- hadrian/src/UserSettings.hs to hadrian/UserSettings.hs and edit your copy.
3 -- If you don't copy the file your changes will be tracked by git and you can
4 -- accidentally commit them.
5 module UserSettings (
6 userBuildRoot, userFlavours, userPackages, verboseCommand,
7 buildProgressColour, successColour, stage1Only
8 ) where
9
10 import Hadrian.Utilities
11
12 import Flavour
13 import Expression
14 import {-# SOURCE #-} Settings.Default
15
16 -- See doc/user-settings.md for instructions.
17 -- Please update doc/user-settings.md when committing changes to this file.
18
19 -- | All build results are put into the 'buildRoot' directory.
20 userBuildRoot :: BuildRoot
21 userBuildRoot = BuildRoot "_build"
22
23 -- | User-defined build flavours. See 'userFlavour' as an example.
24 userFlavours :: [Flavour]
25 userFlavours = [userFlavour] -- Add more build flavours if need be.
26
27 -- | This is an example user-defined build flavour. Feel free to modify it and
28 -- use by passing @--flavour=user@ from the command line.
29 userFlavour :: Flavour
30 userFlavour = defaultFlavour { name = "user" } -- Modify other settings here.
31
32 -- | Add user-defined packages. Note, this only lets Hadrian know about the
33 -- existence of a new package; to actually build it you need to create a new
34 -- build flavour, modifying the list of packages that are built by default.
35 userPackages :: [Package]
36 userPackages = []
37
38 -- | Set to 'True' to print full command lines during the build process. Note:
39 -- this is a 'Predicate', hence you can enable verbose output only for certain
40 -- targets, e.g.: @verboseCommand = package ghcPrim@.
41 verboseCommand :: Predicate
42 verboseCommand = do
43 verbosity <- expr getVerbosity
44 return $ verbosity >= Loud
45
46 -- | Set colour for build progress messages (e.g. executing a build command).
47 buildProgressColour :: BuildProgressColour
48 buildProgressColour = mkBuildProgressColour (Dull Magenta)
49
50 -- | Set colour for success messages (e.g. a package is built successfully).
51 successColour :: SuccessColour
52 successColour = mkSuccessColour (Dull Green)
53
54 -- TODO: Set this flag from the command line.
55 -- | Set this flag to 'True' to disable building Stage2 GHC (i.e. the @ghc-stage2@
56 -- executable) and Stage2 utilities (such as @haddock@). Note that all Stage0
57 -- and Stage1 libraries (including 'compiler') will still be built. Enabling
58 -- this flag during installation leads to installing @ghc-stage1@ instead of
59 -- @ghc-stage2@, and @ghc-pkg@ that was build with the Stage0 compiler.
60 -- Also see Note [No stage2 packages when CrossCompiling or Stage1Only] in the
61 -- top-level @ghc.mk@.
62 stage1Only :: Bool
63 stage1Only = False