Giter VIP home page Giter VIP logo

Comments (7)

ferd avatar ferd commented on August 16, 2024 1

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.

from erlware_commons.

tsloughter avatar tsloughter commented on August 16, 2024

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 ec_semver but would want to also notify the hex project.

from erlware_commons.

limeytexan avatar limeytexan commented on August 16, 2024

From my reading of the spec, a semantic version of 0.7.0-vendored-xhttp is valid because the "pre-release identifier" part (in this example, vendored-xhttp) is allowed to contain hyphens. I agree that hex is responsible for enforcing valid semantic version strings, but in this case I don't believe it's wrong to be accepting semantic versions like this one.

Many thanks for the quick response!

from erlware_commons.

paulo-ferraz-oliveira avatar paulo-ferraz-oliveira commented on August 16, 2024

Regarding this, do we want to import verl, or find some such similar solution?

from erlware_commons.

paulo-ferraz-oliveira avatar paulo-ferraz-oliveira commented on August 16, 2024

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.

from erlware_commons.

leeyisoft avatar leeyisoft commented on August 16, 2024

I am running well under erlware_commons v1.6.0

([email protected])2> ec_semver:parse(<<"0.7.0-vendored-xhttp">>).
{{0,7,0},{[<<"vendored-xhttp">>],[]}}

from erlware_commons.

ariel-anieli avatar ariel-anieli commented on August 16, 2024

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:

7> ec_semver:parse(<<"0.7.0-vendored-xhttp">>).
{<<"0.7.0-vendored-xhttp">>,{[],[]}}

I've found that simply changing <<"[A-Za-z0-9]">> to <<"[A-Za-z0-9-]">> in src/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.

@limeytexan, from what I see, 4e3b177 fixed the issue:
In 1.7.0, the example you proposed is correctly parsed:

8> ec_semver:parse(<<"0.7.0-vendored-xhttp">>).
{{0,7,0},{[<<"vendored-xhttp">>],[]}}
9> ec_file:md5sum(ec_semver:module_info(md5)).
"b4f8e531a6a10f0a83d655bf991c921e"

from erlware_commons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.