[Bug Fix] Issues with non-numeric versions, as well as preferred=True#1561
Conversation
…n in packages.yaml (spack#1556)
…ter than non-numeric versions; and non-numeric versions are sorted alphabetically. This is a) simple b) ensures that non-numeric versions (such as 'develop') in package.py are not chosen ahead of numeric versions, when nothing is specified in packages.yaml Fixes Issue spack#1557
|
I just added a fix for #1557 to this PR. The two bugs fixed are somewhat different... but they're in the same PR because the fixes for them affect the same area of code. |
|
@adamjstewart @davydden @tgamblin @alalazo Looking for review here... One goal here is to do away with special cases inside of Spack for I've concluded that one grand Version comparison to rule them all is not really appropriate for us (because the correct version to choose in Some documentation changes will be required for this PR (just a short paragraph). Since this PR touches some possibly controversial issues, I'd like to hold off on docs until we all like what we see. |
|
One problem here is, what happens when a system-supplied version does not exist in Spack? For example... I'm unable to build Python2 for some unknown reason. But I have a system-installed Python2. And I CAN (and need to) build Python3. So I've put in Now consider: There are workarounds to this, of course. But do you think we should extend the concretization code to look for versions specified in the |
| return False | ||
|
|
||
| # dev is __gt__ than anything but itself. | ||
| if other.string == 'develop': |
There was a problem hiding this comment.
please keep it, it is need to have a proper way to install the current version of the package from VCS.
disagree. As stated previously p.s. |
|
Denis, I see we did collectively agree on HOWEVER... the code checking for Therefore, I am suggesting (below) ways to maintain what we agreed on in Also, thinking it through again... what if I have more than one branches, Putting it all together, I'm suggesting the following code changes:
Any thoughts? |
I am fine with any solution which keep the unit tests in #1190 working: (current state of this PR breaks these tests).
Makes perfect sense to me, although i most likely won't be using it myself.
That also make sense to me. |
Thinking it through again, why do we need this? If develop>numeric, and develop versions aren't to be released to users, that means we can't merge any packages with a @develop version in them. The workflow then becomes:
Sounds like a pain to me. How about an alternative workflow, based on the simpler idea that numeric versions are always greater than non-numeric versions:
Can you explain a situation where the first workflow would be preferable to the second? I just can't convince myself that this special case for develop>numeric is every really the best thing. |
|
Another thought (that might counteract what I just said above): Spack doesn't have, but really needs, fail-safe protection on trusted vs. untrusted download. A download is trusted, basically if it could be checksummed or otherwise verified. In practice, that means that tarball and Git hash downloads are trusted, whereas Git branch or tag downloads are not. By default, Spack really really should only install packages from trusted downloads. In practice, that would mean that Spack would typically ignore |
This is exactly what I would avoid by all means. Users sometimes need to compile a Here's a real life example1: Here's another example: Let us not limit the users here. Myself, with a user's hat of Spack, I use I think the confusion here was that I hope this clears things out a bit. p.s. I did minor edits to expand on examples. |
correct. The behaviour you describe is exactly how it works now in Spack. |
|
Whoah, let's go back to the beginning on this PR... As I mentioned in #1696, I think it will be best to table the discussion on The original purpose of this PR was to fix bugs that were causing not one but two serious problems ( #1556 and #1557 ). These bugs popped up as soon as I tried to use As I dug into what was going on, I discovered that the bugs were caused by a series of "hacks" applied to the logic that chooses which version to install, without anyone really thinking it through all the way. Each time a hack was applied, it probably solved problems for one specific use case; but ultimately ended up creating brittle, unpredictable code. For that reason, we can't just leave it alone. To get this right, we absolutely need clear thinking on how Spack selects which version to install; and special cases frequently work against clear thinking. I suggest the best way forward for now is to make the current PR conform to the unit tests of #1190. I don't think special cases are a good idea, or even required. But I would rather continue to argue my case on a non-buggy version of Spack. |
I never argued otherwise, as I said above
You asked
that's why I gave a few examples of when users need |
I read your examples, and can respond to them later. Long story short, once we have trusted downloads, I think I have a scheme that will serve your use cases while keeping Spack's package selection rules as simple as possible. And I think I can convince you that it works for your use cases. |
lib/spack/spack/version.py
Outdated
| system | ||
| myfavoritebranch | ||
| """ | ||
| return isinstance(self.version[0], int) |
There was a problem hiding this comment.
Just a minor issue : wouldn't
isinstance(self.version[0], numbers.Integral)
be more appropriate here ?
There was a problem hiding this comment.
|
@citibeth: can you update the docs based on this? |
|
OK, see #1933 We should get this merged today, if possible; when looking over the PR On Thu, Oct 6, 2016 at 5:35 AM, Todd Gamblin [email protected]
|
Fix bug in handling of precedence of preferred=True vs. versions given in packages.yaml (#1556)
BTW... the code to compare versions is convoluted, inefficient and bug-prone. A re-think might be in order, along the lines of this PR. Rather than making a "grand compare" function, we might be better off keeping comparisons to simple things (like versions), and then writing code like the code here to produce prioritized lists when needed.