diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-08-23 15:08:03 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-23 23:39:49 -0400 |
commit | 64696202322db58189c9b1384130729aa6beea29 (patch) | |
tree | ee61d1877497db62d0acdd4f07a27051145392c3 | |
parent | 03fc0393e035508e906bbabd96aaf6620dff93c3 (diff) | |
download | haskell-64696202322db58189c9b1384130729aa6beea29.tar.gz |
driver: Initialise common plugins once, before starting the pipeline
This fixes an error message regression and is a slight performance
improvement.
See #20250
-rw-r--r-- | compiler/GHC/Driver/Make.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/plugins/T11244.stderr | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs index 1d77bf6898..e1ba4ea5d8 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -148,6 +148,7 @@ import Control.Monad.Trans.Class import GHC.Driver.Env.KnotVars import Control.Concurrent.STM import Control.Monad.Trans.Maybe +import GHC.Runtime.Loader -- ----------------------------------------------------------------------------- @@ -2367,10 +2368,11 @@ runPipelines n_jobs orig_hsc_env old_hpt mHscMessager all_pipelines = do -- Thread which coordinates the printing of logs wait_log_thread <- logThread (hsc_logger orig_hsc_env) stopped_var log_queue_queue_var + plugins_hsc_env <- initializePlugins orig_hsc_env Nothing -- Make the logger thread-safe, in case there is some output which isn't sent via the LogQueue. thread_safe_logger <- liftIO $ makeThreadSafe (hsc_logger orig_hsc_env) - let thread_safe_hsc_env = orig_hsc_env { hsc_logger = thread_safe_logger } + let thread_safe_hsc_env = plugins_hsc_env { hsc_logger = thread_safe_logger } let updNumCapabilities = liftIO $ do n_capabilities <- getNumCapabilities diff --git a/testsuite/tests/plugins/T11244.stderr b/testsuite/tests/plugins/T11244.stderr index 65245b7f80..72f01060db 100644 --- a/testsuite/tests/plugins/T11244.stderr +++ b/testsuite/tests/plugins/T11244.stderr @@ -1,6 +1,4 @@ - -<no location info>: error: - Could not load module ‘RuleDefiningPlugin’ +<command line>: Could not load module ‘RuleDefiningPlugin’ It is a member of the hidden package ‘rule-defining-plugin-0.1’. You can run ‘:set -package rule-defining-plugin’ to expose it. (Note: this unloads all the modules in the current scope.) |