diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-11-28 17:05:08 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-12-07 12:41:43 +0000 |
commit | 9fa13b2c5f43d6fbaeb4360ac54391a91b3e9e54 (patch) | |
tree | 61887ff3f838bf890bbd6d95302e862d829da9a0 /build_scripts/main.py | |
parent | 4d82ee992992251bcadf0097a4df60fe7c3b7ef8 (diff) |
Make quiet builds really quiet
The change does a couple of things:
- Sets the distutils / setuptools --verbose option to 0
- Sets the distutils / setuptools --quiet option to 1
- The options above end up calling distutils.log.set_verbosity(0)
- Passes the QUIET_BUILD cmake option from setup.py to every
CMake invocation, when --quiet is passed to setup.py
- Sets the CMAKE_INSTALL_MESSAGE variable to silence messages
regarding installation of files
- Sets the CMAKE_RULE_MESSAGES variable to disable progress report
in makefiles when building each source file
- Overrides the CMake message function, not to display
STATUS / info / untyped messages (still displays warnings and
errors)
- Changes the build / install elapsed time messages to always be
printed even in quiet mode
- Reverts the previously introduced set_quiet function in utils,
because log.set_verbosity() now takes care of silencing those
messages
As a result, there's a lot less clutter when doing a quiet build.
Warnings, errors and shiboken output is still displayed.
Change-Id: Ie05c593ce7dc0aa04554c2d2859ce655233ddb9f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts/main.py')
-rw-r--r-- | build_scripts/main.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index 0fec51a6a..cdc6dce7e 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -43,7 +43,7 @@ from distutils.version import LooseVersion import os import time from .config import config -from .utils import memoize, get_python_dict, set_quiet +from .utils import memoize, get_python_dict from .options import * setup_script_dir = os.getcwd() @@ -304,7 +304,7 @@ def prepare_build(): for n in ["build"]: d = os.path.join(setup_script_dir, n) if os.path.isdir(d): - print("Removing {}".format(d)) + log.info("Removing {}".format(d)) try: rmtree(d) except Exception as e: @@ -346,7 +346,7 @@ class PysideInstall(_install): def run(self): _install.run(self) - log.info('*** Install completed ({}s)'.format(elapsed())) + print('*** Install completed ({}s)'.format(elapsed())) class PysideDevelop(_develop): @@ -727,7 +727,7 @@ class PysideBuild(_build): _build.run(self) else: log.info("Skipped preparing and building packages.") - log.info('*** Build completed ({}s)'.format(elapsed())) + print('*** Build completed ({}s)'.format(elapsed())) def log_pre_build_info(self): if config.is_internal_shiboken_generator_build_and_part_of_top_level_all(): @@ -915,8 +915,14 @@ class PysideBuild(_build): # Build module cmake_cmd = [OPTION_CMAKE] if OPTION_QUIET: - set_quiet(True) - cmake_cmd.append('--quiet') + # Pass a special custom option, to allow printing a lot less information when doing + # a quiet build. + cmake_cmd.append('-DQUIET_BUILD=1') + if self.make_generator == "Unix Makefiles": + # Hide progress messages for each built source file. + # Doesn't seem to work if set within the cmake files themselves. + cmake_cmd.append('-DCMAKE_RULE_MESSAGES=0') + cmake_cmd += [ "-G", self.make_generator, "-DBUILD_TESTS={}".format(self.build_tests), @@ -1315,9 +1321,8 @@ class PysideBuild(_build): if not os.path.exists(srcpath): continue rpath_cmd(srcpath) - if not OPTION_QUIET: - print("Patched rpath to '$ORIGIN/' (Linux) or " - "updated rpath (OS/X) in {}.".format(srcpath)) + log.info("Patched rpath to '$ORIGIN/' (Linux) or " + "updated rpath (OS/X) in {}.".format(srcpath)) cmd_class_dict = { |