neovim/test/functional/lua
Arnout Engelen cb757f2663
build: make generated source files reproducible #21586
Problem:
Build is not reproducible, because generated source files (.c/.h/) are not
deterministic, mostly because Lua pairs() is unordered by design (for security).

https://github.com/LuaJIT/LuaJIT/issues/626#issuecomment-707005671
https://www.lua.org/manual/5.1/manual.html#pdf-next
> The order in which the indices are enumerated is not specified [...]
>
>> The hardening of the VM deliberately randomizes string hashes. This in
>> turn randomizes the iteration order of tables with string keys.

Solution:
- Update the code generation scripts to be deterministic.
    - That is only a partial solution: the exported function
      (funcs_metadata.generated.h) and ui event
      (ui_events_metadata.generated.h) metadata have some mpack'ed
      tables, which are not serialized deterministically.
    - As a workaround, introduce `PRG_GEN_LUA` cmake setting, so you can
      inject a modified build of luajit (with LUAJIT_SECURITY_PRN=0)
      that preserves table order.
    - Longer-term we should change the mpack'ed data structure so it no
      longer uses tables keyed by strings.

Closes #20124

Co-Authored-By: dundargoc <gocdundar@gmail.com>
Co-Authored-By: Arnout Engelen <arnout@bzzt.net>
2023-01-23 01:26:46 -08:00
..
api_spec.lua docs: fix typos (#20394) 2022-09-30 09:53:52 +02:00
buffer_updates_spec.lua docs: fix typos (#20394) 2022-09-30 09:53:52 +02:00
command_line_completion_spec.lua feat(lua): handle lazy submodules in :lua vim. wildmenu completion 2022-03-09 15:25:06 +01:00
commands_spec.lua fix(lua): print multiple return values with =expr (#16933) 2022-01-06 11:42:31 -07:00
diagnostic_spec.lua feat(diagnostic): vim.diagnostic.is_disabled() #21527 2023-01-12 08:57:39 -08:00
ffi_spec.lua feat(ui): add 'statuscolumn' option 2023-01-09 17:12:06 +00:00
filetype_spec.lua fix(filetype): use :setf instead of nvim_buf_set_option (#20334) 2022-09-25 16:29:25 +02:00
fs_spec.lua fix(fs): duplicate path separator #21509 2023-01-03 09:24:14 -08:00
help_spec.lua docs: update vimdoc parser #20747 2022-10-20 06:20:02 -07:00
highlight_spec.lua fix(lua): highlight.on_yank can close timer in twice #18976 2022-06-15 19:39:55 -07:00
inspector_spec.lua feat: vim.inspect_pos, vim.show_pos, :Inspect 2022-12-17 13:05:31 +01:00
json_spec.lua test: add tests for vim.json 2021-09-26 11:52:17 -07:00
loop_spec.lua feat(lua): enable stack traces in error output (#16228) 2021-11-06 08:26:10 -06:00
luaeval_spec.lua fix(eval): check for v:lua when calling callback (#19855) 2022-08-20 15:52:35 +08:00
mpack_spec.lua fix(vim.mpack): rename pack/unpack => encode/decode #16175 2021-10-30 06:59:59 -07:00
overrides_spec.lua test: simplify platform detection (#21020) 2022-11-22 08:13:30 +08:00
runtime_spec.lua fix(completion): include lua syntaxes in :ownsyntax completion (#21941) 2023-01-22 11:19:58 +08:00
secure_spec.lua fix(secure): crash when hitting escape in prompt (#21283) 2022-12-05 11:59:04 -07:00
spell_spec.lua feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00
thread_spec.lua feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00
ui_event_spec.lua fix(ui-ext): correct message kind in history before vim.ui_attach() 2022-11-07 10:20:27 +09:00
ui_spec.lua test(lua/ui_spec): fix Ctrl-C test flakiness (#21039) 2022-11-13 08:16:06 +08:00
uri_spec.lua test: simplify platform detection (#21020) 2022-11-22 08:13:30 +08:00
vim_spec.lua build: make generated source files reproducible #21586 2023-01-23 01:26:46 -08:00
xdiff_spec.lua feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00