Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL at Glasgow Haskell Compiler / GHC Commits: 2e1c0782 by Sven Tennie at 2026-03-08T11:18:20+00:00 getTestExePath: Cleanup - - - - - 78f81994 by Sven Tennie at 2026-03-08T11:35:56+00:00 Delete obsolete comment - - - - - 2c480368 by Sven Tennie at 2026-03-08T11:41:47+00:00 Rules.Test.testEnv: Improve diff - - - - - d12e83fa by Sven Tennie at 2026-03-08T11:48:01+00:00 includeCcArgs: Align with master - - - - - 83e7dc2e by Sven Tennie at 2026-03-08T12:01:16+00:00 Move comment about mandatory static and cross - - - - - 6 changed files: - hadrian/src/Oracles/Flavour.hs - hadrian/src/Oracles/TestSettings.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Test.hs - hadrian/src/Settings/Builders/DeriveConstants.hs - hadrian/src/Settings/Program.hs Changes: ===================================== hadrian/src/Oracles/Flavour.hs ===================================== @@ -28,6 +28,8 @@ oracles = do void $ addOracle $ \(DynGhcPrograms stage) -> do cross <- crossStage stage from_flavour <- flip dynamicGhcPrograms stage =<< flavour + -- Have to build static if it's a cross stage as we won't distribute the + -- libraries built for the host. return (from_flavour && not cross) void $ addOracle $ \(GhcProfiled stage) -> ghcProfiled <$> flavour <*> pure (succStage stage) ===================================== hadrian/src/Oracles/TestSettings.hs ===================================== @@ -142,10 +142,9 @@ getTestCross testGhc = Just stg -> crossStage stg Nothing -> getBooleanSetting TestCrossCompiling - --- Given the testGhc string, either a stage0..stage1..stage2 etc or a path to --- a compiler. Compute the absolute path to the relevant executable provided by --- the package in the second argument. +-- | Given the @testGhc@ `String` (either `stage1`, `stage2`, `stage3` or a +-- path to a compiler). Compute the absolute path to the relevant executable +-- provided by the package @pkg@ in the second argument. getTestExePath :: String -> Package -> Action FilePath getTestExePath testGhc pkg = do case stageOfTestCompiler testGhc of @@ -154,10 +153,8 @@ getTestExePath testGhc pkg = do bindir <- getBinaryDirectory testGhc compiler_path <- getCompilerPath testGhc cross <- getBooleanSetting TestCrossCompiling - let cross_prefix = if cross then dropWhileEnd ((/=) '-') (takeFileName compiler_path) else "" - -- get relative path for the given program in the given stage + let cross_prefix = if cross then dropWhileEnd ('-' /=) (takeFileName compiler_path) else "" let make_absolute rel_path = do abs_path <- liftIO (makeAbsolute rel_path) fixAbsolutePathOnWindows abs_path make_absolute (bindir </> (cross_prefix ++ programBasename pkg) <.> exe) - -- get relative path for the given program in the given stage ===================================== hadrian/src/Rules/Generate.hs ===================================== @@ -526,7 +526,6 @@ generateConfigHs = do stage <- getStage let chooseSetting x y = case stage of { Stage0 {} -> x; _ -> y } let queryTarget f = f <$> expr (targetStage stage) - -- Not right for stage3 buildPlatform <- chooseSetting (queryBuild targetPlatformTriple) (queryHost targetPlatformTriple) hostPlatform <- queryTarget targetPlatformTriple trackGenerateHs ===================================== hadrian/src/Rules/Test.hs ===================================== @@ -197,18 +197,16 @@ testRules = do testEnv :: Stage -> Action [(String, String)] testEnv stg = do - testGhc <- testCompiler <$> userSetting defaultTestArgs - cross <- getTestCross testGhc - prog_ghc_pkg <- getTestExePath testGhc ghcPkg - prog_hsc2hs <- getTestExePath testGhc hsc2hs - prog_hp2ps <- getTestExePath testGhc hp2ps - prog_haddock <- getTestExePath testGhc haddock - prog_hpc <- getTestExePath testGhc hpc - prog_runghc <- getTestExePath testGhc runGhc makePath <- builderPath $ Make "" + prog_ghc_pkg <- getTestExePath testGhc ghcPkg + prog_hsc2hs <- getTestExePath testGhc hsc2hs + prog_hp2ps <- getTestExePath testGhc hp2ps + prog_haddock <- getTestExePath testGhc haddock + prog_hpc <- getTestExePath testGhc hpc + prog_runghc <- getTestExePath testGhc runGhc root <- buildRoot args <- userSetting defaultTestArgs ===================================== hadrian/src/Settings/Builders/DeriveConstants.hs ===================================== @@ -48,4 +48,4 @@ includeCcArgs = do , arg "-Irts/include" , arg $ "-I" ++ rtsPath </> "include" , notM (targetSupportsSMP stage) ? arg "-DNOSMP" - , arg "-fcommon" ] + ] ===================================== hadrian/src/Settings/Program.hs ===================================== @@ -19,11 +19,10 @@ programContext :: Stage -> Package -> Action Context programContext stage pkg = do profiled <- askGhcProfiled stage dynGhcProgs <- askDynGhcPrograms stage - -- Have to build static if it's a cross stage as we won't distribute the libraries built for the host. return $ Context stage pkg (wayFor profiled dynGhcProgs) Final where wayFor prof dyn - | prof && dyn = profilingDynamic + | prof && dyn = profilingDynamic | pkg == ghc && prof && notStage0 stage = profiling | dyn && notStage0 stage = dynamic | otherwise = vanilla View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0ccee36aebfd046affa9d124aa87c8a... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0ccee36aebfd046affa9d124aa87c8a... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Sven Tennie (@supersven)