-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ec_semver:parse() incorrectly parsing "pre-release identifier" containing hyphen #144
Comments
First, is this a bug in hex as well? Should it not be accepting versions like that (it is supposed to enforce semver format)? Either way we need to support this in |
From my reading of the spec, a semantic version of Many thanks for the quick response! |
Regarding this, do we want to import |
We'd need to eventually import verl, but the library is gonna need patches to fit along with rebar3 as well. I've just been working on other side projects rather than supporting this unfortunately. |
Let me know if I can help. You can probably describe 2 or 3 things that are necessary and I'd try to find time to tackle them. |
I am running well under erlware_commons v1.6.0
|
@limeytexan, from what I see, 4e3b177 fixed the issue: 8> ec_semver:parse(<<"0.7.0-vendored-xhttp">>).
{{0,7,0},{[<<"vendored-xhttp">>],[]}}
9> ec_file:md5sum(ec_semver:module_info(md5)).
"b4f8e531a6a10f0a83d655bf991c921e" |
https://semver.org contains the following statement regarding the semantic version spec for "pre-release identifiers":
Notably, ec_semver:parse() correctly parses all four of the above examples:
However, a few [hex] packages contain hyphens in the "pre-release identifer" portion of the semantic version, e.g. https://hex.pm/packages/xclient/0.7.0-vendored-xhttp, and this breaks the parser:
I've found that simply changing
<<"[A-Za-z0-9]">>
to<<"[A-Za-z0-9-]">>
insrc/ec_semver_parser.erl
seems to address the problem, although I haven't reviewed the code sufficiently to say that this is the most appropriate fix.The text was updated successfully, but these errors were encountered: