summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2021-07-20 03:03:46 -0500
committerGitHub <noreply@github.com>2021-07-20 10:03:46 +0200
commitf7be6f94eab44cfc0f8ab20e7bd660cf87ae6570 (patch)
tree249709bac14381fe94969cb926dea6b2c89bca57 /var
parent967743adc7cb8ee516dfa8ac7dd58b75a2aae37e (diff)
downloadspack-f7be6f94eab44cfc0f8ab20e7bd660cf87ae6570.tar.gz
spack-f7be6f94eab44cfc0f8ab20e7bd660cf87ae6570.tar.bz2
spack-f7be6f94eab44cfc0f8ab20e7bd660cf87ae6570.tar.xz
spack-f7be6f94eab44cfc0f8ab20e7bd660cf87ae6570.zip
rust: add spack external find support (#24939)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/rust/package.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py
index b13a5057f1..ca3f6f3394 100644
--- a/var/spack/repos/builtin/packages/rust/package.py
+++ b/var/spack/repos/builtin/packages/rust/package.py
@@ -2,6 +2,9 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import re
+
from six import iteritems
@@ -459,6 +462,14 @@ class Rust(Package):
)
)
+ executables = ['^rustc$']
+
+ @classmethod
+ def determine_version(csl, exe):
+ output = Executable(exe)('--version', output=str, error=str)
+ match = re.match(r'rustc (\S+)', output)
+ return match.group(1) if match else None
+
# This routine returns the target architecture we intend to build for.
def get_rust_target(self):
if 'platform=linux' in self.spec or 'platform=cray' in self.spec: