Skip to content

luastatic integrated into LuaRocks? #19

@hishamhm

Description

@hishamhm

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions