Skip to content

Bugfix: package requirements with git commits#35057

Merged
tgamblin merged 46 commits intospack:developfrom
scheibelp:bugfix/require-undefined-versions2
Mar 23, 2023
Merged

Bugfix: package requirements with git commits#35057
tgamblin merged 46 commits intospack:developfrom
scheibelp:bugfix/require-undefined-versions2

Conversation

@scheibelp
Copy link
Copy Markdown
Member

@scheibelp scheibelp commented Jan 20, 2023

Specs which define 'new' versions in the require: section need to generate associated facts to indicate that those versions are valid.

(Update: since addressed, although pending further discussion) There's a couple conceptual issues at the moment (noted as TODOs in the code).

…erate associated facts to indicate that those versions are valid
@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels Jan 20, 2023
@scheibelp scheibelp requested a review from becker33 January 20, 2023 23:29
@scheibelp

This comment was marked as resolved.

@spackbot-app

This comment was marked as resolved.

@scheibelp
Copy link
Copy Markdown
Member Author

@spackbot fix style

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Jan 20, 2023

Let me see if I can fix that for you!

@spackbot-app

This comment was marked as resolved.

Comment thread lib/spack/spack/test/concretize_requirements.py Outdated
Copy link
Copy Markdown
Member

@becker33 becker33 left a comment

Choose a reason for hiding this comment

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

mostly LGTM

Comment thread lib/spack/spack/solver/asp.py Outdated
Comment thread lib/spack/spack/test/concretize_requirements.py Outdated
@spackbot-app spackbot-app bot added the documentation Improvements or additions to documentation label Feb 17, 2023
Comment thread lib/spack/spack/solver/asp.py Outdated
Comment thread lib/spack/spack/solver/asp.py Outdated
@scheibelp
Copy link
Copy Markdown
Member Author

I've addressed the direct review comments but haven't fully resolved my original questions. I've iterated on those at:

…quivalence) - passes in this branch but not on develop
@scheibelp
Copy link
Copy Markdown
Member Author

I also added fd58f2b to demonstrate that without these changes you also cannot do require: @hash (you can test the before/after with git checkout develop -- lib/spack/spack/solver/asp.py - although I'm trying to think of a better way to confirm the before/after of this in general).

…record these individually and (b) define an equivalence between them. Problem: the spec *after* concretization does not record the equivalence
…transferring properties from command line specs)
# In this case, neither supplies a version equivalence with "="
# and the commit strings are equal
return True
elif other.is_ref:
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.

@alalazo @tgamblin I think this implements the desired semantics and I added test_git_user_supplied_reference_satisfaction to confirm that (I didn't see a test covering these in test/versions.py). I don't think this will conflict with #35681 (that doesn't change satisfies, and furthermore satisfies can be more strict than intersects).

@tgamblin tgamblin dismissed becker33’s stale review March 23, 2023 08:53

no longer relevant

@tgamblin
Copy link
Copy Markdown
Member

Pipeline here is only failing because a power runner could not be found. Everything else is passing, and version_satisfies() is clearly implementing satisfies(), so I am happy with this. Thanks @scheibelp!

@tgamblin tgamblin merged commit 3d597e2 into spack:develop Mar 23, 2023
self.idx = idx
self.origin = origin

def __eq__(self, other):
Copy link
Copy Markdown
Member

@haampie haampie Mar 23, 2023

Choose a reason for hiding this comment

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

Do we really need all this complexity? Is this still necessary when @y gets parsed as VersionRange(y, y) and @=y as Version(y). imho this looks very messy

return False
is_git = lambda v: isinstance(v, spack.version.GitVersion)
if is_git(self.version) != is_git(other.version):
# GitVersion(hash=x) and Version(y) compare equal if x == y, but
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do they compare equal in the first place if they're different things.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Mar 23, 2023

I think this broke develop somehow, as it was tested sometimes ago 😓 https://github.com/spack/spack/actions/runs/4498754677/jobs/7915852590

haampie added a commit that referenced this pull request Mar 23, 2023
alalazo pushed a commit that referenced this pull request Mar 23, 2023
tgamblin added a commit that referenced this pull request Mar 23, 2023
tgamblin pushed a commit that referenced this pull request Mar 23, 2023
* Specs that define 'new' versions in the require: section need to generate
  associated facts to indicate that those versions are valid.

* add test to verify success with unknown versions.
scheibelp added a commit to scheibelp/spack that referenced this pull request Mar 23, 2023
tgamblin added a commit that referenced this pull request Mar 28, 2023
- [x] Specs that define 'new' versions in the require: section need to generate associated facts to indicate that those versions are valid.
- [x] add test to verify success with unknown versions.
- [x] remove unneeded check that was leading to extra complexity and test
      failures (at this point, all `hash=version` does not require listing out that version
      in `packages.yaml`)
- [x] unique index for origin (dont reuse 0)

Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov>
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 documentation Improvements or additions to documentation tests General test capability(ies) versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants