-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clingo error with versions of virtual packages #26718
Comments
Bug confirmed. This is due to the fact that we don't have a "version uniqueness" rule for virtual packages. This diff: diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp
index e444faffec..a05c062071 100644
--- a/lib/spack/spack/solver/concretize.lp
+++ b/lib/spack/spack/solver/concretize.lp
@@ -28,6 +28,8 @@ version_declared(Package, Version) :- version_declared(Package, Version, _).
1 { version(Package, Version) : version_declared(Package, Version) } 1
:- node(Package).
+:- virtual_node(Package), 2 { version(Package, _) }.
+
% If we select a deprecated version, mark the package as deprecated
deprecated(Package, Version) :- version(Package, Version), deprecated_version(Package, Version). solves the bug for me. Currently checking if any test is failing and trying to add a regression test. |
For reference, the current answer set contains 2 versions of
|
fixes spack#26718 A virtual package may or may not have a version, but it never has more than one. Previously we were missing a rule for that.
Hi @mwkrentel thanks for the report! Fix is in #26740 In general if you encounter issues like this one with clingo, feel free to report them on Github and assign to me. |
Steps to reproduce
This is a bug with clingo and versions of virtual packages.
For hpcviewer, old versions require java exactly version 8, new
versions use java >= 11, so we have:
Note that the two when regions are disjoint, so for a given version,
only one can be correct. But with clingo, an old spec
hpcviewer@2019.12
concretizes as:This is incorrect. Version 2019.12 satisfies @:2020 and
should require java 8, so openjdk 1.8.
The problem is with the combination of clingo and java as a virtual
package. The original concretizer correctly picks
openjdk@1.8.0_265-b01
Or, if I change
depends_on('java')
to a concrete package openjdk(version 1.8), then clingo correctly picks 1.8.0_265-b01.
ping @tgamblin @alalazo @becker33
anyone else ?
Error message
$ spack -d spec hpcviewer@2019.12
spack-spec.txt
Information on your system
$ spack debug report
General information
spack debug report
and reported the version of Spack/Python/PlatformThe text was updated successfully, but these errors were encountered: