summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@ovgu.de>2020-11-19 11:06:45 +0100
committerGreg Becker <becker33@llnl.gov>2021-09-21 16:58:41 -0700
commit6b0c775448354ae15ed356530539c983339b5594 (patch)
treeb6b09e88400672eac0cced55970558b6bef33521 /var
parent9120856c01bae7d57867e7b05fb7b292ed3ccacb (diff)
downloadspack-6b0c775448354ae15ed356530539c983339b5594.tar.gz
spack-6b0c775448354ae15ed356530539c983339b5594.tar.bz2
spack-6b0c775448354ae15ed356530539c983339b5594.tar.xz
spack-6b0c775448354ae15ed356530539c983339b5594.zip
clang/llvm: fix version detection (#19978)
This PR fixes two problems with clang/llvm's version detection. clang's version output looks like this: ``` clang version 11.0.0 Target: x86_64-unknown-linux-gnu ``` This caused clang's version to be misdetected as: ``` clang@11.0.0 Target: ``` This resulted in errors when trying to actually use it as a compiler. When using `spack external find`, we couldn't determine the compiler version, resulting in errors like this: ``` ==> Warning: "llvm@11.0.0+clang+lld+lldb" has been detected on the system but will not be added to packages.yaml [reason=c compiler not found for llvm@11.0.0+clang+lld+lldb] ``` Changing the regex to only match until the end of the line fixes these problems. Fixes: #19473
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 84c2c88499..570ce32fb2 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -244,11 +244,11 @@ class Llvm(CMakePackage, CudaPackage):
def determine_version(cls, exe):
version_regex = re.compile(
# Normal clang compiler versions are left as-is
- r'clang version ([^ )]+)-svn[~.\w\d-]*|'
+ r'clang version ([^ )\n]+)-svn[~.\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 ([^ )]+)|'
+ r'clang version ([^ )\n]+?)-[~.\w\d-]*|'
+ r'clang version ([^ )\n]+)|'
# LLDB
r'lldb version ([^ )\n]+)|'
# LLD