[commit: ghc] wip/nfs-locking: Add comments, order Builder alphabetically. (a4c1eba)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:36:55 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/a4c1ebabfc62d83ec7d717210db4ae56ca900205/ghc
>---------------------------------------------------------------
commit a4c1ebabfc62d83ec7d717210db4ae56ca900205
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Sat Aug 22 21:18:28 2015 +0100
Add comments, order Builder alphabetically.
>---------------------------------------------------------------
a4c1ebabfc62d83ec7d717210db4ae56ca900205
src/Builder.hs | 47 ++++++++++++++++++++++-------------------------
1 file changed, 22 insertions(+), 25 deletions(-)
diff --git a/src/Builder.hs b/src/Builder.hs
index 5d60035..dde37c1 100644
--- a/src/Builder.hs
+++ b/src/Builder.hs
@@ -11,48 +11,45 @@ import Stage
-- Ghc Stage0 is the bootstrapping compiler
-- Ghc StageN, N > 0, is the one built on stage (N - 1)
-- GhcPkg Stage0 is the bootstrapping GhcPkg
--- GhcPkg StageN, N > 0, is the one built on stage 0 (TODO: need only Stage1?)
+-- GhcPkg StageN, N > 0, is the one built in Stage0 (TODO: need only Stage1?)
-- TODO: add Cpp builders
-- TODO: rename Gcc to Cc?
-data Builder = Ar
- | Ld
- | Alex
- | Happy
- | Haddock
- | HsColour
- | GhcCabal
+data Builder = Alex
+ | Ar
| Gcc Stage
+ | GccM Stage
| Ghc Stage
+ | GhcCabal
+ | GhcCabalHsColour
| GhcM Stage
- | GccM Stage
| GhcPkg Stage
- | GhcCabalHsColour
+ | Haddock
+ | Happy
+ | HsColour
+ | Ld
deriving (Show, Eq, Generic)
-- Configuration files refer to Builders as follows:
--- TODO: determine paths to utils without looking up configuration files
builderKey :: Builder -> String
builderKey builder = case builder of
- Ar -> "ar"
- Ld -> "ld"
Alex -> "alex"
- Happy -> "happy"
- Haddock -> "haddock"
- HsColour -> "hscolour"
- GhcCabal -> "ghc-cabal"
+ Ar -> "ar"
+ Gcc Stage0 -> "system-gcc"
+ Gcc _ -> "gcc"
+ GccM stage -> builderKey $ Gcc stage -- Synonym for 'Gcc -MM'
Ghc Stage0 -> "system-ghc"
Ghc Stage1 -> "ghc-stage1"
Ghc Stage2 -> "ghc-stage2"
Ghc Stage3 -> "ghc-stage3"
- Gcc Stage0 -> "system-gcc"
- Gcc _ -> "gcc"
+ GhcM stage -> builderKey $ Ghc stage -- Synonym for 'Ghc -M'
+ GhcCabal -> "ghc-cabal"
+ GhcCabalHsColour -> builderKey $ GhcCabal -- Synonym for 'GhcCabal hscolour'
GhcPkg Stage0 -> "system-ghc-pkg"
GhcPkg _ -> "ghc-pkg"
- -- GhcM/GccM are synonyms for Ghc/Gcc (called with -M and -MM flags)
- GhcM stage -> builderKey $ Ghc stage
- GccM stage -> builderKey $ Gcc stage
- -- GhcCabalHsColour is a synonym for GhcCabal (called in hscolour mode)
- GhcCabalHsColour -> builderKey $ GhcCabal
+ Happy -> "happy"
+ Haddock -> "haddock"
+ HsColour -> "hscolour"
+ Ld -> "ld"
builderPath :: Builder -> Action FilePath
builderPath builder = do
@@ -77,7 +74,7 @@ needBuilder laxDependencies builder = do
allowOrderOnlyDependency :: Builder -> Bool
allowOrderOnlyDependency (Ghc _) = True
allowOrderOnlyDependency (GhcM _) = True
- allowOrderOnlyDependency _ = False
+ allowOrderOnlyDependency _ = False
-- On Windows: if the path starts with "/", prepend it with the correct path to
-- the root, e.g: "/usr/local/bin/ghc.exe" => "C:/msys/usr/local/bin/ghc.exe".
More information about the ghc-commits
mailing list