Don't change properties on already-installed packages#5580
Don't change properties on already-installed packages#5580tgamblin merged 6 commits intospack:developfrom
Conversation
…operties on already-installed specs
tgamblin
left a comment
There was a problem hiding this comment.
@scheibelp: this looks good, though I think it should avoid modifying concrete specs even if they are not installed. Is there a reason that's needed?
lib/spack/spack/spec.py
Outdated
| if self.name in visited: | ||
| return False | ||
|
|
||
| if self.concrete and self.package.installed: |
There was a problem hiding this comment.
I think it is sufficient and more correct in all of these cases to just check self.concrete. If the spec is concrete, we shouldn't change it, even if it's not installed. This should also be safe to do, since we only mark things concrete at the end of concretize now (since #5332 was merged)
…nt also need to check if the package is installed
Most of my checks didn't need this. But the |
|
@scheibelp Have you seen whether this interacts nicely with #4939? I can try to merge the two and test if you don't have time to. |
@becker33 it shouldn't conflict but there may be some redundancy between the two: in particular this PR doing a check in |
@tgamblin I changed it everywhere except in |
|
@scheibelp: looks good to me. I think it would be good if we could get rid of
|
I can do that - I'll aim for having that ready around 5pm. That being said
This should still report conflicts for incompatible dependencies. It still descends everywhere and e.g. constrains deps. The only case where it doesn't descend is if the dependency to merge doesn't exist in spec_deps and the given spec is concrete. That only happens when the dependency is a build dependency that was stripped of the spec when it was read from the install directory. |
Perfect. Can you ensure that the test checks the cases above? I think we should be good then. |
I'm going to be later than I hoped but still hopefully have tests for this tonight |
…'t actually break the test other than to print out a confusing error message)
... with a conflicting constraint (version, variant, etc.). |
…s a dependency constraint which conflicts with a requested installed dependency
@tgamblin @becker33
Fixes: #5565
This includes a number of edits to address issues where spack concretization attempts to set properties on already-installed specs. This is a WIP at the moment since I haven't thought all the changes through, but I can replicate #5565 and this appears to resolve it.
_concretize_helperon already-concretized packages (which can add variants for example) - this may not strictly be an issue in py-regex SHA-1 Collision #5565 but came up in my debugging. EDIT: this likely shares some logic with Flags and hashes #4939