`ddev_version_constraint` provides incorrect result: `> 1.24.4` is true for `1.24.4` · Issue #7266 · ddev/ddev · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So > 1.24.4 becomes > 1.24.4-0 and a full release (1.24.4) is actually higher.
I played a bit with the code but I really couldn't come up with a solution I like. Furthermore, now that I looked into this, I don't like the normalization at all, specially as the constraint can really really complex, so just appending -0 might not work for all cases. We did it because of dev versions (IIRC). I wonder if we should simply exclude this and let the user add pre-releases to the constraints when needed.
i.e.
This is a command I am using to work around this: ddev debug match-constraint "> 1.24.4-0 <= 1.24.4-zzzzzz || > 1.24.4" which is rather odd.
Ideally, I'd expect that > 1.24.4 would work for regular versions and also accept something like 1.24.5-44
The current version on dev using the git tags gives you 1.24.4-commits-hash-dirty which, evenmore for the semver library, is just wrong because it only uses the last part of the dash as pre-release.
I don't have a solution so far. I am inclined to remove any normalization and let the user define the constraints, if not we might have to look for another semver library.
The text was updated successfully, but these errors were encountered:
Nice work. I thought the -alpha0 suffix was good enough all those years :)
stasadev
changed the title
Small issue with ddev version constraints, > 1.24.4 is true for 1.2.4
Small issue with ddev version constraints, > 1.24.4 is true for 1.24.4May 6, 2025
rfay
changed the title
Small issue with ddev version constraints, > 1.24.4 is true for 1.24.4ddev_version_constraint provides incorrect result: > 1.24.4 is true for 1.24.4May 6, 2025
This relates to how and why we added pre-releases as part of the code:
ddev/pkg/ddevapp/utils.go
Lines 551 to 555 in c5ad791
So
> 1.24.4
becomes> 1.24.4-0
and a full release (1.24.4) is actually higher.I played a bit with the code but I really couldn't come up with a solution I like. Furthermore, now that I looked into this, I don't like the normalization at all, specially as the constraint can really really complex, so just appending
-0
might not work for all cases. We did it because of dev versions (IIRC). I wonder if we should simply exclude this and let the user add pre-releases to the constraints when needed.i.e.
This is a command I am using to work around this:
ddev debug match-constraint "> 1.24.4-0 <= 1.24.4-zzzzzz || > 1.24.4"
which is rather odd.Ideally, I'd expect that > 1.24.4 would work for regular versions and also accept something like 1.24.5-44
The current version on dev using the git tags gives you 1.24.4-commits-hash-dirty which, evenmore for the semver library, is just wrong because it only uses the last part of the dash as pre-release.
I don't have a solution so far. I am inclined to remove any normalization and let the user define the constraints, if not we might have to look for another semver library.
The text was updated successfully, but these errors were encountered: