Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FIXED at Glasgow Haskell Compiler / GHC Commits: 9317e27d by Sven Tennie at 2025-12-20T10:57:39+01:00 Distinguish between having an interpreter and having an internal one Otherwise, we fail with warnings when compiling tools. - - - - - 5 changed files: - ghc/GHC/Driver/Session/Mode.hs - ghc/GHCi/UI.hs - ghc/Main.hs - ghc/ghc-bin.cabal.in - hadrian/src/Settings/Packages.hs Changes: ===================================== ghc/GHC/Driver/Session/Mode.hs ===================================== @@ -134,7 +134,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 ===================================== @@ -1905,7 +1905,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 ===================================== @@ -37,7 +37,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 @@ -289,7 +289,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 @@ -333,7 +333,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 @@ -86,6 +91,9 @@ Executable ghc UnboxedTuples ViewPatterns + if flag(internal-interpreter) + CPP-Options: -DHAVE_INTERNAL_INTERPRETER + if flag(threaded) ghc-options: -threaded ===================================== hadrian/src/Settings/Packages.hs ===================================== @@ -114,7 +114,8 @@ packageArgs = do , compilerStageOption ghcDebugAssertions ? arg "-DDEBUG" ] , builder (Cabal Flags) ? mconcat - [ andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage1]] `cabalFlag` "internal-interpreter" + [ andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage1]] `cabalFlag` "interpreter" + , andM [expr (ghcWithInterpreter stage), notM (expr cross)] `cabalFlag` "internal-interpreter" , ifM stage0 -- We build a threaded stage 1 if the bootstrapping compiler -- supports it. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9317e27d2b85862d7befdf9b0fbe7f17... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9317e27d2b85862d7befdf9b0fbe7f17... You're receiving this email because of your account on gitlab.haskell.org.