question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Use numerical version comparison in range resolver as long as version string is in the format a.b.c(.d.e)

See original GitHub issue

We tried to use four-digit version numbers and resolve them with version range expressions. The handling of these (non-semver-compliant) version strings seems to be inconsistent in Conan. With Conan on Linux we observed that a version 3.8.0.1 is considered newer than a 3.8.0.0 when resolving the range [*]. Trying the same on Windows resolves always to 3.8.0.0. There were also reports that for some users it would yield unexpected results on Linux as well, but I haven’t confirmed that yet.

I think it would be beneficial if someone could look into this and rework the range resolver so that strictly numerical versions in the form a.b.c(.d.e…) still behave according to semver as far as the first three digits are concerned. Any extra digits (.d.e…) should be semantically equivalent to the patch version and compared numerically up to the first - or +. What do you think?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
peterwaller-armcommented, Apr 30, 2020

We’re using node-semver==0.8.0 in prod, haven’t encountered an issue with it. Upgrade appreciated!

1reaction
peterwaller-armcommented, Feb 27, 2020

This has landed on node-semver 0.8.0. Here is the upstream issue where it is resolved. Very little has changed in node-semver since 0.6.1, which conan specifies as an exact dependency:

https://github.com/conan-io/conan/blob/bd5920a40d9707001b31966adb0dfa7d6af00eea/conans/requirements.txt#L9

Please can someone update the dependency to >=0.8.0? I would have sent a pull request but unfortunately I would have to seek approval to do so, so it would take a while.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compare two Version numbers - GeeksforGeeks
A version number looks like a.b.c.d, where a, b, etc are numbers, so the version number is a string in which numbers are...
Read more >
Compare Version Numbers - LeetCode
To compare version numbers, compare their revisions in left-to-right order. Revisions are compared using their integer value ignoring any leading zeros. This ...
Read more >
How do you compare two version Strings in Java?
I'm currently using something similar to the following: String version = "1.1.2".replace(".", ""); int number = Integer.parseInt(version); // = 112 .
Read more >
Legacy SQL Functions and Operators | BigQuery - Google Cloud
Returns the exact number of non-NULL, distinct values for the specified field. FIRST(), Returns the first sequential value in the scope of the...
Read more >
compare-versions - npm
Compare semver version strings to find greater, equal or lesser. Runs in the browser as well as Node.js/React Native etc. Has no dependencies ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found