Hello,
recently I've created a new golang library and released it with pre-release
version first to catch any bugs before doing proper 1.0.0 release.
The pre-release version was called 1.0.0-pre-release+1 , which according
to
https://semver.org/ should be completely legal semver. If I read the
grammar correctly, it should fall under
<version core> "-" <pre-release> "+" <build>
with
<version core> being 1.0.0, which is obviously correct.
<pre-release> being pre-release, which should be ok
from this chain
<pre-release> ::= <dot-separated pre-release identifiers>
<dot-separated pre-release identifiers> ::=
<pre-release identifier>
| <pre-release identifier> "." <dot-separated pre-release identifiers>
<pre-release identifier> ::= <alphanumeric identifier>
| <numeric identifier>
<alphanumeric identifier> ::= <non-digit>
| <non-digit> <identifier characters>
| <identifier characters> <non-digit>
| <identifier characters> <non-digit> <identifier characters>
<identifier characters> ::= <identifier character>
| <identifier character> <identifier characters>
<identifier character> ::= <digit>
| <non-digit>
<non-digit> ::= <letter>
| "-"
so again, since all characters in pre-release fit into <non-digit>, that should
be ok as well.
<build> being 1 seems again obviously correct from
<build identifier> ::= <alphanumeric identifier> | <digits>
And despite the version being correct semver, it was mangled into pseudo-version
v1.0.0-pre-release.0.20200420093620-87861123c523. However, to quote from
https://github.com/golang/go/wiki/Modules#can-a-module-consume-a-package-that-has-not-opted-in-to-modules> If the repository does not have any valid semver tags, then the repository's
> version will be recorded with a "pseudo-version" such as
> v0.0.0-20171006230638-a6e239ea1c69
I see basically 3 possibilites here:
1. Documentation is incorrect since only *subset* of semver is actually
supported.
2. There is bug somewhere in the semver parsing causing my version not to be
considered correct.
3. I cannot read Backus-Naur and my version is *not* correct semver.
Is there something else I did miss in this analysis?
W.