rust: add spack external find support (#24939)
This commit is contained in:
parent
967743adc7
commit
f7be6f94ea
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user