[commit: ghc] master: Emit info-level log message when package envs are loaded (00049e2)

git at git.haskell.org git at git.haskell.org
Sun May 13 17:34:51 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/00049e2dce93b1e468c3fde3287371eb988aafdc/ghc

>---------------------------------------------------------------

commit 00049e2dce93b1e468c3fde3287371eb988aafdc
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun May 13 19:32:29 2018 +0200

    Emit info-level log message when package envs are loaded
    
    A common complaint with the new package environment files feature is
    that it's not obvious when package environments have been picked up.
    This patch applies the same strategy that was already used for `.ghci` files
    (which exhibit similar potential for confusion, c.f. #11389) to package
    environment files.
    
    For instance, this new notification looks like below for a GHCi invocation which
    loads both, a GHCi configuration as well as a package environment:
    
      GHCi, version 8.5.20180512: http://www.haskell.org/ghc/  :? for help
      Loaded package environment from /tmp/parsec-3.1.13.0/.ghc.environment.x86_64-linux-8.5.20180512
      Loaded GHCi configuration from /home/hvr/.ghci
      Prelude>
    
    Addresses #15145
    
    Reviewed By: bgamari, angerman
    
    GHC Trac Issues: #15145
    
    Differential Revision: https://phabricator.haskell.org/D4689


>---------------------------------------------------------------

00049e2dce93b1e468c3fde3287371eb988aafdc
 compiler/main/DynFlags.hs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index bd3e2a0..6e839cc 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4959,6 +4959,9 @@ interpretPackageEnv dflags = do
         return dflags
       Just envfile -> do
         content <- readFile envfile
+        putLogMsg dflags NoReason SevInfo noSrcSpan
+             (defaultUserStyle dflags)
+             (text ("Loaded package environment from " ++ envfile))
         let setFlags :: DynP ()
             setFlags = do
               setGeneralFlag Opt_HideAllPackages



More information about the ghc-commits mailing list