-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: Allow external build scripts to link Lua libraries #529
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR! |
Also to note, Pluto support will be added to a next mlua v0.11 |
Oh, nice! Will it also support configuring the sandboxing options in Pluto's |
Did not think about it yet. From the doc seems this option just disable loading binary modules? Also, for proper sandboxing, modules that provide access to OS/FS/etc should be disabled too, which is still aligned with mlua basic capabilities to enable only specific modules. |
The Pluto docs unfortunately don't show all the options, and some are even outdated (such as It's under the same MIT license so feel free to take anything from there that you need :) I hadn't published it yet because I still needed to find out a way how I can load Pluto's standard libraries (and required STL code!) without loading ALL libraries, which is what In my opinion, besides the language features, the sandboxing capabilities from Pluto are what make it so good. So not having them would be really unfortunate. Also, if you need any help with implementing Pluto for mlua, feel free to ping me! I'd love to help :) |
Took a bit longer than I expected (half of the time was spent debugging linker issues, great), but I was finally able to fix this issue in the following commit: Sculas/pluto-build-rs@7626f5a |
This PR makes a small change to
mlua-sys
(andmlua
to propagate the feature) that allows external crates and build scripts to do the compilation and linking part of the Lua libraries.For my use case, I'm working on Pluto bindings for
mlua
(which I'll release very soon). Pluto allows for many sandboxing options, which is why I created a separate build script for it. In this script, you can configure each of those options to suit your needs.In this case, the Pluto build script also handles the compilation and linking of the static library. This PR allows this system to work.
This is also useful for any future Lua forks/derivatives since you're no longer bound to what
mlua
can compile, instead you just need to confirm that the ABIs match.