[commit: ghc] master: Minor revision (63b9d5f)

git at git.haskell.org git at git.haskell.org
Tue Oct 23 20:13:18 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/63b9d5f0676f5accad2032b1853722dde51d5ee6/ghc

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

commit 63b9d5f0676f5accad2032b1853722dde51d5ee6
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Fri Feb 9 02:23:44 2018 +0000

    Minor revision


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

63b9d5f0676f5accad2032b1853722dde51d5ee6
 src/Base.hs                      | 32 ++++++++++++++++----------------
 src/Rules/Test.hs                |  4 +---
 src/Settings/Builders/Hsc2Hs.hs  |  1 -
 src/Settings/Builders/RunTest.hs | 12 ++++++------
 4 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/src/Base.hs b/src/Base.hs
index 6bfa460..c3cb353 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -70,6 +70,18 @@ configH = "mk/config.h"
 shakeFilesDir :: FilePath
 shakeFilesDir = "hadrian"
 
+-- | Directory for binaries that are built "in place".
+inplaceBinPath :: FilePath
+inplaceBinPath = "inplace/bin"
+
+-- | Directory for libraries that are built "in place".
+inplaceLibPath :: FilePath
+inplaceLibPath = "inplace/lib"
+
+-- | Directory for binary wrappers, and auxiliary binaries such as @touchy at .
+inplaceLibBinPath :: FilePath
+inplaceLibBinPath = inplaceLibPath -/- "bin"
+
 -- | The directory in 'buildRoot' containing generated source files that are not
 -- package-specific, e.g. @ghcplatform.h at .
 generatedDir :: FilePath
@@ -81,7 +93,7 @@ stage0PackageDbDir = "stage0/bootstrapping.conf"
 
 -- | Path to the inplace package database used in 'Stage1' and later.
 inplacePackageDbPath :: FilePath
-inplacePackageDbPath = "inplace/lib/package.conf.d"
+inplacePackageDbPath = inplaceLibPath -/- "package.conf.d"
 
 -- | Path to the package database used in a given 'Stage'.
 packageDbPath :: Stage -> Action FilePath
@@ -92,21 +104,8 @@ packageDbPath _      = return inplacePackageDbPath
 packageDbStamp :: FilePath
 packageDbStamp = ".stamp"
 
--- | Directory for binaries that are built "in place".
-inplaceBinPath :: FilePath
-inplaceBinPath = "inplace/bin"
-
--- | Directory for libraries that are built "in place".
-inplaceLibPath :: FilePath
-inplaceLibPath = "inplace/lib"
-
--- | Directory for binary wrappers, and auxiliary binaries such as @touchy at .
-inplaceLibBinPath :: FilePath
-inplaceLibBinPath = inplaceLibPath -/- "bin"
-
--- ref: ghc/ghc.mk:142
--- ref: driver/ghc.mk
--- ref: utils/hsc2hs/ghc.mk:35
+-- ref: GHC_DEPENDENCIES in ghc/ghc.mk
+-- ref: INSTALL_LIBS in driver/ghc.mk
 -- TODO: Derive this from Builder.runtimeDependencies
 -- | Files that need to be copied over to 'inplaceLibPath'.
 inplaceLibCopyTargets :: [FilePath]
@@ -125,6 +124,7 @@ inplaceLibCopyTargets = map (inplaceLibPath -/-)
 haddockHtmlResourcesStamp :: FilePath
 haddockHtmlResourcesStamp = inplaceLibPath -/- "html/README.md"
 
+-- ref: utils/hsc2hs/ghc.mk
 -- | Path to 'hsc2hs' template.
 templateHscPath :: FilePath
 templateHscPath = inplaceLibPath -/- "template-hsc.h"
diff --git a/src/Rules/Test.hs b/src/Rules/Test.hs
index 0fedd70..1205051 100644
--- a/src/Rules/Test.hs
+++ b/src/Rules/Test.hs
@@ -35,11 +35,9 @@ testRules = do
     "validate" ~> do
         needBuilder $ Ghc CompileHs Stage2
         needBuilder $ GhcPkg Update Stage1
+        needBuilder Hp2Ps
         needBuilder Hpc
         needBuilder Hsc2Hs
-        -- TODO: Eliminate explicit filepaths.
-        -- See https://github.com/snowleopard/hadrian/issues/376.
-        need ["inplace/bin/hp2ps"]
         build $ target (vanillaContext Stage2 compiler) (Make "testsuite/tests") [] []
 
     "test" ~> do
diff --git a/src/Settings/Builders/Hsc2Hs.hs b/src/Settings/Builders/Hsc2Hs.hs
index 6185f6b..80e80db 100644
--- a/src/Settings/Builders/Hsc2Hs.hs
+++ b/src/Settings/Builders/Hsc2Hs.hs
@@ -28,7 +28,6 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do
             , notStage0 ? arg ("--cflag=-D" ++ tOs   ++ "_HOST_OS=1"  )
             , arg $ "--cflag=-D__GLASGOW_HASKELL__=" ++ version
             , arg $ "--template=" ++ top -/- templateHscPath
-            , arg $ "-I" ++ top -/- "inplace/lib/include/"
             , arg =<< getInput
             , arg "-o", arg =<< getOutput ]
 
diff --git a/src/Settings/Builders/RunTest.hs b/src/Settings/Builders/RunTest.hs
index 3094e8d..c348bf1 100644
--- a/src/Settings/Builders/RunTest.hs
+++ b/src/Settings/Builders/RunTest.hs
@@ -2,10 +2,10 @@ module Settings.Builders.RunTest (runTestBuilderArgs) where
 
 import Hadrian.Utilities
 
+import CommandLine (TestArgs(..), defaultTestArgs)
 import Flavour
 import Rules.Test
 import Settings.Builders.Common
-import CommandLine ( TestArgs(..), defaultTestArgs )
 
 -- Arguments to send to the runtest.py script.
 runTestBuilderArgs :: Args
@@ -29,11 +29,11 @@ runTestBuilderArgs = builder RunTest ? do
     verbose  <- shakeVerbosity <$> expr getShakeOptions
 
     top      <- expr topDirectory
-    compiler <- expr $ builderPath $ Ghc CompileHs Stage2
-    ghcPkg   <- expr $ builderPath $ GhcPkg Update Stage1
-    haddock  <- expr $ builderPath $ Haddock BuildPackage
-    hp2ps    <- expr $ builderPath $ Hp2Ps
-    hpc      <- expr $ builderPath $ Hpc
+    compiler <- getBuilderPath $ Ghc CompileHs Stage2
+    ghcPkg   <- getBuilderPath $ GhcPkg Update Stage1
+    haddock  <- getBuilderPath $ Haddock BuildPackage
+    hp2ps    <- getBuilderPath $ Hp2Ps
+    hpc      <- getBuilderPath $ Hpc
 
     ghcFlags    <- expr runTestGhcFlags
     timeoutProg <- expr buildRoot <&> (-/- timeoutProgPath)



More information about the ghc-commits mailing list