user/spack: unprivileged users cannot install software by default
The default configuration tries to install to /opt/spack
, but this directory is not writable by unprivileged users. The bootstrap process is not affected by this, as it happens in $HOME/.spack/
.
The minimum viable change (to defaults/config.yaml
) is:
config:
install_tree:
root: $HOME/.spack
We could put something like this in /etc/skel/.spack/config.yaml
, and can use either more or fewer variables depending on what we actually want to override:
config:
build_stage: $HOME/.spack/<optional>/build_stage
misc_cache: $HOME/.spack/<optional>/misc_cache
install_tree:
root: $HOME/.spack
source_cache: $HOME/.spack/cache
Alternatively, multiple paths can be added to the default config, and Spack will use the first to which it has write access:
build_stage:
- $tempdir/$user/spack-stage
- ~/.spack/stage
Lots of decisions to be made, open for discussion. Another option is to chmod 777 /opt/spack/opt
(created at runtime) to open this up with the default configuration; proper /opt/spack/
would not be writable by unprivileged users.