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

Build a shared library and install headers #1100

Open
satta opened this issue Nov 11, 2023 · 1 comment
Open

Build a shared library and install headers #1100

satta opened this issue Nov 11, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@satta
Copy link

satta commented Nov 11, 2023

I am curious why luau does not build a common shared library so one can package/update it separately from whatever project uses it? That's how it's done in the reference Lua and LuaJIT. Luau seems to only build static archives and hence needs to be linked statically. Any idea why -- is that by design or did the use case just not come up?

I'm looking to package Luau for Debian and only shipping static libraries is kind of frowned upon, since that would mean that an update of the library would need rebuilds of everything that depends on it if there are only static libraries.

I (and maybe others as well) would prefer to have a clear, installed set of library and headers (maybe also pkgconfig info etc) that would make Luau as a library immediately usable as most developers would expect it, with the least amount of surprise.

@satta satta added the enhancement New feature or request label Nov 11, 2023
@zeux
Copy link
Collaborator

zeux commented Nov 11, 2023

This mostly just didn't come up. All production applications that use Luau so far ship with statically linked library I believe.

A couple things to know off the top of my head:

  • Luau currently doesn't have a completely set ABI for VM. Our API should be source-level stable by now, but we occasionally make changes that break ABI while preserving API via macros for example. I am not sure what that does to SONAMEs et al for packaging; this doesn't happen often but it does happen, and we don't really want to use major version of the actual releases to indicate ABI level compatibility.
  • I briefly tried to do shared library builds out of curiosity a few months ago and we had issues around CodeGen component integration, in that it wasn't possible to compile Luau.VM and Luau.CodeGen as separate shared libraries because CodeGen relied on a host of internal symbols that VM defined but didn't officially export. fyi @vegorov-rbx - I was thinking about either moving NativeState to VM and exposing that through a separate function (eg lnative.cpp/h) that we export, or about exporting all functions CodeGen relies on but we'd need a way to actually test that the exports are complete in that case. We could also technically export all internal functions although that doesn't feel great either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants