From 4b78450bae8bf839d6d438bc4f92efdcdc3979a0 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 26 Nov 2021 17:31:14 +0100 Subject: setup.py: Fix no log messages being shown during setup call The default verbosity of a log object is WARN. distutils then set it to INFO when initializing the Distribution object. This would not affect the log object copy that setuptools exposes (and we now use). This caused the usual INFO messages not to be shown anymore. Explicitly set the setuptools log object verbosity to INFO unless the quiet option was given. Amends 95a5bb9dd3b5d3fa86f2ed0868e2b821256a6028 Pick-to: 6.2 Change-Id: I793dc92582007895fa23d43baabe5b97c146552e Reviewed-by: Friedemann Kleint --- build_scripts/setup_runner.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/build_scripts/setup_runner.py b/build_scripts/setup_runner.py index ddf98fef0..5e0b2b486 100644 --- a/build_scripts/setup_runner.py +++ b/build_scripts/setup_runner.py @@ -116,6 +116,18 @@ class SetupRunner(object): setup_script_dir=self.setup_script_dir, quiet=OPTION["QUIET"]) + # Enable logging for both the top-level invocation of setup.py + # as well as for child invocations. We we now use + # setuptools._distutils.log instead of distutils.log, and this + # new log object does not have its verbosity set by default + # when setuptools instantiates a distutils Distribution object, + # which calls + # dist.parse_command_line() -> log.set_verbosity(self.verbose) + # on the old distutils log object. + # So we do it explicitly here. + if not OPTION["QUIET"]: + log.set_verbosity(log.INFO) + # This is an internal invocation of setup.py, so start actual # build. if config.is_internal_invocation(): @@ -125,10 +137,6 @@ class SetupRunner(object): self.run_setuptools_setup() return - # Enable logging. - if not OPTION["QUIET"]: - log.set_verbosity(log.INFO) - # This is a top-level invocation of setup.py, so figure out what # modules we will build and depending on that, call setup.py # multiple times with different arguments. -- cgit v1.2.3