luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

Cannot install older version of coro-http #201

Closed SinisterRectus closed 7 years ago

SinisterRectus commented 7 years ago

Attempting to install version 2.1.1 of coro-http installs 2.2.0 instead:

sinister@ubuntu:~/new$ rm -rf deps
sinister@ubuntu:~/new$ ./lit install creationix/coro-http@2.1.1
lit version: 3.5.2
luvi version: v2.7.6
command: install creationix/coro-http@2.1.1
load config: /home/sinister/.litconfig
connecting: wss://lit.luvit.io/
including dependency: coro-channel (3.0.0)
including dependency: coro-http (2.2.0)
including dependency: coro-net (3.0.0)
including dependency: coro-wrapper (3.0.0)
including dependency: http-codec (3.0.1)
installing package: creationix/coro-wrapper@v3.0.0
installing package: creationix/coro-channel@v3.0.0
installing package: creationix/coro-http@v2.2.0
installing package: creationix/coro-net@v3.0.0
installing package: luvit/http-codec@v3.0.1
done: success

For comparison, I can install version 2.2.1 of coro-channel instead of 3.0.0:

sinister@ubuntu:~/new$ rm -rf deps
sinister@ubuntu:~/new$ ./lit install creationix/coro-channel@2.2.1
lit version: 3.5.2
luvi version: v2.7.6
command: install creationix/coro-channel@2.2.1
load config: /home/sinister/.litconfig
connecting: wss://lit.luvit.io/
including dependency: coro-channel (2.2.1)
installing package: creationix/coro-channel@v2.2.1
done: success
squeek502 commented 7 years ago

I believe this is a result of the SemVer matching algorithm used. Doesn't seem ideal for this scenario.

Relevant code from deps/semver.lua:

-- Given a semver string in the format a.b.c, and a list of versions in the
-- same format, return the newest version that is compatable.
-- ...
-- For x.y.z-b, match minor, patch, and build updates

assert(match("1.0.0", iterator()) == "1.1.3")
creationix commented 7 years ago

Yes, the matching is working as designed. I'm really sorry this broke. Seems the best path forward is to fix coro-http and publish a new patch version asap.

SinisterRectus commented 7 years ago

Closing this in favor of #200.