summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/src/Rules/BinaryDist.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs
index b1b91bd5e0..f0cb547437 100644
--- a/hadrian/src/Rules/BinaryDist.hs
+++ b/hadrian/src/Rules/BinaryDist.hs
@@ -121,7 +121,13 @@ bindistRules = do
copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir
copyDirectory (rtsIncludeDir) bindistFilesDir
need ["docs"]
- copyDirectory (root -/- "docs") bindistFilesDir
+ -- TODO: we should only embed the docs that have been generated
+ -- depending on the current settings (flavours' "ghcDocs" field and
+ -- "--docs=.." command-line flag)
+ -- Currently we embed the "docs" directory if it exists but it may
+ -- contain outdated or even invalid data.
+ whenM (doesDirectoryExist (root -/- "docs")) $ do
+ copyDirectory (root -/- "docs") bindistFilesDir
when windows $ do
copyDirectory (root -/- "mingw") bindistFilesDir
-- we use that opportunity to delete the .stamp file that we use