Spack reads a handful of process-global singletons from inside its library code. A function that needs configuration does not take it as an argument, but instead reaches for the global.
This is convenient, but it is also the source of a recurring set of problems:
-
Tests fight the globals. To test a function we mutate a global, run, and restore. That is slow (real IO), leaks state between tests, and makes it easy for an object to go out of sync with the configuration it is being derived from.
-
No two instances at once. Because there is exactly one
CONFIGand oneSTORE, code cannot operate on two of them in the same process without swapping the global back and forth. The clingo bootstrap does this swap today. Environments push and pop config scopes onto the global. Parallel solves with different configs are not possible or harder to do than necessary.