summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-03-08 13:31:01 +0100
committerAndreas Klebinger <klebinger.andreas@gmx.at>2021-03-08 13:31:01 +0100
commit9089d8afe3d5301408baa4865363c92066cbe303 (patch)
treec1fb2bf8ee6ad189cbb8f5f3ccc53118e1440d4a
parent3e082f8ff5ea2f42c5e6430094683b26b5818fb8 (diff)
downloadhaskell-wip/andreask/validate_clean.tar.gz
Add a distclean command to hadrian.wip/andreask/validate_clean
Hadrian should behave well and not delete files created by configure with the clean command. With this patch hadrian now deletes the fs/mingw tarballs only with distclean. This fixes #19320. The main impact being that validate won't have to redownload the tarballs when re-run.
-rw-r--r--hadrian/README.md3
-rw-r--r--hadrian/src/Rules/Clean.hs13
2 files changed, 13 insertions, 3 deletions
diff --git a/hadrian/README.md b/hadrian/README.md
index d0ab7a274d..fcbe185a10 100644
--- a/hadrian/README.md
+++ b/hadrian/README.md
@@ -210,6 +210,9 @@ is close to zero (see [#197][test-issue]).
* `build clean` removes all build artefacts.
+* `build distclean` additionally remove the mingw tarballs and fs* files created
+ by configure.
+
* `build -B` forces Shake to rerun all rules, even if the previous build results
are still up-to-date.
diff --git a/hadrian/src/Rules/Clean.hs b/hadrian/src/Rules/Clean.hs
index d57a7967aa..26a279d178 100644
--- a/hadrian/src/Rules/Clean.hs
+++ b/hadrian/src/Rules/Clean.hs
@@ -3,6 +3,13 @@ module Rules.Clean (clean, cleanSourceTree, cleanRules) where
import qualified System.Directory as IO
import Base
+distclean :: Action ()
+distclean = do
+ putBuild "| Removing mingw tarballs..."
+ cleanMingwTarballs
+ cleanFsUtils
+ clean
+
clean :: Action ()
clean = do
putBuild "| Removing Hadrian files..."
@@ -17,8 +24,6 @@ cleanSourceTree = do
path <- buildRoot
forM_ [Stage0 ..] $ removeDirectory . (path -/-) . stageString
removeDirectory "sdistprep"
- cleanFsUtils
- cleanMingwTarballs
cleanMingwTarballs :: Action ()
cleanMingwTarballs = do
@@ -36,4 +41,6 @@ cleanFsUtils = do
liftIO $ forM_ dirs (flip removeFiles ["fs.*"])
cleanRules :: Rules ()
-cleanRules = "clean" ~> clean
+cleanRules = do
+ "clean" ~> clean
+ "distclean" ~> distclean