Fix for spack stage
command not extracting packages in custom paths (#30448)
This commit is contained in:
parent
edd3cf0b17
commit
f40f1b5c7c
@ -27,12 +27,6 @@ def setup_parser(subparser):
|
|||||||
|
|
||||||
|
|
||||||
def stage(parser, args):
|
def stage(parser, args):
|
||||||
# We temporarily modify the working directory when setting up a stage, so we need to
|
|
||||||
# convert this to an absolute path here in order for it to remain valid later.
|
|
||||||
custom_path = os.path.abspath(args.path) if args.path else None
|
|
||||||
if custom_path:
|
|
||||||
spack.stage.create_stage_root(custom_path)
|
|
||||||
|
|
||||||
if not args.specs:
|
if not args.specs:
|
||||||
env = ev.active_environment()
|
env = ev.active_environment()
|
||||||
if env:
|
if env:
|
||||||
@ -54,6 +48,10 @@ def stage(parser, args):
|
|||||||
|
|
||||||
specs = spack.cmd.parse_specs(args.specs, concretize=False)
|
specs = spack.cmd.parse_specs(args.specs, concretize=False)
|
||||||
|
|
||||||
|
# We temporarily modify the working directory when setting up a stage, so we need to
|
||||||
|
# convert this to an absolute path here in order for it to remain valid later.
|
||||||
|
custom_path = os.path.abspath(args.path) if args.path else None
|
||||||
|
|
||||||
# prevent multiple specs from extracting in the same folder
|
# prevent multiple specs from extracting in the same folder
|
||||||
if len(specs) > 1 and custom_path:
|
if len(specs) > 1 and custom_path:
|
||||||
tty.die("`--path` requires a single spec, but multiple were provided")
|
tty.die("`--path` requires a single spec, but multiple were provided")
|
||||||
|
@ -41,7 +41,6 @@ def check_stage_path(monkeypatch, tmpdir):
|
|||||||
|
|
||||||
def fake_stage(pkg, mirror_only=False):
|
def fake_stage(pkg, mirror_only=False):
|
||||||
assert pkg.path == expected_path
|
assert pkg.path == expected_path
|
||||||
assert os.path.isdir(expected_path), expected_path
|
|
||||||
|
|
||||||
monkeypatch.setattr(spack.package.PackageBase, 'do_stage', fake_stage)
|
monkeypatch.setattr(spack.package.PackageBase, 'do_stage', fake_stage)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user