Open hishamhm opened 6 years ago
Sounds great. People already use luastatic and LuaRocks together, so creating a straightforward command makes sense. See https://github.com/mpeterv/luacheck/blob/9b6329da9717289ca44c1ada8c4ab73393bcbc35/scripts/build-windows.sh as an example.
How can I help?
Hi! Luastatic looks really cool — I already just finished hacking my way through the same problem space when I was told about about luastatic. (it did help me out teaching me some nm tricks when I got into cross-compiling!)
The use-case I had at hand was building a single-binary for LuaRocks, which includes a bunch of dependencies. The overall goal was described here, it's something I'd like to see as a goal for LuaRocks 3.1.
This was the solution I ended up with so far:
https://github.com/luarocks/luarocks/tree/master/binary
There's one big
all_in_one
Lua script which does mostly the same asluastatic
, but also astatic-gcc
wrapper script and config file which fools LuaRocks into building static libraries even though it doesn't (yet) have support for it (themake binary
target in the root LuaRocks makefile launches the whole thing).We would like to add first-class support for static libraries in LuaRocks eventually (there was an unfinished Google Summer of Code project for that), and the above
static-gcc
hack looks promising.Given that LuaRocks knows about dependencies (and third-party library dependencies as well), the idea of adding a command to LuaRocks that would produce a single-binary out of a script sounds compelling: it would essentially take a rock with a
bin/
script and statically-compile it along with all its dependencies (essentially doing the equivalent of figuring out the luastatic command-line flags). At that point, luastatic could even be part of LuaRocks itself.How does that idea sound to you?