From eda744718ec66f741b2ecdf3b2fa08d6c34e0e90 Mon Sep 17 00:00:00 2001 From: Philip Sakievich Date: Fri, 21 Mar 2025 17:02:38 -0600 Subject: [PATCH] Write tests and stub out core changes --- lib/spack/spack/solver/asp.py | 4 ++++ lib/spack/spack/solver/concretize.lp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 6f92ab0b122..cf2222253b4 100644 --- a/lib/spack/spack/solver/asp.py +++ b/lib/spack/spack/solver/asp.py @@ -2688,6 +2688,8 @@ def define_package_versions_and_validate_preferences( if pkg_name not in packages_yaml or "version" not in packages_yaml[pkg_name]: continue + # TODO(psakiev) Need facts about versions + # - requires_commit (associated with tag or branch) version_defs: List[GitOrStandardVersion] = [] for vstr in packages_yaml[pkg_name]["version"]: @@ -3114,6 +3116,7 @@ def setup( specs = tuple(specs) # ensure compatible types to add self.gen.h1("Reusable concrete specs") + #TODO(psakiev) need fact spec has commit self.define_concrete_input_specs(specs, self.pkgs) if reuse: self.gen.fact(fn.optimize_for_reuse()) @@ -4187,6 +4190,7 @@ def execute_explicit_splices(self): def _specs_with_commits(spec): spec.package.resolve_binary_provenance() + # TODO(psakiev) assert commit is associated with ref # method above is in charge of assigning the commit variant has_commit_var = "commit" in spec.variants diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp index 287128206ac..af92dc1f177 100644 --- a/lib/spack/spack/solver/concretize.lp +++ b/lib/spack/spack/solver/concretize.lp @@ -257,6 +257,8 @@ pkg_fact(Package, version_declared(Version)) :- pkg_fact(Package, version_declar { attr("version", node(ID, Package), Version) : pkg_fact(Package, version_declared(Version)) } :- attr("node", node(ID, Package)). +% TODO(psakiev) need rule if spec has commit version must need commit + % A virtual package may or may not have a version, but never has more than one error(100, "Cannot select a single version for virtual '{0}'", Virtual) :- attr("virtual_node", node(ID, Virtual)),