From 676eb56ab2379e4d1b3958aad382d81cb012c560 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Tue, 25 Feb 2020 11:01:59 -0600 Subject: Buildcache cmd: add install -o/--otherarch option for installing macOS buildcaches on linux (#15192) * Buildcache command: add install option -o/--otherarch This will allow matching specs from other archs, for example installing macOS buildcaches on linux hosts. * spack commands --update-completion --- lib/spack/spack/cmd/buildcache.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/buildcache.py b/lib/spack/spack/cmd/buildcache.py index 392984f852..1d105a0c0d 100644 --- a/lib/spack/spack/cmd/buildcache.py +++ b/lib/spack/spack/cmd/buildcache.py @@ -76,6 +76,10 @@ def setup_parser(subparser): install.add_argument('-u', '--unsigned', action='store_true', help="install unsigned buildcache" + " tarballs for testing") + install.add_argument('-o', '--otherarch', action='store_true', + help="install specs from other architectures" + + " instead of default platform and OS") + arguments.add_common_arguments(install, ['specs']) install.set_defaults(func=installtarball) @@ -252,7 +256,8 @@ def find_matching_specs(pkgs, allow_multiple_matches=False, env=None): return specs_from_cli -def match_downloaded_specs(pkgs, allow_multiple_matches=False, force=False): +def match_downloaded_specs(pkgs, allow_multiple_matches=False, force=False, + other_arch=False): """Returns a list of specs matching the not necessarily concretized specs given from cli @@ -266,7 +271,7 @@ def match_downloaded_specs(pkgs, allow_multiple_matches=False, force=False): # List of specs that match expressions given via command line specs_from_cli = [] has_errors = False - allarch = False + allarch = other_arch specs = bindist.get_specs(force, allarch) for pkg in pkgs: matches = [] @@ -387,7 +392,8 @@ def installtarball(args): tty.die("build cache file installation requires" + " at least one package spec argument") pkgs = set(args.specs) - matches = match_downloaded_specs(pkgs, args.multiple, args.force) + matches = match_downloaded_specs(pkgs, args.multiple, args.force, + args.otherarch) for match in matches: install_tarball(match, args) -- cgit v1.2.3-70-g09d2