[GH-ISSUE #255] Fixed width version part alternative to spec. #6169

Closed
opened 2026-06-17 04:48:13 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @travis-a-hoffman on GitHub (May 19, 2015).
Original GitHub issue: https://github.com/semver/semver/issues/255

Where I work, and for many, tomcat is used to serve up wars. Traditionally, wars are named: foo-max.min.build.war. Unfortunately, Tomcat does alphabetic comparison to evaluate when to replace a war. In this case, version foo-1.2.9.war is evaluated as being a version after foo-1.2.10.war, and thus tomcat won't automatically do the update.

The workaround we've found to be simplest and most inline with Semantic Versioning is to use fixed width fields, such as 1.02.0009, or 1.002.009 to delay (and make less likely) the decimal overflow of an individual field. It's not ideal, but it works for this situation. It would be nice to make this an optional or variation of the spec.

Originally created by @travis-a-hoffman on GitHub (May 19, 2015). Original GitHub issue: https://github.com/semver/semver/issues/255 Where I work, and for many, tomcat is used to serve up wars. Traditionally, wars are named: foo-max.min.build.war. Unfortunately, Tomcat does alphabetic comparison to evaluate when to replace a war. In this case, version foo-1.2.9.war is evaluated as being a version after foo-1.2.10.war, and thus tomcat won't automatically do the update. The workaround we've found to be simplest and most inline with Semantic Versioning is to use fixed width fields, such as 1.02.0009, or 1.002.009 to delay (and make less likely) the decimal overflow of an individual field. It's not ideal, but it works for this situation. It would be nice to make this an optional or variation of the spec.
GiteaMirror added the questionstaledwon't fix labels 2026-06-17 04:48:13 -05:00
Author
Owner

@FichteFoll commented on GitHub (May 20, 2015):

Imo this takes away some of the uniformity of semvers. A stricter standard is usually the better option unless flexibility is required by many. Most programming languages don't allow for numeric literals with leading zeros either.

BTW, I thin this was explicitly added after 2.0.0-rc.2

<!-- gh-comment-id:103781613 --> @FichteFoll commented on GitHub (May 20, 2015): Imo this takes away some of the uniformity of semvers. A stricter standard is usually the better option unless flexibility is required by many. Most programming languages don't allow for numeric literals with leading zeros either. BTW, I thin this was explicitly added after 2.0.0-rc.2
Author
Owner

@rlidwka commented on GitHub (May 20, 2015):

I think semver should define the meaning of those numbers, not an actual format. So I would still consider 1.02.0009 a semver, and even I.II.IX is as long as release policy is appropriate.

<!-- gh-comment-id:103968052 --> @rlidwka commented on GitHub (May 20, 2015): I think semver should define the _meaning_ of those numbers, not an actual format. So I would still consider `1.02.0009` a semver, and even `I.II.IX` is as long as release policy is appropriate.
Author
Owner

@travis-a-hoffman commented on GitHub (Jul 20, 2015):

Thanks for the feedback, I think I understand a bit more about semver. I might humbly suggest a clarifying note as an attachment to, but not part of, the spec explaining how to approach these sorts of variations while keeping with the spirit/vision of semver.

<!-- gh-comment-id:122942525 --> @travis-a-hoffman commented on GitHub (Jul 20, 2015): Thanks for the feedback, I think I understand a bit more about semver. I might humbly suggest a clarifying note as an attachment to, but not part of, the spec explaining how to approach these sorts of variations while keeping with the spirit/vision of semver.
Author
Owner

@FichteFoll commented on GitHub (Jul 20, 2015):

@rlidwka unfortunately, that would complicate parsing a lot, and unnecessarily. Most people are using 0x30 to 0x39 as decimal digits anyway, and allowing leading zeroes raises the question whether 9 and 000009 are equal or unequal.
It has a unique answer for pre-release and metadata identifiers (where "9" is greater than "00...0009" because 9 has a higher character order), but not the one you would expect when comparing 9 against 010.

<!-- gh-comment-id:122964611 --> @FichteFoll commented on GitHub (Jul 20, 2015): @rlidwka unfortunately, that would complicate parsing a lot, and unnecessarily. Most people are using 0x30 to 0x39 as decimal digits anyway, and allowing leading zeroes raises the question whether `9` and `000009` are equal or unequal. It has a unique answer for pre-release and metadata identifiers (where `"9"` is greater than `"00...0009"` because `9` has a higher character order), but not the one you would expect when comparing `9` against `010`.
Author
Owner

@jwdonahue commented on GitHub (Dec 8, 2017):

@travis-a-hoffman, how you map SemVer strings to/from other formats is a tool design issue and out of scope for SemVer. Unless you have further questions, comments or intend to issue a PR for this, please close this issue.

<!-- gh-comment-id:350173375 --> @jwdonahue commented on GitHub (Dec 8, 2017): @travis-a-hoffman, how you map SemVer strings to/from other formats is a tool design issue and out of scope for SemVer. Unless you have further questions, comments or intend to issue a PR for this, please close this issue.
Author
Owner

@alexandrtovmach commented on GitHub (Jun 10, 2020):

This issue looks staled and will be closed in 10 days if there are no objections. Thanks everyone for contributions, you're amazing 🎆

<!-- gh-comment-id:642140890 --> @alexandrtovmach commented on GitHub (Jun 10, 2020): This issue looks staled and will be closed in 10 days if there are no objections. Thanks everyone for contributions, you're amazing :fireworks:
Author
Owner

@alexandrtovmach commented on GitHub (Jun 19, 2020):

👻 👻 👻
Closed as staled

<!-- gh-comment-id:646831399 --> @alexandrtovmach commented on GitHub (Jun 19, 2020): 👻 👻 👻 Closed as staled
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#6169