summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-10-17 16:05:57 -0400
committerBen Gamari <ben@smart-cactus.org>2020-10-22 16:15:34 -0400
commit64c39d3121aae9b3c1f718d35b21ed81e4cad65c (patch)
tree07d8cd967db90265ab182a30b75d9d455e1431c5
parentb02a9ea79dddd98f6bbb42e1652d7ea38db7d55e (diff)
downloadhaskell-wip/clean-ghc-tarballs.tar.gz
build system: Clean mingw tarballswip/clean-ghc-tarballs
Tamar noticed in !4293 that the build systems fail to clean up the mingw tarballs directory (`ghc-tarballs`). Fix this in both the make build system and Hadrian.
-rw-r--r--ghc.mk7
-rw-r--r--hadrian/src/Rules/Clean.hs5
2 files changed, 12 insertions, 0 deletions
diff --git a/ghc.mk b/ghc.mk
index 7546c21f20..692962d10d 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -1424,6 +1424,13 @@ distclean : clean
# Don't delete 'inplace' itself, it contains source files.
$(call removeTrees,inplace/mingw)
+# Remove the download tarballs. This is because updating
+# the tarballs doesn't remove old ones. After a tarbal is updated
+# you end up with both in your tree and get a franken build.
+# The downside here is that a maintainer clean will trigger more
+# bandwidth usage from haskell.org
+ $(call removeTrees,ghc-tarballs)
+
# Remove the fs utilities.
$(call removeFiles,utils/lndir/fs.h)
$(call removeFiles,utils/lndir/fs.c)
diff --git a/hadrian/src/Rules/Clean.hs b/hadrian/src/Rules/Clean.hs
index abf6933b56..48c1cb616f 100644
--- a/hadrian/src/Rules/Clean.hs
+++ b/hadrian/src/Rules/Clean.hs
@@ -18,6 +18,11 @@ cleanSourceTree = do
forM_ [Stage0 ..] $ removeDirectory . (path -/-) . stageString
removeDirectory "sdistprep"
cleanFsUtils
+ cleanMingwTarballs
+
+cleanMingwTarballs :: Action ()
+cleanMingwTarballs = do
+ liftIO $ IO.removeDirectoryRecursive "ghc-tarballs"
-- Clean all temporary fs files copied by configure into the source folder
cleanFsUtils :: Action ()