Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luastatic integrated into LuaRocks? #19

Open
hishamhm opened this issue Jul 5, 2018 · 1 comment
Open

luastatic integrated into LuaRocks? #19

hishamhm opened this issue Jul 5, 2018 · 1 comment

Comments

@hishamhm
Copy link

hishamhm commented Jul 5, 2018

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 as luastatic, but also a static-gcc wrapper script and config file which fools LuaRocks into building static libraries even though it doesn't (yet) have support for it (the make 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?

@ers35
Copy link
Owner

ers35 commented Jul 5, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants