summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2018-05-25 12:05:40 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2018-08-21 21:21:53 -0700
commit0b0887f48fa719a7500c0d932a83be9b26cc7ac7 (patch)
tree7a3a524fa15db7f9e4a76e637da1be2a87f70e53 /lib
parentf97550e149ccfd4293fb511254216a8fa532f396 (diff)
downloadspack-0b0887f48fa719a7500c0d932a83be9b26cc7ac7.tar.gz
spack-0b0887f48fa719a7500c0d932a83be9b26cc7ac7.tar.bz2
spack-0b0887f48fa719a7500c0d932a83be9b26cc7ac7.tar.xz
spack-0b0887f48fa719a7500c0d932a83be9b26cc7ac7.zip
Display warnings if no errors are found in build log
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 8cda3fff08..6dde537e1d 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -907,16 +907,25 @@ class ChildError(InstallError):
if (self.module, self.name) in ChildError.build_errors:
# The error happened in some external executed process. Show
- # the build log with errors highlighted.
+ # the build log with errors or warnings highlighted.
if self.build_log and os.path.exists(self.build_log):
errors, warnings = parse_log_events(self.build_log)
nerr = len(errors)
+ nwar = len(warnings)
if nerr > 0:
+ # If errors are found, only display errors
if nerr == 1:
out.write("\n1 error found in build log:\n")
else:
out.write("\n%d errors found in build log:\n" % nerr)
out.write(make_log_context(errors))
+ elif nwar > 0:
+ # If no errors are found but warnings are, display warnings
+ if nwar == 1:
+ out.write("\n1 warning found in build log:\n")
+ else:
+ out.write("\n%d warnings found in build log:\n" % nwar)
+ out.write(make_log_context(warnings))
else:
# The error happened in in the Python code, so try to show