lit icon indicating copy to clipboard operation
lit copied to clipboard

How to update all dependencies?

Open ghost opened this issue 9 years ago • 5 comments

I am unable to figure out how to update the dependencies installed for my project.

I ran:

lit update
lit sync
lit install

But lit ls still lists the same versions of all dependencies...

ghost avatar Aug 16 '16 16:08 ghost

Testing a newer luvit/require version for luvit/luvit#922 was rather rocky path. At first I ran lit update, assuming the fixed version would come through that. It did not, so I tried lit sync, which apparently does something very different. Then I tried lit install, which did not update anything. Then I deleted deps/ and ran lit install again. This time it "updated" the dependencies, but the bug was still present, despite there being an instance of luvit/[email protected] in the deps/ directory. Then I noticed that lit did not update luvit (which I installed to ~/bin, so I have it in my $PATH), and that was apparently where the actual require was coming from. So I ran lit make luvit/luvit && mv luvit ~/bin/ and finally I received the bugfix.

Is the path to updating one's dependencies documented somewhere? Is there a command that walks through all my dependencies, checks online which version is the latest and then asks me whether I want to update and does this automatically, like Leiningen with lein ancient upgrade :all :interactive? Or at least shows me which versions I could update, like lein ancient check :all?

Additionally I am unsure which version of each package will be used in the end, when I run software using luvit. Will the version bundled with luvit always take precedence? If so, could there please be a warning that the version in deps/, inside luvit and the one mentioned under dependencies in package.lua are disagreeing?

ghost avatar Aug 16 '16 17:08 ghost

lit update will attempt to update lit/luvit binaries to the latest version. ~~lit install should update local dependencies to match package.lua, but I do remember experiencing some weirdness with it.~~

Is the path to updating one's dependencies documented somewhere? Something that walks through all my dependencies, checks online which version is the latest and then asks me whether I want to update and does this automatically, like lein ancient upgrade :all :interactive? Or at least shows me which versions I could update, like lein ancient check :all?

I don't think either of these exist currently.

I ran into the same thing you're experiencing with luvit--dependencies packaged in the luvit runtime are always prioritized over local dependencies. The way around this would be to structure your library to run without the luvit runtime itself, and instead use luvi. You can see an example of what that would look like here (although that might be an outdated practice at this point). Note that luvi . would work to run main.lua without having to build it with lit beforehand.

Another possibility is to use luver, a bare-bones version of luvit without any of the dependencies included, and that uses luvit-loader (which is what lit uses) rather than luvit's require. I haven't published it to lit yet, and it's largely untested, so keep that in mind.

EDIT: Also worth looking at creationix/simple-http-server which is the type of setup that luver is meant to work with (without having to include luvit-loader.lua in every repo).

squeek502 avatar Aug 16 '16 18:08 squeek502

Relevant issue: https://github.com/luvit/lit/issues/132

squeek502 avatar Aug 16 '16 19:08 squeek502

@squeek502 luver looks neat.

Also lit install won't update dependencies if you already have some in deps that satisfy the requirements. The correct way to force an update is delete deps and install again. We could maybe add a force flag that would tell it to ignore already installed dependencies.

creationix avatar Aug 16 '16 20:08 creationix

@urzds I'm afraid there is no such feature as what you proposed. It would be nice to add. Lit could use a cleanup, but I havne't had much time to work on it for a while.

creationix avatar Aug 16 '16 20:08 creationix