spack/share/spack
Massimiliano Culpo 3ad99d75f9
Assign priorities to configuration scopes (#48420)
Currently, environments can end up with higher priority than `-C` custom
config scopes and `-c` command line arguments sometimes. This shouldn't
happen -- those explicit CLI scopes should override active environments.

Up to now configuration behaved like a stack, where scopes could be only be
pushed at the top. This PR allows to assign priorities to scopes, and ensures
that scopes of lower priorities are always "below" scopes of higher priorities.

When scopes have the same priority, what matters is the insertion order.

Modifications:
- [x] Add a mapping that iterates over keys according to priorities set when
      adding the key/value pair
- [x] Use that mapping to allow assigning priorities to configuration scopes
- [x] Assign different priorities for different kind of scopes, to fix a bug, and
      add a regression test
- [x] Simplify `Configuration` constructor
- [x] Remove `Configuration.pop_scope`
- [x] Remove `unify:false` from custom `-C` scope in pipelines

On the last modification: on `develop`, pipelines are relying on the environment
being able to override `-C` scopes, which is a bug. After this fix, we need to be
explicit about the unification strategy in each stack, and remove the blanket
`unify:false` from the highest priority scope

Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2025-02-25 00:58:16 -08:00
..
bash Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
bootstrap bootstrap: add clingo 3.13 binaries and more (#47126) 2024-10-24 08:55:14 +02:00
csh Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
docker Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
docs/docker/module-file-tutorial Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
fish Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
gitlab/cloud_pipelines Assign priorities to configuration scopes (#48420) 2025-02-25 00:58:16 -08:00
keys update tutorial command for v0.18.0 and new gpg key (#30904) 2022-05-28 02:36:20 +00:00
logo add artisanal handcrafted SVG Spack logo. (#6165) 2017-11-06 22:42:16 -08:00
qa Fix regression due to dyninst update (#48935) 2025-02-07 10:46:42 +01:00
templates Don't inject import statements in package recipes 2024-12-05 12:48:00 -08:00
setup-env.bat Normalize Spack Win entry points (#38648) 2024-10-25 15:23:29 -04:00
setup-env.csh Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
setup-env.fish setup-env.fish: fix version checking for completions (#48806) 2025-02-23 20:28:51 +00:00
setup-env.ps1 Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
setup-env.sh Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
setup-tutorial-env.sh Remove years from license headers (#48352) 2025-01-02 15:40:28 +01:00
spack-completion.bash spack verify libraries: verify dependencies of installed packages can be resolved (#49124) 2025-02-24 11:28:06 +01:00
spack-completion.fish spack verify libraries: verify dependencies of installed packages can be resolved (#49124) 2025-02-24 11:28:06 +01:00