Skip to content

Hide "Loading package environment" message

Motivation

#15145 (closed) introduced a new log message when a package database is loaded from a file. I'd like a way to hide this message. I tested with -v0, without success.

This poses problem in build system, such as bazel / rules_haskell, were the output is spammed by this message for each compiler step. See https://github.com/tweag/rules_haskell/issues/969

Example:

[nix-shell:~]$ touch .ghc.environment.x86_64-linux-8.6.3

[nix-shell:~]$ ghc 
Loaded package environment from /home/guillaume/.ghc.environment.x86_64-linux-8.6.3
ghc: no input files
Usage: For basic information, try the `--help' option.

The Loaded package environment from ... is annoying.

Proposal

Apparenly that's a log message with SevInfo. I did not found anyway to filter theses log messages. I tried -v0, or -ddump-to-file without success. -ddump-json changes the format of the output, but this stays in stderr.

I'll be happy to know another option to disable that or to have an option to disable log message based on severity.

Edited by Guillaume Bouchard
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information