Commit de3ade60 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by Ben Gamari
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:

(cherry picked from commit 00049e2d)
parent 56812d6f
......@@ -4845,6 +4845,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
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