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

lit install - No such package #143

Open ghost opened 8 years ago

ghost commented 8 years ago

lit install fails, if dependencies contains a package that was not yet published, but is available in deps/:

$ cat package.lua 
return {
  ...
  dependencies = {
    ...
    "urzds/date",
  }
}
$ ls deps
date.lua
$ lit install
lit version: 2.2.16
luvi version: v2.4.0
command: install
load config: .../.litconfig
connecting: wss://lit.luvit.io/
fail: [string "bundle:libs/calculate-deps.lua"]:75: No such package: urzds/date
stack traceback:
        [C]: in function 'error'
        [string "bundle:libs/calculate-deps.lua"]:75: in function 'addDep'
        [string "bundle:libs/calculate-deps.lua"]:49: in function 'processDeps'
        [string "bundle:libs/calculate-deps.lua"]:92: in function 'calculateDeps'
        [string "bundle:libs/core.lua"]:513: in function 'installDeps'
        [string "bundle:/commands/install.lua"]:5: in function 'fn'
        [string "bundle:deps/require.lua"]:293: in function 'require'
        [string "bundle:main.lua"]:50: in function <[string "bundle:main.lua"]:38>
        [C]: in function 'xpcall'
        [string "bundle:main.lua"]:38: in function <[string "bundle:main.lua"]:31>

This seems to contradict the docs:

To install your dependencies, simply run lit install and it will grab any missing dependencies from package.lua and install them to deps. This will not touch any existing packages in deps.

I would expect that lit first looks into deps/, before trying to download from http://lit.luvit.io/.

creationix commented 8 years ago

I know that it will use the local version instead of what's in the upstream server. Perhaps this is an edge case for unpublished packages. I'll see what I can do to fix it when I'm back at work.

My guess is it's unconditionally checking upstream for the latest version even though there is a local version that it will ultimately use.