Files
neovim/runtime
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
..
2022-12-08 16:33:38 +01:00
2022-12-12 06:13:23 +01:00
2021-09-13 16:33:41 +02:00
2021-05-01 22:29:03 -04:00
2022-08-20 10:04:55 +02:00
2019-07-29 20:50:07 +02:00
2021-04-27 09:21:32 -04:00
2023-01-03 10:07:43 +00:00
2019-07-29 20:50:07 +02:00
2023-01-09 17:12:06 +00:00
2022-10-17 08:19:48 +02:00