diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2019-09-09 18:37:04 +0200 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-09-09 11:37:04 -0500 |
commit | bd0fed7090ccd03e6df003939dfd48eaf4f7b2f1 (patch) | |
tree | ced04a72b1351f46d90b6fc4ea29247a4fae9209 | |
parent | 7849dbb52902028cfbb3e07cdf441bf66e1edcd4 (diff) | |
download | spack-bd0fed7090ccd03e6df003939dfd48eaf4f7b2f1.tar.gz spack-bd0fed7090ccd03e6df003939dfd48eaf4f7b2f1.tar.bz2 spack-bd0fed7090ccd03e6df003939dfd48eaf4f7b2f1.tar.xz spack-bd0fed7090ccd03e6df003939dfd48eaf4f7b2f1.zip |
clang: add another regex for version detection (#12769)
This is similar to #10191. The Ubuntu package for clang 8.0.0 displays
a very unusual version string, and we need this new regex to detect it
as just 8.0.0
Unit test have been complemented by the output that was failing
detection.
-rw-r--r-- | lib/spack/spack/compilers/clang.py | 1 | ||||
-rw-r--r-- | lib/spack/spack/test/compilers.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py index 79353b0d1d..e6970d4f49 100644 --- a/lib/spack/spack/compilers/clang.py +++ b/lib/spack/spack/compilers/clang.py @@ -206,6 +206,7 @@ class Clang(Compiler): r'^Apple LLVM version ([^ )]+)|' # Normal clang compiler versions are left as-is r'clang version ([^ )]+)-svn[~.\w\d-]*|' + r'clang version ([^ )]+)-[~.\w\d-]*|' r'clang version ([^ )]+)', output ) diff --git a/lib/spack/spack/test/compilers.py b/lib/spack/spack/test/compilers.py index 39b44fbcb9..b9e2465e25 100644 --- a/lib/spack/spack/test/compilers.py +++ b/lib/spack/spack/test/compilers.py @@ -322,6 +322,10 @@ def test_fj_flags(): ('clang version 3.1 (trunk 149096)\n' 'Target: x86_64-unknown-linux-gnu\n' 'Thread model: posix\n', '3.1'), + ('clang version 8.0.0-3~ubuntu18.04.1 (tags/RELEASE_800/final)\n' + 'Target: x86_64-pc-linux-gnu\n' + 'Thread model: posix\n' + 'InstalledDir: /usr/bin\n', '8.0.0') ]) def test_clang_version_detection(version_str, expected_version): version = compilers.clang.Clang.extract_version_from_output(version_str) |