spack/share/spack
Peter Scheibel ec517b40e9
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.
2024-03-14 13:32:01 -07:00
..
bash Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
bootstrap Update bootstrap buildcache to support Python 3.12 (#40404) 2023-10-11 19:03:17 +02:00
csh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
docker Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
docs/docker/module-file-tutorial Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
fish Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
gitlab e4s ci stacks: add cp2k cpu and gpu specs (#42454) 2024-03-11 09:29:51 -07:00
keys
logo
qa Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
templates modules: Truncate configure options comment in tcl modules to 8192 ch… (#42054) 2024-01-11 22:05:56 -07:00
setup-env.csh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-env.fish Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-env.ps1 Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
setup-env.sh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-tutorial-env.sh Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
spack-completion.bash spack develop: stage build artifacts in same root as non-dev builds (#41373) 2024-03-14 13:32:01 -07:00
spack-completion.fish spack develop: stage build artifacts in same root as non-dev builds (#41373) 2024-03-14 13:32:01 -07:00