From 337bf3b944cdd11ab6cdd9c93bcae879abad873a Mon Sep 17 00:00:00 2001 From: psakievich Date: Tue, 11 Jun 2024 14:57:09 -0600 Subject: Enable and constrain reuse for GitVersion installations (#43859) * Preserve higher weight for CLI git ref versions Currently the concretizer fails if you reuse a git ref version that has already been installed but modify the spec at all. See #38484 for futher diagnosis The issue here is that since there is no established provenance for these versions the highest weight they are currently assigned is that of prior install. Re-use checks then fail because the weight of the version is identical to the solver. Ironically, these versions are given the highest weights possible when specified on the CLI for the first time. They should only appear in a DAG if they are an exact match or if the user specifies them at the CLI. Therefore it makes sense to preserve their higher ordering. Getting this right is critical to moving all branch based versions to a pinned git-ref in the future. * [@spackbot] updating style on behalf of psakievich * Update lib/spack/spack/solver/asp.py Co-authored-by: Greg Becker * Add provenance specific to git ref installs * Sensitvity to name that I could not track down * Add regression test * Adjust test * Add prefer standard unit-test * Style * Add required mock * Format and mark * Make unit-test case reproduce CLI investigation * Remove unnecessary mock package * [@spackbot] updating style on behalf of psakievich * Use already developed fixture * Add zlib-ng to mocks again * Remove accidental adds * Remove maintainer * [@spackbot] updating style on behalf of psakievich * Rename test file * [@spackbot] updating style on behalf of psakievich * Remove unused imports * Update tests * [@spackbot] updating style on behalf of psakievich * Style * Update lib/spack/spack/test/concretize.py Co-authored-by: Greg Becker * Update solver rule * Duplicate installed rules for installed_git_version * Revert "Duplicate installed rules for installed_git_version" This reverts commit 17223fc8d1c9461cb87e5a230f397167d1ab6d40. --------- Co-authored-by: psakievich Co-authored-by: Greg Becker --- .../packages/git-ref-package/package.py | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/git-ref-package/package.py (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/git-ref-package/package.py b/var/spack/repos/builtin.mock/packages/git-ref-package/package.py new file mode 100644 index 0000000000..21fe10e818 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/git-ref-package/package.py @@ -0,0 +1,41 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class GitRefPackage(AutotoolsPackage): + """ + dummy package copied from zlib-ng + """ + + homepage = "https://github.com/dummy/dummy" + url = "https://github.com/dummy/dummy/archive/2.0.0.tar.gz" + git = "https://github.com/dummy/dummy.git" + + version("2.1.6", sha256="a5d504c0d52e2e2721e7e7d86988dec2e290d723ced2307145dedd06aeb6fef2") + version("2.1.5", sha256="3f6576971397b379d4205ae5451ff5a68edf6c103b2f03c4188ed7075fbb5f04") + version("2.1.4", sha256="a0293475e6a44a3f6c045229fe50f69dc0eebc62a42405a51f19d46a5541e77a") + version( + "2.1.3", + sha256="d20e55f89d71991c59f1c5ad1ef944815e5850526c0d9cd8e504eaed5b24491a", + deprecated=True, + ) + version( + "2.1.2", + sha256="383560d6b00697c04e8878e26c0187b480971a8bce90ffd26a5a7b0f7ecf1a33", + deprecated=True, + ) + version("2.0.7", sha256="6c0853bb27738b811f2b4d4af095323c3d5ce36ceed6b50e5f773204fb8f7200") + version("2.0.0", sha256="86993903527d9b12fc543335c19c1d33a93797b3d4d37648b5addae83679ecd8") + + variant("compat", default=True, description="Enable compatibility API") + variant("opt", default=True, description="Enable optimizations") + variant("shared", default=True, description="Build shared library") + variant("pic", default=True, description="Enable position-independent code (PIC)") + + conflicts("+shared~pic") + + variant("new_strategies", default=True, description="Enable new deflate strategies") -- cgit v1.2.3-70-g09d2