Introduce a class to represent a "closed set of concrete specs"#40636
Closed
alalazo wants to merge 15 commits intospack:developfrom
Closed
Introduce a class to represent a "closed set of concrete specs"#40636alalazo wants to merge 15 commits intospack:developfrom
alalazo wants to merge 15 commits intospack:developfrom
Conversation
haampie
reviewed
Oct 21, 2023
6796aef to
74c35d0
Compare
alalazo
commented
Nov 2, 2023
60aa55c to
8016344
Compare
8016344 to
4b4ea7d
Compare
5 tasks
This method receives a list of concrete specs to keep, and removes everything else.
4b4ea7d to
f5687db
Compare
Member
|
I'm not immediately a fan of the fact that this always duplicates.
If you wanna go this way in environments, you should use The overhead of deserializing an environment is really felt in CI with e.g. the e4s env, any command |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are many places in Spack where we need to operate with a set of consistent spec objects, i.e. a set of specs where:
This is, for instance, the case when we need to reconstruct a concrete spec during concretization, in particular if that spec is provided by more than one source of "reusable" specs (see #39590).
Another case is when we concretize or reconstruct environments. In those cases we have custom ad-hoc code to ensure consistency in memory. For concretization that would be:
spack/lib/spack/spack/environment/environment.py
Lines 1601 to 1624 in 2f24aeb
while when reading an environment from a lockfile:
spack/lib/spack/spack/environment/environment.py
Lines 2239 to 2257 in 2f24aeb
This PR is an attempt at collecting these similar operations together into a class, which can be reused in different places within the codebase. This class is a mapping from hashes to concrete specs that:
The idea is to refine an API for the class in this PR, and use it for
Environments, and apply it in later PRs also to Databases and Indexes.