[Git][ghc/ghc][master] hadrian: correctly copy the docs dir into the bindist #18669

Marge Bot gitlab at gitlab.haskell.org
Sat Dec 12 09:45:54 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
c6477639 by Adam Sandberg Ericsson at 2020-12-12T04:45:48-05:00
hadrian: correctly copy the docs dir into the bindist #18669

- - - - -


1 changed file:

- hadrian/src/Rules/BinaryDist.hs


Changes:

=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -12,6 +12,7 @@ import Settings
 import Settings.Program (programContext)
 import Target
 import Utilities
+import qualified System.Directory.Extra as IO
 
 {-
 Note [Binary distributions]
@@ -136,13 +137,20 @@ bindistRules = do
         copyDirectory (ghcBuildDir -/- "bin") bindistFilesDir
         copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir
         copyDirectory (rtsIncludeDir)         bindistFilesDir
+
         unless cross $ need ["docs"]
+
         -- 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
+
+        -- Use the IO version of doesDirectoryExist because the Shake Action
+        -- version should not be used for directories the build system can
+        -- create. Using the Action version caused documentation to not be
+        -- included in the bindist in the past (part of the problem in #18669).
+        whenM (liftIO (IO.doesDirectoryExist (root -/- "docs"))) $ do
           copyDirectory (root -/- "docs") bindistFilesDir
         when windowsHost $ do
           copyDirectory (root -/- "mingw") bindistFilesDir



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c647763954717d9853d08ff04eece7f1ddeae15c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c647763954717d9853d08ff04eece7f1ddeae15c
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201212/b4c53b57/attachment-0001.html>


More information about the ghc-commits mailing list