Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL at Glasgow Haskell Compiler / GHC Commits: 46caa89b by Sven Tennie at 2026-02-24T23:06:12+00:00 Build stage2 libs for testing Provide js and wasm dependencies for stage1 as well. Stage2 should be good enough; However, this would imply changing topDir or adding a new configuration flag which would be a bigger untertaking. - - - - - 2 changed files: - hadrian/src/Rules/Test.hs - hadrian/src/Settings/Builders/RunTest.hs Changes: ===================================== hadrian/src/Rules/Test.hs ===================================== @@ -316,8 +316,10 @@ timeoutProgBuilder = do needTestsuitePackages :: Stage -> Action () needTestsuitePackages stg = do allpkgs <- packages <$> flavour - -- TODO: This used to force the packages to Stage1. Check if the tuple dance is still useful now. - libpkgs <- map (stg,) . filter isLibrary <$> allpkgs stg + isCross <- crossStage stg + -- In cross case, the libraries are one stage ahead + let libraryStage = if isCross then succStage stg else stg + libpkgs <- map (libraryStage,) . filter isLibrary <$> allpkgs libraryStage -- And the executables of the current stage exepkgs <- map (stg,) . filter isProgram <$> allpkgs stg -- Don't require lib:ghc or lib:cabal when testing the stage1 compiler @@ -326,7 +328,19 @@ needTestsuitePackages stg = do -- Unfortunately, we still need the liba let pkgs = filter (\(_,p) -> not $ (pkgName p `elem` ["ghc", "Cabal"]) && isStage0 stg) (libpkgs ++ exepkgs ++ [ (stg,timeout) | windowsHost ]) + need =<< mapM (uncurry pkgFile) pkgs + when isCross $ do + jsTarget <- isJsTarget (succStage stg) + wasmTarget <- isWasmTarget (succStage stg) + libPath <- stageLibPath stg + let jsDeps + | jsTarget = ["ghc-interp.js"] + | otherwise = [] + wasmDeps + | wasmTarget = ["dyld.mjs", "post-link.mjs", "prelude.mjs"] + | otherwise = [] + need $ map (libPath -/-) (jsDeps ++ wasmDeps) -- stage 1 ghc lives under stage0/bin, -- stage 2 ghc lives under stage1/bin, etc ===================================== hadrian/src/Settings/Builders/RunTest.hs ===================================== @@ -105,6 +105,7 @@ allowHaveLLVM = not . (`elem` ["wasm32", "javascript"]) -- inTreeCompilerArgs :: Stage -> Action TestCompilerArgs inTreeCompilerArgs stg = do + -- TODO: executable and library stage would be clearer cross <- crossStage stg let ghcStage = succStage stg pkgCacheStage = if cross then ghcStage else stg @@ -142,7 +143,7 @@ inTreeCompilerArgs stg = do pkgConfCacheFile <- System.FilePath.normalise . (top -/-) <$> (packageDbPath (PackageDbLoc pkgCacheStage Final) <&> (-/- "package.cache")) libdir <- System.FilePath.normalise . (top -/-) - <$> stageLibPath stg + <$> stageLibPath pkgCacheStage -- For this information, we need to query ghc --info, however, that would -- require building ghc, which we don't want to do here. Therefore, the View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/46caa89bb8fae55958f7d213ac29ae01... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/46caa89bb8fae55958f7d213ac29ae01... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Sven Tennie (@supersven)