diff options
author | Peter Scheibel <scheibel1@llnl.gov> | 2024-03-14 13:32:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 13:32:01 -0700 |
commit | ec517b40e98dabb5759553f1d2599e50f245018a (patch) | |
tree | e6bf9f099f9446970f68608c1bdb27fd2f057b64 /share | |
parent | 22cb3815fe2df7090eb735cc472a7d37c3beb8ac (diff) | |
download | spack-ec517b40e98dabb5759553f1d2599e50f245018a.tar.gz spack-ec517b40e98dabb5759553f1d2599e50f245018a.tar.bz2 spack-ec517b40e98dabb5759553f1d2599e50f245018a.tar.xz spack-ec517b40e98dabb5759553f1d2599e50f245018a.zip |
`spack develop`: stage build artifacts in same root as non-dev builds (#41373)
Currently (outside of this PR) when you `spack develop` a path, this path is treated as the staging
directory (this means that for example all build artifacts are placed in the develop path).
This PR creates a separate staging directory for all `spack develop`ed builds. It looks like
```
# the stage root
/the-stage-root-for-all-spack-builds/
spack-stage-<hash>
# Spack packages inheriting CMakePackage put their build artifacts here
spack-build-<hash>/
```
Unlike non-develop builds, there is no `spack-src` directory, `source_path` is the provided `dev_path`.
Instead, separately, in the `dev_path`, we have:
```
/dev/path/for/foo/
build-{arch}-<hash> -> /the-stage-root-for-all-spack-builds/spack-stage-<hash>/
```
The main benefit of this is that build artifacts for out-of-source builds that are relative to
`Stage.path` are easily identified (and you can delete them with `spack clean`).
Other behavior added here:
- [x] A symlink is made from the `dev_path` to the stage directory. This symlink name incorporates
spec details, so that multiple Spack environments that develop the same path will not conflict
with one another
- [x] `spack cd` and `spack location` have added a `-c` shorthand for `--source-dir`
Spack builds can still change the develop path (in particular to keep track of applied patches),
and for in-source builds, this doesn't change much (although logs would not be written into
the develop path). Packages inheriting from `CMakePackage` should get this benefit
automatically though.
Diffstat (limited to 'share')
-rwxr-xr-x | share/spack/spack-completion.bash | 4 | ||||
-rwxr-xr-x | share/spack/spack-completion.fish | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index bdc2907d42..90d17c5f48 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -668,7 +668,7 @@ _spack_buildcache_rebuild_index() { _spack_cd() { if $list_options then - SPACK_COMPREPLY="-h --help -m --module-dir -r --spack-root -i --install-dir -p --package-dir -P --packages -s --stage-dir -S --stages --source-dir -b --build-dir -e --env --first" + SPACK_COMPREPLY="-h --help -m --module-dir -r --spack-root -i --install-dir -p --package-dir -P --packages -s --stage-dir -S --stages -c --source-dir -b --build-dir -e --env --first" else _all_packages fi @@ -1347,7 +1347,7 @@ _spack_load() { _spack_location() { if $list_options then - SPACK_COMPREPLY="-h --help -m --module-dir -r --spack-root -i --install-dir -p --package-dir -P --packages -s --stage-dir -S --stages --source-dir -b --build-dir -e --env --first" + SPACK_COMPREPLY="-h --help -m --module-dir -r --spack-root -i --install-dir -p --package-dir -P --packages -s --stage-dir -S --stages -c --source-dir -b --build-dir -e --env --first" else _all_packages fi diff --git a/share/spack/spack-completion.fish b/share/spack/spack-completion.fish index 600213454b..84e1a4721e 100755 --- a/share/spack/spack-completion.fish +++ b/share/spack/spack-completion.fish @@ -880,7 +880,7 @@ complete -c spack -n '__fish_spack_using_command buildcache rebuild-index' -s k complete -c spack -n '__fish_spack_using_command buildcache rebuild-index' -s k -l keys -d 'if provided, key index will be updated as well as package index' # spack cd -set -g __fish_spack_optspecs_spack_cd h/help m/module-dir r/spack-root i/install-dir p/package-dir P/packages s/stage-dir S/stages source-dir b/build-dir e/env= first +set -g __fish_spack_optspecs_spack_cd h/help m/module-dir r/spack-root i/install-dir p/package-dir P/packages s/stage-dir S/stages c/source-dir b/build-dir e/env= first complete -c spack -n '__fish_spack_using_command_pos_remainder 0 cd' -f -k -a '(__fish_spack_specs)' complete -c spack -n '__fish_spack_using_command cd' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command cd' -s h -l help -d 'show this help message and exit' @@ -898,8 +898,8 @@ complete -c spack -n '__fish_spack_using_command cd' -s s -l stage-dir -f -a sta complete -c spack -n '__fish_spack_using_command cd' -s s -l stage-dir -d 'stage directory for a spec' complete -c spack -n '__fish_spack_using_command cd' -s S -l stages -f -a stages complete -c spack -n '__fish_spack_using_command cd' -s S -l stages -d 'top level stage directory' -complete -c spack -n '__fish_spack_using_command cd' -l source-dir -f -a source_dir -complete -c spack -n '__fish_spack_using_command cd' -l source-dir -d 'source directory for a spec (requires it to be staged first)' +complete -c spack -n '__fish_spack_using_command cd' -s c -l source-dir -f -a source_dir +complete -c spack -n '__fish_spack_using_command cd' -s c -l source-dir -d 'source directory for a spec (requires it to be staged first)' complete -c spack -n '__fish_spack_using_command cd' -s b -l build-dir -f -a build_dir complete -c spack -n '__fish_spack_using_command cd' -s b -l build-dir -d 'build directory for a spec (requires it to be staged first)' complete -c spack -n '__fish_spack_using_command cd' -s e -l env -r -f -a location_env @@ -2089,7 +2089,7 @@ complete -c spack -n '__fish_spack_using_command load' -l list -f -a list complete -c spack -n '__fish_spack_using_command load' -l list -d 'show loaded packages: same as `spack find --loaded`' # spack location -set -g __fish_spack_optspecs_spack_location h/help m/module-dir r/spack-root i/install-dir p/package-dir P/packages s/stage-dir S/stages source-dir b/build-dir e/env= first +set -g __fish_spack_optspecs_spack_location h/help m/module-dir r/spack-root i/install-dir p/package-dir P/packages s/stage-dir S/stages c/source-dir b/build-dir e/env= first complete -c spack -n '__fish_spack_using_command_pos_remainder 0 location' -f -k -a '(__fish_spack_specs)' complete -c spack -n '__fish_spack_using_command location' -s h -l help -f -a help complete -c spack -n '__fish_spack_using_command location' -s h -l help -d 'show this help message and exit' @@ -2107,8 +2107,8 @@ complete -c spack -n '__fish_spack_using_command location' -s s -l stage-dir -f complete -c spack -n '__fish_spack_using_command location' -s s -l stage-dir -d 'stage directory for a spec' complete -c spack -n '__fish_spack_using_command location' -s S -l stages -f -a stages complete -c spack -n '__fish_spack_using_command location' -s S -l stages -d 'top level stage directory' -complete -c spack -n '__fish_spack_using_command location' -l source-dir -f -a source_dir -complete -c spack -n '__fish_spack_using_command location' -l source-dir -d 'source directory for a spec (requires it to be staged first)' +complete -c spack -n '__fish_spack_using_command location' -s c -l source-dir -f -a source_dir +complete -c spack -n '__fish_spack_using_command location' -s c -l source-dir -d 'source directory for a spec (requires it to be staged first)' complete -c spack -n '__fish_spack_using_command location' -s b -l build-dir -f -a build_dir complete -c spack -n '__fish_spack_using_command location' -s b -l build-dir -d 'build directory for a spec (requires it to be staged first)' complete -c spack -n '__fish_spack_using_command location' -s e -l env -r -f -a location_env |