diff options
author | Tim Haines <thaines.astro@gmail.com> | 2020-01-08 00:13:36 -0600 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-01-08 07:13:36 +0100 |
commit | 2028687efe1d195d9c4a47fc138ee636dc18ba47 (patch) | |
tree | 351e95d15f9e89841b6cf40bf2289adc0a36be53 /lib | |
parent | 8a82c930bb39b0ab87db7c5927a88c34d0965322 (diff) | |
download | spack-2028687efe1d195d9c4a47fc138ee636dc18ba47.tar.gz spack-2028687efe1d195d9c4a47fc138ee636dc18ba47.tar.bz2 spack-2028687efe1d195d9c4a47fc138ee636dc18ba47.tar.xz spack-2028687efe1d195d9c4a47fc138ee636dc18ba47.zip |
spack.compilers.clang: add new version check (#14365)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/compilers/clang.py | 4 | ||||
-rw-r--r-- | lib/spack/spack/test/compilers.py | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py index a39499bdc0..c8df63e533 100644 --- a/lib/spack/spack/compilers/clang.py +++ b/lib/spack/spack/compilers/clang.py @@ -208,7 +208,9 @@ class Clang(Compiler): r'^Apple (?:LLVM|clang) version ([^ )]+)|' # Normal clang compiler versions are left as-is r'clang version ([^ )]+)-svn[~.\w\d-]*|' - r'clang version ([^ )]+)-[~.\w\d-]*|' + # Don't include hyphenated patch numbers in the version + # (see https://github.com/spack/spack/pull/14365 for details) + 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 445b5c7d62..9395ddba80 100644 --- a/lib/spack/spack/test/compilers.py +++ b/lib/spack/spack/test/compilers.py @@ -348,6 +348,14 @@ def test_fj_flags(): ('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'), + ('clang version 9.0.1-+201911131414230800840845a1eea-1~exp1~20191113231141.78\n' # noqa + 'Target: x86_64-pc-linux-gnu\n' + 'Thread model: posix\n' + 'InstalledDir: /usr/bin\n', '9.0.1'), + ('clang version 8.0.0-3 (tags/RELEASE_800/final)\n' + 'Target: aarch64-unknown-linux-gnu\n' + 'Thread model: posix\n' 'InstalledDir: /usr/bin\n', '8.0.0') ]) def test_clang_version_detection(version_str, expected_version): |