summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-30 12:43:10 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-06-01 07:44:52 -0400
commit9004be3cb19d914fa723082d35689afabede796b (patch)
treeecd94627cd885d9212d05c1f02921414d5b4a5fd
parent514a6a28db16793d6d2ca8fe7863e82943f56374 (diff)
downloadhaskell-9004be3cb19d914fa723082d35689afabede796b.tar.gz
source-dist: Copy in files created by ./boot
Since we started producing source dists with hadrian we stopped copying in the files created by ./boot which adds a dependency on python3 and autoreconf. This adds back in the files which were created by running configure. Fixes #21673 #21672 and #21626
-rw-r--r--hadrian/src/Rules/SourceDist.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/hadrian/src/Rules/SourceDist.hs b/hadrian/src/Rules/SourceDist.hs
index a673fb434c..b218f66c63 100644
--- a/hadrian/src/Rules/SourceDist.hs
+++ b/hadrian/src/Rules/SourceDist.hs
@@ -125,11 +125,39 @@ prepareTree dest = do
let target = dest -/- source
copyFileSourceDist (top -/- source) target
copyAlexHappyFiles
+ copyBootFiles
where
getFiles = filter treeFilter . split (=='\NUL')
treeFilter file = not (null file) && not ("testsuite//" ?== file)
+ -- Copy files created by running ./boot
+ copyBootFiles = do
+ top <- topDirectory
+ forM_ bootFiles $ \file -> do
+ let src_file = top -/- file
+ dest_file = top -/- dest -/- file
+ createFileLink src_file dest_file
+ -- And move ./boot so we can't accidentally call it in CI
+ moveFile (dest -/- "boot") (dest -/- "boot.source")
+
+ bootFiles =
+ [ pkgPath process -/- "include" -/- "HsProcessConfig.h.in"
+ , pkgPath process -/- "configure"
+ , pkgPath ghcBignum -/- "configure"
+ , pkgPath base -/- "configure"
+ , pkgPath base -/- "include" -/- "HsBaseConfig.h.in"
+ , pkgPath directory -/- "configure"
+ , pkgPath directory -/- "HsDirectoryConfig.h.in"
+ , pkgPath time -/- "configure"
+ , pkgPath time -/- "lib" -/- "include" -/- "HsTimeConfig.h.in"
+ , pkgPath unix -/- "configure"
+ , pkgPath unix -/- "include" -/- "HsUnixConfig.h.in"
+ , pkgPath terminfo -/- "configure"
+ , "configure"
+ , "aclocal.m4"
+ , "mk" -/- "config.h.in" ]
+
copyAlexHappyFiles =
forM_ alexHappyFiles $ \(stg, pkg, inp, out) -> do
let ctx = Context stg pkg vanilla