summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Kuhn <suraia@ikkoku.de>2018-10-18 21:55:58 +0200
committerPeter Scheibel <scheibel1@llnl.gov>2018-10-18 12:55:58 -0700
commit7070d9fcd4a7076e67aeaf0656025ba1ff67a11e (patch)
tree19fb093114ff00ce476c23ef65348cfb8fc4d343 /lib
parent0f5f49f7518a463d65d7105156789aa96ce87d2e (diff)
downloadspack-7070d9fcd4a7076e67aeaf0656025ba1ff67a11e.tar.gz
spack-7070d9fcd4a7076e67aeaf0656025ba1ff67a11e.tar.bz2
spack-7070d9fcd4a7076e67aeaf0656025ba1ff67a11e.tar.xz
spack-7070d9fcd4a7076e67aeaf0656025ba1ff67a11e.zip
Allow setting language of compiler messages (#9486)
* Add a build_language config.yaml option which controls the language of compiler messages * build_language defaults to "C", in which case the compiler messages will be in English. This allows Spack log parsing to detect and highlight error messages (since the regular expressions to find error messages are in English) * The user can use the default language in their environment by setting the build_language config variable to null or ''
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py7
-rw-r--r--lib/spack/spack/schema/config.py1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 71edc65ce7..fa79683717 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -142,6 +142,13 @@ def clean_environment():
env.unset('LD_RUN_PATH')
env.unset('DYLD_LIBRARY_PATH')
+ build_lang = spack.config.get('config:build_language')
+ if build_lang:
+ # Override language-related variables. This can be used to force
+ # English compiler messages etc., which allows parse_log_events to
+ # show useful matches.
+ env.set('LC_ALL', build_lang)
+
# Remove any macports installs from the PATH. The macports ld can
# cause conflicts with the built-in linker on el capitan. Solves
# assembler issues, e.g.:
diff --git a/lib/spack/spack/schema/config.py b/lib/spack/spack/schema/config.py
index 0ebcd74ade..583fe79fbf 100644
--- a/lib/spack/spack/schema/config.py
+++ b/lib/spack/spack/schema/config.py
@@ -49,6 +49,7 @@ schema = {
'checksum': {'type': 'boolean'},
'locks': {'type': 'boolean'},
'dirty': {'type': 'boolean'},
+ 'build_language': {'type': 'string'},
'build_jobs': {'type': 'integer', 'minimum': 1},
'ccache': {'type': 'boolean'},
'db_lock_timeout': {'type': 'integer', 'minimum': 1},