Closed joerg-krause closed 5 years ago
Luvit doesn't use the global paths to install libraries like lua does. You need the git subfolder to be present in deps/git for bootstrapping to work.
You can copy most the logic from https://github.com/luvit/lit/blob/master/get-lit.sh, but insert your custom luvi builds for host and target.
Long time...
Does luvit-loader
by chance change this issue? I haven't tried, yet.
It probably does. Luvit-loader works by prepending a special loader into the chain of lua require loaders. If luvit-loader can't find the file (and it won't in this case), then the normal require loaders will run as fallback. Assuming lua-git can be used this way, it will work.
But I think there will be problems if you don't modify the require paths within lua-git. Lua does not support relative requires (which is why I made luvit's custom system in the first place).
https://github.com/creationix/lua-git/blob/00bd21b8cc3a2e233276f5a70b57ca7347fdf520/init.lua#L2 and https://github.com/creationix/lua-git/blob/00bd21b8cc3a2e233276f5a70b57ca7347fdf520/init.lua#L9
Actually after thinking more about it, I think this will work with luvit-loader. Assuming the fallback loaders will find init.lua, when the relative requires are made, luvit-loader will still be first in the list and resolve them correctly.
Try it and see.
Thanks so far for explanation! I'll give it a try in the next days and post the results here.
Closing this issue as it has no priority anymore.
I am trying to cross-build lit by bootstrapping it with an external lua-git (instead of the bundled one).
For this I have build an host variant of luvi in
host/usr/bin/
as well as an target variant of luvi intarget/usr/bin/
. I've downloaded lit from github (without lua-git) indl/
and installed lua-git inhost/usr/share/lua/5.1/git
(by copying the lua files to that directory).Bootstrapping fails:
Sorry, I am a Lua novice. Do you have an idea how to solve this issue?