diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2020-12-31 15:10:26 -0800 |
---|---|---|
committer | Tamara Dahlgren <dahlgren1@llnl.gov> | 2021-02-17 17:07:37 -0800 |
commit | 247e73e85af1cfc96f046bfcde136191d0b97855 (patch) | |
tree | a263b78b08ce7137ef69c7664c7dad1919758d13 /.readthedocs.yml | |
parent | 6056cb71d3fd6d6d6fe7f883490807b4770a96c3 (diff) | |
download | spack-247e73e85af1cfc96f046bfcde136191d0b97855.tar.gz spack-247e73e85af1cfc96f046bfcde136191d0b97855.tar.bz2 spack-247e73e85af1cfc96f046bfcde136191d0b97855.tar.xz spack-247e73e85af1cfc96f046bfcde136191d0b97855.zip |
concretizer: convert virtuals to facts; move all rules to `concretize.lp`
This converts the virtual handling in the new concretizer from
already-ground rules to facts. This is the last thing that needs to be
refactored, and it converts the entire concretizer to just use facts.
The previous way of handling virtuals hinged on rules involving
`single_provider_for` facts that were tied to the virtual and a version
range. The new method uses the condition pattern we've been using for
dependencies, externals, and conflicts.
To handle virtuals as conditions, we impose constraints on "fake" virtual
specs in the logic program. i.e., `version_satisfies("mpi", "2.0:",
"2.0")` is legal whereas before we wouldn't have seen something like
this. Currently, constriants are only handled on versions -- we don't
handle variants or anything else yet, but they key change here is that we
*could*. For a long time, virtual handling in Spack has only dealt with
versions, and we'd like to be able to handle variants as well. We could
easily add an integrity constraint to handle variants like the one we use
for versions.
One issue with the implementation here is that virtual packages don't
actually declare possible versions like regular packages do. To get
around that, we implement an integrity constraint like this:
:- virtual_node(Virtual),
version_satisfies(Virtual, V1), version_satisfies(Virtual, V2),
not version_constraint_satisfies(Virtual, V1, V2).
This requires us to compare every version constraint to every other, both
in program generation and within the concretizer -- so there's a
potentially quadratic evaluation time on virtual constraints because we
don't have a real version to "anchor" things to. We just say that all the
constraints need to agree for the virtual constraint to hold.
We can investigate adding synthetic versions for virtuals in the future,
to speed this up.
Diffstat (limited to '.readthedocs.yml')
0 files changed, 0 insertions, 0 deletions