@@ -145,7 +145,7 @@ import GHC.Driver.Config.Stg.Pipeline (initStgPipelineOpts)
145145import GHC.Driver.Config.StgToCmm (initStgToCmmConfig )
146146import GHC.Driver.Config.Cmm (initCmmConfig )
147147import GHC.Driver.LlvmConfigCache (initLlvmConfigCache )
148- #if defined(HAVE_INTERPRETER )
148+ #if defined(HAVE_JS_BACKEND )
149149import GHC.Driver.Config.StgToJS (initStgToJSConfig )
150150#endif
151151import GHC.Driver.Config.Diagnostic
@@ -176,6 +176,8 @@ import GHC.HsToCore
176176
177177#if defined(HAVE_INTERPRETER)
178178import GHC.StgToByteCode ( byteCodeGen )
179+ #endif
180+ #if defined(HAVE_JS_BACKEND)
179181import GHC.StgToJS ( stgToJS )
180182import GHC.StgToJS.Ids
181183import GHC.StgToJS.Types
@@ -326,15 +328,18 @@ import qualified GHC.Unit.Home.Graph as HUG
326328import GHC.Unit.Home.PackageTable
327329
328330#if !defined(HAVE_INTERPRETER)
329- -- Stub implementations for MINIMAL build
331+ -- Stub when interpreter not available
330332initializePlugins :: HscEnv -> IO HscEnv
331333initializePlugins = return
334+ #endif
332335
336+ #if !defined(HAVE_JS_BACKEND)
337+ -- Stub when JS backend not available
333338initStgToJSConfig :: DynFlags -> StgToJSConfig
334339initStgToJSConfig _ = StgToJSConfig -- StgToJSConfig stub is from GHC.Runtime.Interpreter.Types
335340
336341stgToJS :: Logger -> StgToJSConfig -> [CgStgTopBinding ] -> Module -> [SptEntry ] -> ForeignStubs -> ([CostCentre ], [CostCentreStack ]) -> FilePath -> IO ()
337- stgToJS _ _ _ _ _ _ _ _ = panic " stgToJS: not available in MINIMAL build "
342+ stgToJS _ _ _ _ _ _ _ _ = panic " stgToJS: not available (HAVE_JS_BACKEND not defined) "
338343#endif
339344
340345{- **********************************************************************
@@ -1313,7 +1318,7 @@ hscDesugarAndSimplify summary (FrontendTypecheck tc_result) tc_warnings mb_old_h
13131318 -- Just cause we desugared doesn't mean we are generating code, see above.
13141319 Just desugared_guts | backendGeneratesCode bcknd -> do
13151320#if !defined(HAVE_INTERPRETER)
1316- -- In MINIMAL builds, no TH plugins can be registered
1321+ -- No TH plugins can be registered (HAVE_INTERPRETER not defined)
13171322 let plugins = []
13181323#else
13191324 plugins <- liftIO $ readIORef (tcg_th_coreplugins tc_result)
@@ -1341,7 +1346,7 @@ hscDesugarAndSimplify summary (FrontendTypecheck tc_result) tc_warnings mb_old_h
13411346 -- in order to inline data con wrappers but we honour whatever level of simplificication the
13421347 -- user requested. See #22008 for some discussion.
13431348#if !defined(HAVE_INTERPRETER)
1344- -- In MINIMAL builds, no TH plugins can be registered
1349+ -- No TH plugins can be registered (HAVE_INTERPRETER not defined)
13451350 let plugins = []
13461351#else
13471352 plugins <- liftIO $ readIORef (tcg_th_coreplugins tc_result)
0 commit comments