diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2021-03-08 13:31:01 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-09 02:47:31 -0500 |
commit | 7a728ca6a52ff8c1a1ad43c81cf9289a61dca107 (patch) | |
tree | 8fdb1f6681404fc9ab3c4abfb8e48b81d62bd7b2 /hadrian | |
parent | 376427ece3a6206b35a13837ec14c86673eb0fe4 (diff) | |
download | haskell-7a728ca6a52ff8c1a1ad43c81cf9289a61dca107.tar.gz |
Add a distclean command to hadrian.
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.
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/README.md | 3 | ||||
-rw-r--r-- | hadrian/src/Rules/Clean.hs | 13 |
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 |