Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL at Glasgow Haskell Compiler / GHC Commits: d0c3c9fe by Matthew Pickering at 2026-01-15T20:49:42+01:00 hadrian: Refactor system-cxx-std-lib rules0 I noticed a few things wrong with the hadrian rules for `system-cxx-std-lib` rules. * For `text` there is an ad-hoc check to depend on `system-cxx-std-lib` outside of `configurePackage`. * The `system-cxx-std-lib` dependency is not read from cabal files. * Recache is not called on the packge database after the `.conf` file is generated, a more natural place for this rule is `registerRules`. Treating this uniformly like other packages is complicated by it not having any source code or a cabal file. However we can do a bit better by reporting the dependency firstly in `PackageData` and then needing the `.conf` file in the same place as every other package in `configurePackage`. Fixes #25303 - - - - - 2bcc8ca0 by Sven Tennie at 2026-01-15T20:49:42+01:00 ci: Increase timeout for emulators Test runs with emulators naturally take longer than on native machines. Generate jobs.yml - - - - - d232c567 by Sven Tennie at 2026-01-15T20:49:42+01:00 ghc: Distinguish between having an interpreter and having an internal one Otherwise, we fail with warnings when compiling tools. Actually, these are related but different things: - ghc can run an interpreter (either internal or external) - ghc is compiled with an internal interpreter - - - - - 0eb04eef by Matthew Pickering at 2026-01-15T20:49:42+01:00 ci: Javascript don't set CROSS_EMULATOR There is no CROSS_EMULATOR needed to run javascript binaries, so we don't set the CROSS_EMULATOR to some dummy value. - - - - - c61fd7a0 by Sven Tennie at 2026-01-15T20:49:42+01:00 Javascript skip T23697 See #22355 about how HSC2HS and the Javascript target don't play well together. - - - - - d813f5a0 by Sven Tennie at 2026-01-15T20:49:42+01:00 Mark T24602 as fragile It was skipped before (due to CROSS_EMULATOR being set, which changed for JS), so we don't make things worse by marking it as fragile. - - - - - 0f47121d by Sven Tennie at 2026-01-15T20:49:42+01:00 WIP: Dirty hack Let Stage0 build with the default.host.target file and decide for other stages if default.target cannot be used. Acutally, I don't like this logic on this level. - - - - - 380359fa by Sven Tennie at 2026-01-15T20:49:42+01:00 Windows needs NM_STAGE0 as well The stage0 always needs nm. - - - - - 1f31ba98 by Sven Tennie at 2026-01-15T20:49:42+01:00 T17912 sometimes works for windows-validate This seems to be timing related. However, just simply increasing the timeout (sleep) statement of this test didn't help. Maybe, it has been flaky on CI before. - - - - - 22 changed files: - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - ghc/GHC/Driver/Session/Mode.hs - ghc/GHCi/UI.hs - ghc/Main.hs - ghc/ghc-bin.cabal.in - hadrian/src/Hadrian/Haskell/Cabal/Parse.hs - hadrian/src/Hadrian/Haskell/Cabal/Type.hs - hadrian/src/Hadrian/Oracles/TextFile.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Rules/BinaryDist.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Lint.hs - hadrian/src/Rules/Register.hs - hadrian/src/Settings.hs - hadrian/src/Settings/Builders/Hsc2Hs.hs - hadrian/src/Settings/Builders/RunTest.hs - hadrian/src/Settings/Packages.hs - libraries/base/tests/IO/all.T - libraries/base/tests/all.T - m4/fp_find_nm.m4 - testsuite/tests/javascript/closure/all.T Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -20,6 +20,7 @@ import qualified Data.ByteString.Lazy.Char8 as B import qualified Data.Set as S import System.Environment import Data.List +import Data.Char (isSpace) {- Note [Generating the CI pipeline] @@ -138,9 +139,11 @@ bignumString :: BignumBackend -> String bignumString Gmp = "gmp" bignumString Native = "native" +data TimeoutIncrease = TimeoutIncrease | NoTimeoutIncrease + data CrossEmulator = NoEmulator - | NoEmulatorNeeded + | NoEmulatorNeeded TimeoutIncrease | Emulator String -- | A BuildConfig records all the options which can be modified to affect the @@ -888,19 +891,33 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } NoEmulator -- we need an emulator but it isn't set. Won't run the testsuite | Just _ <- crossTarget buildConfig - -> "CROSS_EMULATOR" =: "NOT_SET" - | otherwise -> mempty - Emulator s -> "CROSS_EMULATOR" =: s - NoEmulatorNeeded -> mempty + -> "CROSS_EMULATOR" =: "NOT_SET" + | otherwise -> mempty + Emulator s -> "CROSS_EMULATOR" =: s + NoEmulatorNeeded _ -> mempty , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty - , let runtestArgs = + , let + -- Emulators are naturally slower than native machines. + -- Triple the default of 300. + timeoutConf = "-e config.timeout=900" + testTimeoutArg = + case crossEmulator buildConfig of + Emulator _ -> timeoutConf + -- NodeJS (Javascript) is slower than native code + NoEmulatorNeeded TimeoutIncrease -> timeoutConf + _ -> mempty + runtestArgs = + testTimeoutArg : [ "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity" | validateNonmovingGc buildConfig ] - in "RUNTEST_ARGS" =: unwords runtestArgs + in "RUNTEST_ARGS" =: (trim . unwords) runtestArgs , if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty ] + trim :: String -> String + trim = dropWhileEnd isSpace . dropWhile isSpace + -- Keep in sync with the exclude list in `function clean()` in -- `.gitlab/ci.sh`! jobArtifacts = Artifacts @@ -1298,7 +1315,7 @@ cross_jobs = [ (validateBuilds AArch64 (Linux Debian12Wine) (winAarch64Config {llvmBootstrap = True})) ] where - javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")) + javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (NoEmulatorNeeded TimeoutIncrease) (Just "emconfigure")) { bignumBackend = Native } makeWinArmJobs = modifyJobs @@ -1343,7 +1360,7 @@ cross_jobs = [ $ addValidateRule WasmBackend $ validateBuilds Amd64 (Linux AlpineWasm) cfg wasm_build_config = - (crossConfig "wasm32-wasi" NoEmulatorNeeded Nothing) + (crossConfig "wasm32-wasi" (NoEmulatorNeeded NoTimeoutIncrease) Nothing) { hostFullyStatic = True , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet , textWithSIMDUTF = True ===================================== .gitlab/jobs.yaml ===================================== @@ -389,7 +389,7 @@ "OBJCOPY": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objcopy", "OBJDUMP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objdump", "RANLIB": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-ranlib", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "SIZE": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-size", "STRINGS": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strings", "STRIP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strip", @@ -471,7 +471,7 @@ "OBJCOPY": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objcopy", "OBJDUMP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objdump", "RANLIB": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-ranlib", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "SIZE": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-size", "STRINGS": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strings", "STRIP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strip", @@ -1060,7 +1060,7 @@ "OBJCOPY": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objcopy", "OBJDUMP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objdump", "RANLIB": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-ranlib", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "SIZE": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-size", "STRINGS": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strings", "STRIP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strip", @@ -1143,7 +1143,7 @@ "OBJCOPY": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objcopy", "OBJDUMP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-objdump", "RANLIB": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-ranlib", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "SIZE": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-size", "STRINGS": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strings", "STRIP": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-strip", @@ -2055,7 +2055,7 @@ "CROSS_STAGE": "2", "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate", "XZ_OPT": "-9" } @@ -2118,10 +2118,10 @@ "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", + "CROSS_STAGE": "2", "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate", "XZ_OPT": "-9" } @@ -2503,7 +2503,7 @@ "CROSS_STAGE": "2", "CROSS_TARGET": "riscv64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate", "XZ_OPT": "-9" } @@ -3582,7 +3582,7 @@ "CROSS_STAGE": "2", "CROSS_TARGET": "loongarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-ubuntu24_04-loongarch-cross_loongarch64-linux-gnu-validate", "XZ_OPT": "-9" } @@ -6229,7 +6229,7 @@ "CROSS_STAGE": "2", "CROSS_TARGET": "aarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, @@ -6291,10 +6291,10 @@ "BUILD_FLAVOUR": "validate", "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check", "CONFIGURE_WRAPPER": "emconfigure", - "CROSS_EMULATOR": "js-emulator", + "CROSS_STAGE": "2", "CROSS_TARGET": "javascript-unknown-ghcjs", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate" } }, @@ -6671,7 +6671,7 @@ "CROSS_STAGE": "2", "CROSS_TARGET": "riscv64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-deb12-riscv-cross_riscv64-linux-gnu-validate" } }, @@ -7734,7 +7734,7 @@ "CROSS_STAGE": "2", "CROSS_TARGET": "loongarch64-linux-gnu", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": "", + "RUNTEST_ARGS": "-e config.timeout=900", "TEST_ENV": "x86_64-linux-ubuntu24_04-loongarch-cross_loongarch64-linux-gnu-validate" } }, ===================================== ghc/GHC/Driver/Session/Mode.hs ===================================== @@ -132,7 +132,7 @@ isDoEvalMode :: Mode -> Bool isDoEvalMode (Right (Right (DoEval _))) = True isDoEvalMode _ = False -#if defined(HAVE_INTERNAL_INTERPRETER) +#if defined(HAVE_INTERPRETER) isInteractiveMode :: PostLoadMode -> Bool isInteractiveMode DoInteractive = True isInteractiveMode _ = False ===================================== ghc/GHCi/UI.hs ===================================== @@ -1900,7 +1900,9 @@ changeDirectory dir = do fhv <- compileGHCiExpr $ "System.Directory.setCurrentDirectory " ++ show dir' liftIO $ evalIO interp fhv +#if defined(HAVE_INTERNAL_INTERPRETER) _ -> pure () +#endif trySuccess :: GhciMonad m => m SuccessFlag -> m SuccessFlag trySuccess act = ===================================== ghc/Main.hs ===================================== @@ -35,7 +35,7 @@ import GHC.Driver.Config.Diagnostic import GHC.Platform import GHC.Platform.Host -#if defined(HAVE_INTERNAL_INTERPRETER) +#if defined(HAVE_INTERPRETER) import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings ) #endif @@ -287,7 +287,7 @@ doRun units srcs args = do args' = drop 1 $ dropWhile (/= "--") $ map unLoc args ghciUI :: [String] -> [(FilePath, Maybe Phase)] -> Maybe [String] -> Ghc () -#if !defined(HAVE_INTERNAL_INTERPRETER) +#if !defined(HAVE_INTERPRETER) ghciUI _ _ _ = throwGhcException (CmdLineError "not built for interactive use") #else @@ -331,7 +331,7 @@ showBanner :: PostLoadMode -> DynFlags -> IO () showBanner _postLoadMode dflags = do let verb = verbosity dflags -#if defined(HAVE_INTERNAL_INTERPRETER) +#if defined(HAVE_INTERPRETER) -- Show the GHCi banner when (isInteractiveMode _postLoadMode && verb >= 1) $ putStrLn ghciWelcomeMsg #endif ===================================== ghc/ghc-bin.cabal.in ===================================== @@ -22,6 +22,11 @@ Flag internal-interpreter Default: False Manual: True +Flag interpreter + Description: Build with interpreter support, both internal and external. + Default: False + Manual: True + Flag threaded Description: Link the ghc executable against the threaded RTS Default: True @@ -56,7 +61,7 @@ Executable ghc -rtsopts=all "-with-rtsopts=-K512M -H -I5 -T" - if flag(internal-interpreter) + if flag(interpreter) -- NB: this is never built by the bootstrapping GHC+libraries Build-depends: deepseq >= 1.4 && < 1.6, @@ -65,7 +70,7 @@ Executable ghc haskeline == 0.8.*, exceptions == 0.10.*, time >= 1.8 && < 1.16 - CPP-Options: -DHAVE_INTERNAL_INTERPRETER + CPP-Options: -DHAVE_INTERPRETER Other-Modules: GHCi.Leak GHCi.UI @@ -82,6 +87,9 @@ Executable ghc UnboxedTuples ViewPatterns + if flag(internal-interpreter) + CPP-Options: -DHAVE_INTERNAL_INTERPRETER + if flag(threaded) ghc-options: -threaded ===================================== hadrian/src/Hadrian/Haskell/Cabal/Parse.hs ===================================== @@ -81,10 +81,11 @@ parsePackageData pkg = do sorted = sort [ C.unPackageName p | C.Dependency p _ _ <- allDeps ] deps = nubOrd sorted \\ [name] depPkgs = mapMaybe findPackageByName deps + cxxStdLib = elem "system-cxx-std-lib" deps return $ PackageData name version (C.fromShortText (C.synopsis pd)) (C.fromShortText (C.description pd)) - depPkgs gpd + depPkgs cxxStdLib gpd where -- Collect an overapproximation of dependencies by ignoring conditionals collectDeps :: Maybe (C.CondTree v [C.Dependency] a) -> [C.Dependency] @@ -138,7 +139,9 @@ configurePackage :: Context -> Action () configurePackage context@Context {..} = do putProgressInfo $ "| Configure package " ++ quote (pkgName package) gpd <- pkgGenericDescription package - depPkgs <- packageDependencies <$> readPackageData package + pd <- readPackageData package + let depPkgs = packageDependencies pd + needSystemCxxStdLib = dependsOnSystemCxxStdLib pd -- Stage packages are those we have in this stage. stagePkgs <- stagePackages stage @@ -157,7 +160,12 @@ configurePackage context@Context {..} = do -- We'll need those packages in our package database. deps <- sequence [ pkgConfFile (context { package = pkg, iplace = forceBaseAfterGhcInternal pkg }) | pkg <- depPkgs, pkg `elem` stagePkgs ] - need $ extraPreConfigureDeps ++ deps + -- system-cxx-std-lib is magic.. it doesn't have a cabal file or source code, so we have + -- to treat it specially as `pkgConfFile` uses `readPackageData` to compute the version. + systemCxxStdLib <- sequence [ systemCxxStdLibConfPath (PackageDbLoc stage iplace) | needSystemCxxStdLib ] + need $ extraPreConfigureDeps + ++ deps + ++ systemCxxStdLib -- Figure out what hooks we need. let configureFile = replaceFileName (pkgCabalFile package) "configure" ===================================== hadrian/src/Hadrian/Haskell/Cabal/Type.hs ===================================== @@ -30,6 +30,7 @@ data PackageData = PackageData , synopsis :: String , description :: String , packageDependencies :: [Package] + , dependsOnSystemCxxStdLib :: Bool , genericPackageDescription :: GenericPackageDescription } deriving (Eq, Generic, Show) ===================================== hadrian/src/Hadrian/Oracles/TextFile.hs ===================================== @@ -124,8 +124,8 @@ getBuildTarget :: Action Toolchain.Target getBuildTarget = getTargetConfig buildTargetFile -- | Get the host target configuration through 'getTargetConfig' -getHostTarget :: Action Toolchain.Target -getHostTarget = do +getHostTarget :: Stage -> Action Toolchain.Target +getHostTarget stage | stage >= Stage1 = do -- MP: If we are not cross compiling then we should use the target file in order to -- build things for the host, in particular we want to use the configured values for the -- target for building the RTS (ie are we using Libffi for adjustors, and the wordsize) @@ -135,8 +135,7 @@ getHostTarget = do if (Toolchain.targetPlatformTriple ht) == (Toolchain.targetPlatformTriple tt) then return tt else return ht - -- where - -- msg = "The host's target configuration file " ++ quote hostTargetFile ++ " does not exist! ghc-toolchain might have failed to generate it." +getHostTarget _stage {- stage0 -} = getTargetConfig hostTargetFile -- | Get the target target configuration through 'getTargetConfig' getTargetTarget :: Action Toolchain.Target @@ -145,9 +144,8 @@ getTargetTarget = getTargetConfig targetTargetFile queryBuildTarget :: (Toolchain.Target -> a) -> Action a queryBuildTarget f = f <$> getBuildTarget -queryHostTarget :: (Toolchain.Target -> a) -> Action a -queryHostTarget f = f <$> getHostTarget - +queryHostTarget :: Stage -> (Toolchain.Target -> a) -> Action a +queryHostTarget stage f = f <$> getHostTarget stage newtype KeyValue = KeyValue (FilePath, String) deriving (Binary, Eq, Hashable, NFData, Show) ===================================== hadrian/src/Oracles/Setting.hs ===================================== @@ -137,7 +137,7 @@ getSetting = expr . setting bashPath :: Action FilePath bashPath = setting BourneShell -isWinHost :: Action Bool +isWinHost :: Stage -> Action Bool isWinHost = anyHostOs [OSMinGW32] isWinTarget :: Stage -> Action Bool @@ -153,8 +153,8 @@ isArmTarget :: Stage -> Action Bool isArmTarget stage = queryTargetTarget stage (isARM . archOS_arch . tgtArchOs) -- | Check whether the host OS setting matches one of the given strings. -anyHostOs :: [OS] -> Action Bool -anyHostOs oss = (`elem` oss) <$> queryHostTarget (archOS_OS . tgtArchOs) +anyHostOs :: [OS] -> Stage -> Action Bool +anyHostOs oss stage = (`elem` oss) <$> queryHostTarget stage (archOS_OS . tgtArchOs) -- | Check whether the target architecture setting matches one of the given -- strings. @@ -233,7 +233,7 @@ libsuf st way -- For example, we want to build RTS with stage1 for the host target as we -- produce a host executable with stage1 (which cross-compiles to stage2). targetStage :: Stage -> Action Target -targetStage stage | isHostStage stage = getHostTarget +targetStage stage | isHostStage stage = getHostTarget stage targetStage _ = getTargetTarget isHostStage :: Stage -> Bool ===================================== hadrian/src/Rules/BinaryDist.hs ===================================== @@ -326,7 +326,7 @@ bindistRules = do -- phony "binary-dist-dir-stage3" $ buildBinDistDir root targetBindist let buildBinDist compressor = do - win_host <- isWinHost + win_host <- isWinHost Stage1 win_target <- isWinTarget Stage2 when (win_target && win_host) (error "normal binary-dist does not work for windows targets, use `reloc-binary-dist-*` target instead.") buildBinDistX "binary-dist-dir" "bindist" compressor ===================================== hadrian/src/Rules/Generate.hs ===================================== @@ -246,9 +246,6 @@ copyRules = do prefix -/- "html/**" <~ return "utils/haddock/haddock-api/resources" prefix -/- "latex/**" <~ return "utils/haddock/haddock-api/resources" - forM_ [Inplace, Final] $ \iplace -> - root -/- relativePackageDbPath (PackageDbLoc stage iplace) -/- systemCxxStdLibConf %> \file -> do - copyFile ("mk" -/- "system-cxx-std-lib-1.0.conf") file generateRules :: Rules () generateRules = do @@ -412,7 +409,7 @@ bindistRules = do , interpolateSetting "ProjectPatchLevel2" ProjectPatchLevel2 , interpolateSetting "ProjectGitCommitId" ProjectGitCommitId - , interpolateVar "HostOS_CPP" $ fmap cppify $ interp $ queryHost queryOS + , interpolateVar "HostOS_CPP" $ fmap cppify $ interp $ queryHost queryOS Stage1 , interpolateVar "TargetPlatform" $ getTarget targetPlatformTriple , interpolateVar "TargetPlatform_CPP" $ cppify <$> getTarget targetPlatformTriple @@ -436,7 +433,7 @@ bindistRules = do , interpolateVar "TargetHasLibm" $ yesNo <$> interp (staged (buildFlag TargetHasLibm)) , interpolateVar "TargetPlatform" $ getTarget targetPlatformTriple , interpolateVar "BuildPlatform" $ interp $ queryBuild targetPlatformTriple - , interpolateVar "HostPlatform" $ interp $ queryHost targetPlatformTriple + , interpolateVar "HostPlatform" $ interp $ queryHost targetPlatformTriple Stage1 , interpolateVar "TargetWordBigEndian" $ getTarget isBigEndian , interpolateVar "TargetWordSize" $ getTarget wordSize , interpolateVar "Unregisterised" $ yesNo <$> getTarget tgtUnregisterised @@ -526,7 +523,7 @@ generateConfigHs = do 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) + buildPlatform <- chooseSetting (queryBuild targetPlatformTriple) (queryHost targetPlatformTriple stage) hostPlatform <- queryTarget targetPlatformTriple trackGenerateHs cProjectName <- getSetting ProjectName @@ -629,9 +626,9 @@ generatePlatformHostHs = do stage <- getStage let chooseHostQuery = case stage of Stage0 {} -> queryHost - _ -> queryTarget stage - cHostPlatformArch <- chooseHostQuery (archOS_arch . tgtArchOs) - cHostPlatformOS <- chooseHostQuery (archOS_OS . tgtArchOs) + _ -> flip queryTarget + cHostPlatformArch <- chooseHostQuery (archOS_arch . tgtArchOs) stage + cHostPlatformOS <- chooseHostQuery (archOS_OS . tgtArchOs) stage return $ unlines [ "module GHC.Platform.Host where" , "" ===================================== hadrian/src/Rules/Lint.hs ===================================== @@ -42,7 +42,7 @@ runHLint :: [FilePath] -- ^ include directories -> Action () runHLint includeDirs defines dir = do threads <- shakeThreads <$> getShakeOptions - hostArch <- (<> "_HOST_ARCH") <$> queryHostTarget queryArch + hostArch <- (<> "_HOST_ARCH") <$> queryHostTarget Stage1 queryArch let hlintYaml = dir > ".hlint.yaml" defines' = hostArch : defines cmdLine = unwords $ ===================================== hadrian/src/Rules/Register.hs ===================================== @@ -111,6 +111,12 @@ registerPackageRules rs stage iplace = do target (Context stage compiler vanilla iplace) (GhcPkg Recache stage) [] [] writeFileLines stamp [] + -- Special rule for registering system-cxx-std-lib + root -/- relativePackageDbPath (PackageDbLoc stage iplace) -/- systemCxxStdLibConf %> \file -> do + copyFile ("mk" -/- "system-cxx-std-lib-1.0.conf") file + buildWithResources rs $ + target (Context stage compiler vanilla iplace) (GhcPkg Recache stage) [] [] + -- Register a package. root -/- relativePackageDbPath (PackageDbLoc stage iplace) -/- "*.conf" %> \conf -> do historyDisable ===================================== hadrian/src/Settings.hs ===================================== @@ -119,9 +119,11 @@ unsafeFindPackageByPath path = err $ find (\pkg -> pkgPath pkg == path) knownPac -- Be careful querying values from the HOST and BUILD targets until the targets -- are only generated by ghc-toolchain: -- See Note [The dummy values in the HOST target description] -queryBuild, queryHost :: (Target -> a) -> Expr a +queryBuild :: (Target -> a) -> Expr a queryBuild f = expr $ queryBuildTarget f -queryHost f = expr $ queryHostTarget f + +queryHost :: (Target -> a) -> Stage -> Expr a +queryHost f stage = expr $ queryHostTarget stage f queryArch, queryOS, queryVendor :: Target -> String queryArch = stringEncodeArch . archOS_arch . tgtArchOs ===================================== hadrian/src/Settings/Builders/Hsc2Hs.hs ===================================== @@ -13,8 +13,8 @@ hsc2hsBuilderArgs = builder Hsc2Hs ? do ccPath <- getBuilderPath $ Cc CompileC stage gmpDir <- staged (buildSetting GmpIncludeDir) top <- expr topDirectory - hArch <- queryHost queryArch - hOs <- queryHost queryOS + hArch <- queryHost queryArch stage + hOs <- queryHost queryOS stage tArch <- queryTarget stage queryArch tOs <- queryTarget stage queryOS version <- case stage of ===================================== hadrian/src/Settings/Builders/RunTest.hs ===================================== @@ -124,7 +124,7 @@ inTreeCompilerArgs stg = do debugged <- ghcDebugged <$> flavour <*> pure ghcStage profiled <- ghcProfiled <$> flavour <*> pure ghcStage - os <- queryHostTarget queryOS + os <- queryHostTarget ghcStage queryOS arch <- queryTargetTarget ghcStage queryArch let codegen_arches = ["x86_64", "i386", "powerpc", "powerpc64", "powerpc64le", "aarch64", "wasm32", "riscv64", "loongarch64"] let withNativeCodeGen ===================================== hadrian/src/Settings/Packages.hs ===================================== @@ -89,11 +89,10 @@ packageArgs = do -- 1. ghcWithInterpreter must be True ("Use interpreter" = -- "YES") -- 2. For non-cross case it can be enabled - -- 3. For cross case, disable for stage0 since that runs - -- on the host and must rely on external interpreter to - -- load target code, otherwise enable for stage1 since - -- that runs on the target and can use target's own - -- ghci object linker + -- 3. For cross case, disable for stage0 and stage1 since these run + -- on the host and must rely on external interpreter to load + -- target code, otherwise enable for stage2 since that runs on + -- the target and can use target's own ghci object linker [ andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage2]] `cabalFlag` "internal-interpreter" , orM [ notM cross, haveCurses ] `cabalFlag` "terminfo" , arg "-build-tool-depends" ===================================== libraries/base/tests/IO/all.T ===================================== @@ -182,7 +182,7 @@ test('T17414', compile_and_run, ['']) test('T17510', expect_broken(17510), compile_and_run, ['']) test('bytestringread001', extra_run_opts('test.data'), compile_and_run, ['']) -test('T17912', [only_ways(['threaded1']), when(opsys('mingw32'),expect_broken(1))], compile_and_run, ['']) +test('T17912', [only_ways(['threaded1']), when(opsys('mingw32'),fragile(1))], compile_and_run, ['']) test('T18832', only_ways(['threaded1']), compile_and_run, ['']) test('mkdirExists', [exit_code(1), when(opsys('mingw32'), ignore_stderr)], compile_and_run, ['']) ===================================== libraries/base/tests/all.T ===================================== @@ -318,6 +318,7 @@ test('T23687', normal, compile_and_run, ['']) test('T23697', [ when(opsys('mingw32'), skip) # header not found , when(opsys('darwin'), skip) # permission denied + , js_broken(22355) ], makefile_test, ['T23697']) test('stimesEndo', normal, compile_and_run, ['']) test('T24807', exit_code(1), compile_and_run, ['']) ===================================== m4/fp_find_nm.m4 ===================================== @@ -12,6 +12,7 @@ AC_DEFUN([FP_FIND_NM], if test "$HostOS" = "mingw32" then NmCmd=$(cygpath -m "$NM") + NM_STAGE0=$NmCmd else NmCmd="$NM" fi ===================================== testsuite/tests/javascript/closure/all.T ===================================== @@ -1,4 +1,11 @@ # These are JavaScript-specific tests based on Google Closure Compiler setTestOpts(when(not(js_arch()),skip)) -test('T24602', normal, makefile_test, ['T24602']) +# Runs fine locally. Fails on CI with: +# +# Wrong exit code for T24602()(expected 0 , actual 2 ) +# Stderr run ( T24602 ): +# gmake: node: Permission denied +# gmake: *** [Makefile:11: T24602] Error 127 +# *** unexpected failure for T24602(normal) +test('T24602', fragile(26712), makefile_test, ['T24602']) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e6570cb31c4bea0012bbf2b59cfbb7d... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e6570cb31c4bea0012bbf2b59cfbb7d... You're receiving this email because of your account on gitlab.haskell.org.