summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
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: