Commit 00049e2d authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

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:  :? for help
  Loaded package environment from /tmp/parsec-
  Loaded GHCi configuration from /home/hvr/.ghci

Addresses #15145

Reviewed By: bgamari, angerman

GHC Trac Issues: #15145

Differential Revision:
parent 78db41ea
...@@ -4959,6 +4959,9 @@ interpretPackageEnv dflags = do ...@@ -4959,6 +4959,9 @@ interpretPackageEnv dflags = do
return dflags return dflags
Just envfile -> do Just envfile -> do
content <- readFile envfile content <- readFile envfile
putLogMsg dflags NoReason SevInfo noSrcSpan
(defaultUserStyle dflags)
(text ("Loaded package environment from " ++ envfile))
let setFlags :: DynP () let setFlags :: DynP ()
setFlags = do setFlags = do
setGeneralFlag Opt_HideAllPackages setGeneralFlag Opt_HideAllPackages
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment