This commit is contained in:
psakiev 2024-11-12 16:09:16 -07:00
parent 4d49a658c8
commit ab5c2d5f7c
2 changed files with 7 additions and 5 deletions

View File

@ -156,7 +156,11 @@ def emulate_env_utility(cmd_name, context: Context, args):
),
)
mods = build_environment.setup_package(spec.package, args.dirty, context)
if cmd:
run_command_in_subshell(spec, context, cmd, prompt=args.dive)
else:
# setup build env if no command to run
build_environment.setup_package(spec.package, args.dirty, context)
if args.dump:
# Dump a source-able environment to a text file.
@ -168,9 +172,6 @@ def emulate_env_utility(cmd_name, context: Context, args):
tty.msg("Pickling a source-able environment to {0}".format(args.pickle))
pickle_environment(args.pickle)
if cmd:
run_command_in_subshell(spec, context, cmd, prompt=args.dive, location=args.cd)
elif not bool(args.pickle or args.dump):
# If no command or dump/pickle option then act like the "env" command
# and print out env vars.

View File

@ -17,6 +17,7 @@
import spack.repo
from spack.cmd.common import arguments
from spack.cmd.common.env_utility import run_command_in_subshell
from spack.context import Context
from spack.installer import PackageInstaller
description = "developer build: build from user managed code"
@ -171,5 +172,5 @@ def dev_build(self, args):
# drop into the build environment of the package?
if args.shell is not None:
run_command_in_subshell(
spec, context.BUILD, [args.shell], prompt=args.prompt, shell=args.shell
spec, Context.BUILD, [args.shell], prompt=args.prompt, shell=args.shell
)