[commit: ghc] wip/nfs-locking: Clean the source tree before building source distribution (e918ec1)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:53:35 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/e918ec1d54a5e1b02bc6d466d0487cece77172a4/ghc
>---------------------------------------------------------------
commit e918ec1d54a5e1b02bc6d466d0487cece77172a4
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Wed Aug 2 02:51:38 2017 +0100
Clean the source tree before building source distribution
See #384
>---------------------------------------------------------------
e918ec1d54a5e1b02bc6d466d0487cece77172a4
src/Rules/Clean.hs | 28 +++++++++++++++++-----------
src/Rules/SourceDist.hs | 3 +++
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/src/Rules/Clean.hs b/src/Rules/Clean.hs
index 33f1e3e..a8528e8 100644
--- a/src/Rules/Clean.hs
+++ b/src/Rules/Clean.hs
@@ -1,4 +1,4 @@
-module Rules.Clean (cleanRules) where
+module Rules.Clean (clean, cleanSourceTree, cleanRules) where
import Base
import Settings.Path
@@ -6,14 +6,20 @@ import Stage
import UserSettings
import Util
+clean :: Action ()
+clean = do
+ cleanSourceTree
+ putBuild $ "| Remove Hadrian files..."
+ removeDirectory generatedPath
+ removeFilesAfter buildRootPath ["//*"]
+ putSuccess $ "| Done. "
+
+cleanSourceTree :: Action ()
+cleanSourceTree = do
+ forM_ [Stage0 ..] $ removeDirectory . (buildRootPath -/-) . stageString
+ removeDirectory inplaceBinPath
+ removeDirectory inplaceLibPath
+ removeDirectory "sdistprep"
+
cleanRules :: Rules ()
-cleanRules = do
- "clean" ~> do
- forM_ [Stage0 ..] $ removeDirectory . (buildRootPath -/-) . stageString
- removeDirectory generatedPath
- removeDirectory inplaceBinPath
- removeDirectory inplaceLibPath
- removeDirectory "sdistprep"
- putBuild $ "| Remove Hadrian files..."
- removeFilesAfter buildRootPath ["//*"]
- putSuccess $ "| Done. "
+cleanRules = "clean" ~> clean
diff --git a/src/Rules/SourceDist.hs b/src/Rules/SourceDist.hs
index 7a60238..40a4156 100644
--- a/src/Rules/SourceDist.hs
+++ b/src/Rules/SourceDist.hs
@@ -4,12 +4,14 @@ import Base
import Builder
import Oracles.Config.Setting
import Oracles.DirectoryContents
+import Rules.Clean
import UserSettings
import Util
sourceDistRules :: Rules ()
sourceDistRules = do
"sdist-ghc" ~> do
+ cleanSourceTree -- We clean the source tree first, see #384
version <- setting ProjectVersion
need ["sdistprep/ghc-" ++ version ++ "-src.tar.xz"]
putSuccess "| Done"
@@ -41,6 +43,7 @@ prepareTree dest = do
, Test "//*~"
, Test "//autom4te*"
, Test "//dist"
+ , Test "//dist-install"
, Test "//log"
, Test "//stage0"
, Test "//stage1"
More information about the ghc-commits
mailing list