package: fix extension query predicate#5600
Conversation
|
Thanks! I'll get a chance to look at this in an hour or so |
| return False | ||
| s = self.extendee_spec | ||
| return s and s.satisfies(spec) | ||
| return s and spec.satisfies(s) |
There was a problem hiding this comment.
This is called with strict=False implicitly so I'm surprised that the order matters. Is there an issue referring to the problem that comes up for s.satisfies(spec)?
There was a problem hiding this comment.
My initial thought here is that if we have some spec X and want to know if we extend it, our extendee E should probably satisfy it. I'd be curious to know the case where it doesn't.
There was a problem hiding this comment.
I found this when trying to write a test for the fsview extensions. When querying with spack extensions [email protected], I got nothing. Switching this around got me the list I expected.
There was a problem hiding this comment.
Also, this makes more sense in the sense that it now says "if the spec you asked to list extensions for satisfies the spec given in this package, this package extends the spec you gave". The other way reads backwards. Or is the method itself backwards?
|
After looking into this IMO it would be more suitable to change the When calling
For some reason, right now on phase 1, spack is querying for an installed spec to find out all possible packages which could extend the specified package. All it needs for that is the package name (e.g. I should say that while the change in this PR wouldn't cause any bugs, it is counterintuitive because it is somewhat conflicting with the rest of the logic in Does that seem sensible (or raise questions)? Are there other issues coming up that this change would help with? |
|
The augmented arguments for |
I expect this is historical. The problem is that I have two Pythons installed,
Well, currently it returns |
To be clear, are they also activated? Right now the logic should only pick up activated extensions. This is another confusing aspect of |
|
I fixed that part in #5415 as well; it now reports installed extensions as well. And yes, even if they're activated, they're not detected unless this patch is applied. |
I'll pull your branch and check it out. |
|
At the moment I'm having trouble replicating this error with your branch: e.g. EDIT: to be clear I meant to say that #5415 appears to be working using |
|
Oh, so this happens: So the "available packages" query doesn't work and then bails early thinking "well, there couldn't possibly be any installations which match". |
|
Even with my other PR, this seems to be necessary. Why, if I request the extensions of a certain version of a package, does the list of available extensions return nothing, but I have some installed? The commit in #5415 makes it so you can skip the "oh, there's no possible package that extends it, there couldn't possibly be any installed" logic, but the underlying problem still exists. |
IMO the method
At the moment (i.e. without the changes in this PR) Does that seem sensible? |
How? It takes a single argument.
That doesn't seem right. Packages could say they extend only
Maybe for
|
|
Evidence that the assert spec['libdwarf'].compiler.satisfies('clang')The argument I give the |
|
OK after thinking on it more I think the order you have set here is fine (and e.g. handles the
IMO that is worthwhile because this is called in a few contexts and some of the callers (e.g. |
|
c02d42f to
c049d74
Compare
I think it would be accurate to change the text to "if Regarding the added method description:
|
Hmm. |
c049d74 to
9780571
Compare
|
Oddly this is now failing the flake checks on account of bare |
This is now merged and I think if I close & reopen this it will test with this rebased on develop so I'm going to start that. |
|
OK really sorry but I thought about this more and the method description still isn't 100% accurate (which is my fault because I suggested it). So the following is precise:
This is slightly different from the method description added in this PR because it won't report whether the package could extend a given spec if the spec associated with the package is concrete. The intuitive meaning of could extend is that if the given spec is not concrete, the package could extend it as long as no details of the package's associated spec conflict with it. In this PR, if the package is concrete but the given spec is not, it will always report While the implementation in this PR is suitable for all the cases where Does that make sense and seem agreeable? Another option is to update the method description for |
|
Yes, a less-confusing set of methods would be nice. However, I think that stems from There's also the issue that all of this is working only on the first extendee declaration in the package (see the implementation of |
The satisfies query was backwards. The input spec need to satisfy the extends spec for this to be true.
9780571 to
6cfaf6a
Compare
The satisfies query was backwards. The input spec need to satisfy the
extends spec for this to be true.