(Lua version) Add experimental syscall_overrides config option#3375
Draft
stevenengler wants to merge 2 commits intoshadow:mainfrom
Draft
(Lua version) Add experimental syscall_overrides config option#3375stevenengler wants to merge 2 commits intoshadow:mainfrom
syscall_overrides config option#3375stevenengler wants to merge 2 commits intoshadow:mainfrom
Conversation
syscall_overrides config option
This allows users to override the behaviour of emulated syscalls using Lua expressions.
f4e04db to
b40e02f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #3280 and #3369.
This is a ~equivalent version of #3369 using Lua expressions instead of CEL expressions. This uses the "vendored" feature of mlua so that a system Lua interpreter doesn't need to be installed. I chose the "lua54" feature because 54 was the biggest number.
Unfortunately, I don't see a way to compile the expressions ahead of time, so they're compiled each time they're evaluated. (Compiled functions are non-send non-sync
Function<'lua>where'luais the lifetime of the interpreter, which leads to issues.)I wrote this PR without much thinking and without knowing anything about Lua, but it seems to work.