sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.65k stars 98 forks source link

Make embeded Luarocks modules static #1954

Open alerque opened 8 months ago

alerque commented 8 months ago

It is now possible to build SILE itself into a single binary with all the Lua stuff included (all the LuaRocks dependencies plus all SILE's internal code). This is spiffy, but the resulting binary is not nearly as portable as it could be for the simple reason that the Lua modules we embeded in the binary are still themselves dynamically linked to system resources.

For example the resulting single-binary edition of SILE end up dynamically linked to the system ICU, Expat, and some other libraries. This is good for distros that want to go the bundled route but bad for distributing a single binary and expecting it to be cross platform. The binary we're building and attaching to CI now for example is linked to ICU 70. My system at home has ICU 74 so it doesn't run there.

Building LuaRocks as statically linked shared modules IS possible, but the tooling is not straightforward. Using LuaRocks internal scripts for it's own binary release I was able to build everything except luaexpat as static modules.

Still getting this worked out and wired into our build system is going to be quite a touchy task. I don't think I'll hold up v0.15 for this unless I happen to get it working along the way. It should be a non-breaking feature of the build system to add.