Conversation
Add a build option to compile the Lua scripting engine as a static module and wire the server to load it directly at startup when enabled. The module load path now resolves on-load and on-unload entry points from the main binary, and the module lifecycle keeps those callbacks so unload works without a shared library handle. The Lua module build was updated to support both static and shared variants, with the static path exporting visible wrapper symbols and linking the server with the module archive. While touching the Lua code, a few internal symbols were renamed for consistency and the monotonic time helper was clarified. * CMake * Makefile * Lua scripting module * Core module loading **Generated by CodeLite** Signed-off-by: Eran Ifrah <eifrah@amazon.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #3392 +/- ##
============================================
- Coverage 74.51% 74.36% -0.16%
============================================
Files 130 130
Lines 72748 72817 +69
============================================
- Hits 54207 54147 -60
- Misses 18541 18670 +129
🚀 New features to boost your workflow:
|
|
No deep dive yet. I think we need to clarify requirements before proceeding with a deep dive. The original change aimed to:
For the 9.1 release, we must decide:
|
| @@ -183,7 +183,7 @@ monotime getMonotonicUs(void) { | |||
| } | |||
There was a problem hiding this comment.
Probably unrelated to this PR but should we somehow unify/sync getMonotonicUs() implementation in lua context with getMonotonicUs() implementation in server? Right now by default we build with hardware monotonic clocks that should not be compared with POSIX clock_gettime(CLOCK_MONOTONIC, &ts); @zuiderkwast @JimB123 WDYT?
|
Core team discussion:
@valkey-io/core-team and @rjd15372 specifically in case you have some thoughts. See #2858 (comment) for some additional discussion. |
Add a build option to compile the Lua scripting engine as a static module and wire the server to load it directly at startup when enabled. The module load path now resolves on-load and on-unload entry points from the main binary, and the module lifecycle keeps those callbacks so unload works without a shared library handle.
The Lua module build was updated to support both static and shared variants, with the static path exporting visible wrapper symbols and linking the server with the module archive. While touching the Lua code, a few internal symbols were renamed for consistency and the monotonic time helper was clarified.
Note that this PR addresses the LUA module, but it can be applied to other "core" modules (like: Bloom, Json, Search and others). With this change, it will be easier to ship Valkey bundle with modules.
Areas touched:
Generated by CodeLite