-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spack -d env
doesn't run in debug mode
#44101
Labels
Milestone
Comments
wdconinc
added
bug
Something isn't working
triage
The issue needs to be prioritized
labels
May 9, 2024
Seems caused by spack/share/spack/setup-env.sh Line 165 in b79761b
Instead of just passing the subcommand to |
There are more, similar issues, like
doesn't work, for multiple reasons:
|
Something along the lines of #!/bin/sh
spack() {
i=1
flags=""
args=""
command_idx=0
while [ $i -le $# ]; do
if [ $command_idx -gt 0 ]; then
args="$args "'"'\$"$i"'"'
i=$((i + 1))
continue
fi
eval "arg=\$$i"
case "$arg" in
--color|--lines|--sorted-profile|-C|--config-scope|-D|--env-dir|-c|--config|-e|--env)
flags="$flags "'"'\$"$i"'" "'\$"$((i + 1))"'"'; i=$((i + 2)) ;;
--*)
flags="$flags "'"'\$"$i"'"'; i=$((i + 1)) ;;
-*C|-*D|-*c|-*e)
flags="$flags "'"'\$"$i"'" "'\$"$((i + 1))"'"'; i=$((i + 2)) ;;
-*)
flags="$flags "'"'\$"$i"'"'; i=$((i + 1)) ;;
env)
command_idx=$i
command="$arg"
eval "subcommand=\$$((i + 1))"
i=$((i + 2)) ;;
*)
command_idx=$i
command="$arg"
i=$((i + 1)) ;;
esac
done
case "$command" in
cd)
eval "cd \"\$(command spack $flags location $args)\""
return
;;
env)
case "$subcommand" in
activate|deactivate)
eval "out=\"\$(command spack $flags env $subcommand $args --sh)\""
eval "$out"
return
;;
esac
;;
esac
command spack "$@"
} fixes most issues. For example, it turns
into
through |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Error message
Information on your system
General information
spack debug report
and reported the version of Spack/Python/PlatformThe text was updated successfully, but these errors were encountered: