Skip to content
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

Treat tilde versions as higher for purpose of dependency comparison #715

Closed
ignatenkobrain opened this issue May 26, 2019 · 9 comments
Closed

Comments

@ignatenkobrain
Copy link
Contributor

In Rust packaging we've found issue that we have Requires: (foo >= 1.0.0 with foo < 2.0.0) and package with version 2.0.0~alpha is actually is matching this range. I think it should be treated for dependency check purpose.

/cc @ffesti

@pmatilai
Copy link
Member

Err, no. If its sorts lower than 2.0.0 then it must match the < 2.0.0 dependency, anything else would be a mess that nobody will understand.

How exactly is this a problem for you?

@pmatilai
Copy link
Member

To rephrase a bit, I can see why you'd sometimes want 2.0.0~alpha to be considered 2.0.0, but also that in other cases not, and rpm cannot magically know which one you want for a particular case. It'd be nice if there was a way to explicitly express both cases.

This sort of reminds me of this (otherwise unrelated) case: http://lists.rpm.org/pipermail/rpm-maint/2010-November/002948.html

@ffesti
Copy link
Contributor

ffesti commented May 28, 2019

I guess there is no real way around using Requires: (foo >= 1.0.0 with foo < 2.0.0~). Yes, this is kinda annoying.

@ignatenkobrain
Copy link
Contributor Author

@pmatilai yeah, this is somewhat similar. Unfortunately I don't know how we could nicely express both.

@ffesti yeah, the only problem is that semver.org says you can have versions like 2.0.0----beta which would be translated into 2.0.0~~~~beta in RPM. Not saying it is horrible or people should be doing this, but this case is valid. Also this tilde at the end looks not really nice :/ Especially if people would have to read this in their error messages.

@pmatilai
Copy link
Member

pmatilai commented Jun 3, 2019

So what's the actual use-case here? Converting upstream dependency tracking data to rpm?

@ignatenkobrain
Copy link
Contributor Author

For this specific one is to be used in %autosetup and some more places in spec. Because default %name-%version doesn't work for pre-release packages.

@ignatenkobrain
Copy link
Contributor Author

whoops, wrong ticlket. For this one is yes -- converting upstream dependency data into the RPM one... which works fine except for this small thingy.

@jasontibbitts
Copy link

jasontibbitts commented Aug 7, 2019

Since what you really want is a significantly different total ordering, you really need a different set of binary relations. I certainly don't want to be the one to propose <~, <=~, >~, and >=~. Plus, for completeness, I guess you'd need a comparison operator =~. That would all be... horrible.
Personally I'd take the 99% solution and use the with foo < 2.0.0~ syntax; if the set of cases where we care ever overlaps the set of cases where someone uses the multiple tilde thing then someone will just have to handle the case by hand.

@ffesti
Copy link
Contributor

ffesti commented Mar 4, 2020

As pointed out by @jasontibbitts we really don't want to go down this rabbit whole. I am closing this - even if this is not great. Sorry!

@ffesti ffesti closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants