rust: add spack external find support (#24939)

This commit is contained in:
Adam J. Stewart 2021-07-20 03:03:46 -05:00 committed by GitHub
parent 967743adc7
commit f7be6f94ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: