-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Split satisfies(..., strict=True/False) into two functions
#35681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
haampie
merged 41 commits into
spack:develop
from
alalazo:refactor/split_satisfies_intersects
Mar 8, 2023
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
75a5546
Add a regression test
alalazo 5d3e306
Fix wrong behavior with conditional provider and satisfies
alalazo 8190f93
__contains__ use strict=True
alalazo 45c00b7
ArchSpec.satisfies: remove default value to "strict" argument
alalazo 164ca8b
Spec.satisfies: split the function on the `strict=` value
alalazo d46b002
Version*.satisfies: split the function on the `strict=` value
alalazo 832191b
CompilerSpec.satisfies: split the function on the `strict=` value
alalazo 7f1b36b
FlagMap.satisfies: split the function on the `strict=` value
alalazo a0f83c4
ArchSpec.satisfies: split the function on the `strict=` value
alalazo 5633feb
VariantMap.satisfies: split the function on the `strict=` value
alalazo 29fa842
Change name everywhere from "placeholder_satisfies" -> "satisfies"
alalazo e6e5d20
Fix failing unit tests
alalazo 6444bd4
Mark 2 unit tests for later todo
alalazo 4361e8b
ArchSpec: add unit tests for intersects, satisfies and constrain
alalazo 73c4bdd
CompilerSpec: add unit tests for intersects, satisfies and constrain
alalazo d6cf0fe
FlagMap: add unit tests
alalazo cf9f813
Fixed an issue with symmetry of VariantMap.intersects
alalazo acec6e6
Fixup old solver
alalazo 3f04ec7
Take care of a few FIXMEs
alalazo 3f1f8ca
Remove non-commutative behavior in Spec._intersects_dependencies
alalazo 124fa6c
Fix package audits and spack info
alalazo 8691f2b
Fix failing tests for git commits
alalazo 0aeaa35
Make Spec.intersects commutative
alalazo 76d4ef9
version.py: clarify a few implementations, add tests
alalazo bebaf82
variant.py: switch implementation from compatible -> intersects
alalazo a1c1ece
for_package_version: add comment and safety belt
alalazo 964b06e
macsio: change default variant to avoid build issues
alalazo 984f6b3
Rename constrain_or_raise -> check_can_constrain
alalazo 01a515c
Refactor check_can_constrain(..., concrete=False) into a parametrized…
alalazo a2a9167
Constraining an abstract spec by a concrete one makes the first concr…
alalazo cdbf559
Add a unit test for abstract specs that do not intersect
alalazo 3466bd2
Add a unit test for concrete specs that do not satisfy abstract specs
alalazo 8404391
Remove check_constrain, add the tests back as parameters
alalazo 41a860d
Remove check_invalid_constrain, add the tests back as parameters
alalazo 9a90d9f
Add parametrized tests to check is a constraint changes a spec or not
alalazo 3b89375
Fix semantic of variant intersection
alalazo 3a5b534
Fix flags semantic
alalazo de9e674
Remove outdated comment
alalazo 9e97a44
Simplify version satisfies
alalazo 00f68d9
Add a comment clarifying invariant when entering a function
alalazo cf3a79a
Inline Spec._satisfies_dependency
alalazo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow this, can you at least add a comment as to why this is mutating
pkg.spec? Looks a bit unexpected...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is the following. When we initialize a
Specjust by name we do:spack/lib/spack/spack/spec.py
Line 1265 in 18e0b89
There are contexts in which we want to extrapolate a version
urlfrom an abstract spec with just the name. Sometimes this means callingurl_for_version, which has an unfortunate API:spack/var/spack/repos/builtin/packages/cddlib/package.py
Lines 24 to 29 in 18e0b89
where we pass the version as a string. Thus for any comparison we relied on
satisfies(..., strict=False)i.e. the currentintersects.I think we don't want to have changes in packages to fit an implementation of extrapolation that can be improved later, and
satisfiesgives the same result asintersectsfor concrete specs. Thus, in contexts where we call this function with an abstract spec I currently hack the version to make it satisfy the correct branch inurl_for_version.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment and an assert (for safety) in a1c1ece