[Git][ghc/ghc][master] Hadrian: fix binary-dist target for cross-compilation

Marge Bot gitlab at gitlab.haskell.org
Mon Jun 1 10:40:50 UTC 2020



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


Commits:
95da76c2 by Sylvain Henry at 2020-06-01T06:40:41-04:00
Hadrian: fix binary-dist target for cross-compilation

- - - - -


1 changed file:

- hadrian/src/Rules/BinaryDist.hs


Changes:

=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -6,6 +6,7 @@ import CommandLine
 import Context
 import Expression
 import Oracles.Setting
+import Oracles.Flag
 import Packages
 import Settings
 import Settings.Program (programContext)
@@ -114,8 +115,9 @@ bindistRules = do
     phony "binary-dist-dir" $ do
         -- We 'need' all binaries and libraries
         targets <- mapM pkgTarget =<< stagePackages Stage1
+        cross <- flag CrossCompiling
         need targets
-        needIservBins
+        unless cross $ needIservBins
 
         version        <- setting ProjectVersion
         targetPlatform <- setting TargetPlatformFull
@@ -134,7 +136,7 @@ bindistRules = do
         copyDirectory (ghcBuildDir -/- "bin") bindistFilesDir
         copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir
         copyDirectory (rtsIncludeDir)         bindistFilesDir
-        need ["docs"]
+        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)
@@ -151,9 +153,10 @@ bindistRules = do
 
         -- We copy the binary (<build root>/stage1/bin/haddock[.exe]) to
         -- the bindist's bindir (<build root>/bindist/ghc-.../bin/).
-        haddockPath <- programPath (vanillaContext Stage1 haddock)
-        copyFile haddockPath
-                 (bindistFilesDir -/- "bin" -/- takeFileName haddockPath)
+        unless cross $ do
+          haddockPath <- programPath (vanillaContext Stage1 haddock)
+          copyFile haddockPath
+                   (bindistFilesDir -/- "bin" -/- takeFileName haddockPath)
 
         -- We then 'need' all the files necessary to configure and install
         -- (as in, './configure [...] && make install') this build on some



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/95da76c2b9ffe2a4fb4230de0061918de3fc89a9
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/20200601/0851d0cb/attachment-0001.html>


More information about the ghc-commits mailing list