diff options
author | Peter Scheibel <scheibel1@llnl.gov> | 2022-04-12 09:58:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 09:58:26 -0700 |
commit | 2aec5b65f3725e1f5fa3d8d4e1fab9fa00fdd113 (patch) | |
tree | 79eb8857b66ccddf190568b70696486d39e8a55c /var/spack/repos/builtin.mock/packages/git-test-commit | |
parent | 17e2fb0ef65581f338a4f5aeef9417743d00eb50 (diff) | |
download | spack-2aec5b65f3725e1f5fa3d8d4e1fab9fa00fdd113.tar.gz spack-2aec5b65f3725e1f5fa3d8d4e1fab9fa00fdd113.tar.bz2 spack-2aec5b65f3725e1f5fa3d8d4e1fab9fa00fdd113.tar.xz spack-2aec5b65f3725e1f5fa3d8d4e1fab9fa00fdd113.zip |
Git commit versions bugfix: Environments and Concretization (#29717)
Spack added support in #24639 for ad-hoc Git-commit-hash-based
versions: A user can install a package x@hash, where X is a package
that stores its source code in a Git repository, and the hash refers
to a commit in that repository which is not recorded as an explicit
version in the package.py file for X.
A couple issues were found relating to this:
* If an environment defines an alternative package repo (i.e. with
repos.yaml), and spack.yaml contains user Specs with ad-hoc
Git-commit-hash-based versions for packages in that repo,
then as part of retrieving the data needed for version comparisons
it will attempt to retrieve the package before the environment's
configuration is instantiated.
* The bookkeeping information added to compare ad-hoc git versions was
being stripped from Specs during concretization (such that user
Specs which succeeded before concretizing would then fail after)
This addresses the issues:
* The first issue is resolved by deferring access to the associated
Package until the versions are actually compared to one another.
* The second issue is resolved by ensuring that the Git bookkeeping
information is explicitly applied to Specs after they are concretized.
This also:
* Resolves an ambiguity in the mock_git_version_info fixture used to
create a tree of Git commits and provide a list where each index
maps to a known commit.
* Isolates the cache used for Git repositories in tests using the
mock_git_version_info fixture
* Adds a TODO which points out that if the remote Git repository
overwrites tags, that Spack will then fail when using
ad-hoc Git-commit-hash-based versions
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/git-test-commit')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/git-test-commit/package.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/git-test-commit/package.py b/var/spack/repos/builtin.mock/packages/git-test-commit/package.py index 7f33bca4f0..0eec7c8b62 100644 --- a/var/spack/repos/builtin.mock/packages/git-test-commit/package.py +++ b/var/spack/repos/builtin.mock/packages/git-test-commit/package.py @@ -17,6 +17,8 @@ class GitTestCommit(Package): version('2.0', tag='v2.0') def install(self, spec, prefix): + # It is assumed for the test which installs this package, that it will + # be using the earliest commit, which is contained in the range @:0 assert spec.satisfies('@:0') mkdir(prefix.bin) |