summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2022-11-09 14:03:02 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-25 14:47:41 -0500
commit48131ee2d8ba7074a4c2763a32c12df105305a75 (patch)
tree755ec25c8b26d41590121068036671359360cca3 /hadrian
parente987e345c807035e4637ca3eae227ae501e16c42 (diff)
downloadhaskell-48131ee2d8ba7074a4c2763a32c12df105305a75.tar.gz
Hadrian: fix Windows cross-compilation
Decision to build either unix or Win32 package must be stage specific for cross-compilation to be supported.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Settings/Default.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs
index 5df34a18c4..3781c3d490 100644
--- a/hadrian/src/Settings/Default.hs
+++ b/hadrian/src/Settings/Default.hs
@@ -72,7 +72,6 @@ stageBootPackages = return [lintersCommon, lintCommitMsg, lintSubmoduleRefs, lin
stage0Packages :: Action [Package]
stage0Packages = do
cross <- flag CrossCompiling
- winTarget <- isWinTarget
return $ [ binary
, bytestring
, cabalSyntax
@@ -102,7 +101,7 @@ stage0Packages = do
, transformers
, unlit
, hp2ps
- , if winTarget then win32 else unix
+ , if windowsHost then win32 else unix
]
++ [ terminfo | not windowsHost, not cross ]
++ [ timeout | windowsHost ]
@@ -111,7 +110,15 @@ stage0Packages = do
-- | Packages built in 'Stage1' by default. You can change this in "UserSettings".
stage1Packages :: Action [Package]
stage1Packages = do
- libraries0 <- filter isLibrary <$> stage0Packages
+ let good_stage0_package p
+ -- we only keep libraries for some reason
+ | not (isLibrary p) = False
+ -- but not win32/unix because it depends on cross-compilation target
+ | p == win32 = False
+ | p == unix = False
+ | otherwise = True
+
+ libraries0 <- filter good_stage0_package <$> stage0Packages
cross <- flag CrossCompiling
winTarget <- isWinTarget
@@ -138,6 +145,7 @@ stage1Packages = do
, stm
, unlit
, xhtml
+ , if winTarget then win32 else unix
]
, when (not cross)
[ haddock