summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Gartung <gartung@fnal.gov>2020-02-25 11:01:59 -0600
committerGitHub <noreply@github.com>2020-02-25 11:01:59 -0600
commit676eb56ab2379e4d1b3958aad382d81cb012c560 (patch)
tree8455bf40d88b4b4e8c953747370514e6f7e3ed86 /lib
parent8d8925c725491cf028ef6c1b93e431dcb200f439 (diff)
downloadspack-676eb56ab2379e4d1b3958aad382d81cb012c560.tar.gz
spack-676eb56ab2379e4d1b3958aad382d81cb012c560.tar.bz2
spack-676eb56ab2379e4d1b3958aad382d81cb012c560.tar.xz
spack-676eb56ab2379e4d1b3958aad382d81cb012c560.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/buildcache.py12
1 files changed, 9 insertions, 3 deletions
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)