Skip to content

Mitigation for GitVersion bug when no =reference is given#36159

Merged
haampie merged 3 commits intospack:developfrom
alalazo:bugfix/git_versions
Mar 17, 2023
Merged

Mitigation for GitVersion bug when no =reference is given#36159
haampie merged 3 commits intospack:developfrom
alalazo:bugfix/git_versions

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Mar 16, 2023

fixes #36134

This commit works around the issue in #36134, by using GitVersion.satisfies instead of GitVersion.intersects.

There are still underlying issues when trying to infer the "reference version" when no explicit one is given, but:

  1. They are not reproducible with our synthetic repo
  2. They occur only when the git.<xxx> form of Git version is used

Here we just work around the user facing issue and ensure the tests are correct with our synthetic repository.

alalazo added 2 commits March 16, 2023 11:18
They are semantically equivalent for concrete versions,
but the GitVersion.intersects implementation is buggy
fixes spack#36134

This commit works around the issue in spack#36134, by using
GitVersion.satisfies instead of GitVersion.intersects

There are still underlying issues when trying to infer the
"reference version" when no explicit one is given, but:

1. They are not reproducible with our synthetic repo
2. They occur only when the `git.<xxx>` form of Git version
   is used

Here we just work around the user facing issue and ensure
the tests are correct with our synthetic repository.
@alalazo alalazo requested a review from albestro March 16, 2023 11:05
@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels Mar 16, 2023
# Also, "possible versions" contain only concrete versions, so satisfies is appropriate
allowed_versions = [
v for v in sorted(self.possible_versions[pkg_name]) if v.intersects(versions)
v for v in sorted(self.possible_versions[pkg_name]) if v.satisfies(versions)
Copy link
Copy Markdown
Member Author

@alalazo alalazo Mar 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, in this point where v.concrete is True using satisfies or intersects is conceptually the same. GitVersion.intersects has a bug that requires some time to be fixed, changing the version being called seems not ot incur in #36134

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scheibelp fyi, I think you touched the same in #35057

@haampie haampie merged commit 97193a2 into spack:develop Mar 17, 2023
@alalazo alalazo deleted the bugfix/git_versions branch March 17, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality git tests General test capability(ies) versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with git versions

2 participants