arduino-ide icon indicating copy to clipboard operation
arduino-ide copied to clipboard

No automatic update to latest RC on nightly builds

Open Lorandil opened this issue 3 years ago • 1 comments

Describe the request

To confirm a problem I had to swap to the nightly builds on my tinker PC. Yesterday I was offered an update to RC9.2 on my other PC, but not on the tinker PC with a nightly build that was older than RC9.2.

I would expect to be offered the newer release even when I'm on a nightly version.

Describe the current behavior

Install a nightly build (I used 20220806) prior to RC9.2, no auto update will happen, even after manual checking for updates.

Arduino IDE version

Arduino IDE 2.0.0-rc9.1 nightly

Operating system

Windows

Operating system version

10 21H2

Additional context

No response

Issue checklist

  • [X] I searched for previous requests in the issue tracker
  • [X] I verified the feature was still missing when using the latest nightly build
  • [X] My request contains all necessary details

Lorandil avatar Aug 11 '22 19:08 Lorandil

Thanks for your report @Lorandil. I investigated and discovered the cause of the bug is that the format of the nightly build versions causes them to be considered higher than the release versions according to semver:

https://semver.org/#spec-item-11

  1. Precedence for two pre-release versions with the same major, minor, and patch version MUST be determined by comparing each dot separated identifier from left to right until a difference is found as follows:

Identifiers consisting of only digits are compared numerically.

Numeric identifiers always have lower precedence than non-numeric identifiers.

A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal.

This means that even though the following example set of versions were released in this chronological order (ascending):

  1. 2.0.0-rc8-nightly-20220718
  2. 2.0.0-rc9
  3. 2.0.0-rc9-nightly-20220722
  4. 2.0.0-rc9.1
  5. 2.0.0-rc9.1-nightly-20220804
  6. 2.0.0-rc9.2

They have this precedence (ascending):

  1. 2.0.0-rc8-nightly-20220718
  2. 2.0.0-rc9
  3. 2.0.0-rc9.1
  4. 2.0.0-rc9.2
  5. 2.0.0-rc9.1-nightly-20220804
  6. 2.0.0-rc9-nightly-20220722

Since the comparison is based on each dot separated field, the solution will be to use a . instead of - to separate the "nightly" and snapshot build identifiers:

  1. 2.0.0-rc9.2
  2. 2.0.0-rc9.2.nightly-20220814
  3. 2.0.0-rc9.3

per1234 avatar Aug 12 '22 04:08 per1234