| ... |
... |
@@ -316,8 +316,10 @@ timeoutProgBuilder = do |
|
316
|
316
|
needTestsuitePackages :: Stage -> Action ()
|
|
317
|
317
|
needTestsuitePackages stg = do
|
|
318
|
318
|
allpkgs <- packages <$> flavour
|
|
319
|
|
- -- TODO: This used to force the packages to Stage1. Check if the tuple dance is still useful now.
|
|
320
|
|
- libpkgs <- map (stg,) . filter isLibrary <$> allpkgs stg
|
|
|
319
|
+ isCross <- crossStage stg
|
|
|
320
|
+ -- In cross case, the libraries are one stage ahead
|
|
|
321
|
+ let libraryStage = if isCross then succStage stg else stg
|
|
|
322
|
+ libpkgs <- map (libraryStage,) . filter isLibrary <$> allpkgs libraryStage
|
|
321
|
323
|
-- And the executables of the current stage
|
|
322
|
324
|
exepkgs <- map (stg,) . filter isProgram <$> allpkgs stg
|
|
323
|
325
|
-- Don't require lib:ghc or lib:cabal when testing the stage1 compiler
|
| ... |
... |
@@ -326,7 +328,19 @@ needTestsuitePackages stg = do |
|
326
|
328
|
-- Unfortunately, we still need the liba
|
|
327
|
329
|
let pkgs = filter (\(_,p) -> not $ (pkgName p `elem` ["ghc", "Cabal"]) && isStage0 stg)
|
|
328
|
330
|
(libpkgs ++ exepkgs ++ [ (stg,timeout) | windowsHost ])
|
|
|
331
|
+
|
|
329
|
332
|
need =<< mapM (uncurry pkgFile) pkgs
|
|
|
333
|
+ when isCross $ do
|
|
|
334
|
+ jsTarget <- isJsTarget (succStage stg)
|
|
|
335
|
+ wasmTarget <- isWasmTarget (succStage stg)
|
|
|
336
|
+ libPath <- stageLibPath stg
|
|
|
337
|
+ let jsDeps
|
|
|
338
|
+ | jsTarget = ["ghc-interp.js"]
|
|
|
339
|
+ | otherwise = []
|
|
|
340
|
+ wasmDeps
|
|
|
341
|
+ | wasmTarget = ["dyld.mjs", "post-link.mjs", "prelude.mjs"]
|
|
|
342
|
+ | otherwise = []
|
|
|
343
|
+ need $ map (libPath -/-) (jsDeps ++ wasmDeps)
|
|
330
|
344
|
|
|
331
|
345
|
-- stage 1 ghc lives under stage0/bin,
|
|
332
|
346
|
-- stage 2 ghc lives under stage1/bin, etc
|