From 73fd1a275b7ed039ef3ca18a3706692e9e95177a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 Oct 2019 09:38:40 +0200 Subject: Add --silent, remap verbosity 0 to 1 while building modules unless silent Failed that, we may have long periods of seemingly nothing happening (e.g., during implicit bdep sync) while we quietly update the module, which may look like things have hung up. --- libbuild2/module.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libbuild2/module.cxx') diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx index b73ddb3..50c6d53 100644 --- a/libbuild2/module.cxx +++ b/libbuild2/module.cxx @@ -262,6 +262,21 @@ namespace build2 ? scheduler::tune_guard (ctx.sched, 0) : scheduler::tune_guard ()); + // Remap verbosity level 0 to 1 unless we were requested to be + // silent. Failed that, we may have long periods of seemingly + // nothing happening while we quietly update the module, which + // may look like things have hung up. + // + // @@ CTX: modifying global verbosity level won't work if we have + // multiple top-level contexts running in parallel. + // + auto verbg = make_guard ( + [z = !silent && verb == 0 ? (verb = 1, true) : false] () + { + if (z) + verb = 0; + }); + // Note that for now we suppress progress since it would clash with // the progress of what we are already doing (maybe in the future we // can do save/restore but then we would need some sort of -- cgit v1.1