<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/lua/vim_spec.lua, branch usermarks</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>build: make generated source files reproducible #21586</title>
<updated>2023-01-23T09:26:46+00:00</updated>
<author>
<name>Arnout Engelen</name>
<email>arnout@engelen.eu</email>
</author>
<published>2023-01-23T09:26:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=cb757f2663e6950e655c6306d713338dfa66b18d'/>
<id>cb757f2663e6950e655c6306d713338dfa66b18d</id>
<content type='text'>
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
&gt; The order in which the indices are enumerated is not specified [...]
&gt;
&gt;&gt; The hardening of the VM deliberately randomizes string hashes. This in
&gt;&gt; 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 &lt;gocdundar@gmail.com&gt;
Co-Authored-By: Arnout Engelen &lt;arnout@bzzt.net&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
&gt; The order in which the indices are enumerated is not specified [...]
&gt;
&gt;&gt; The hardening of the VM deliberately randomizes string hashes. This in
&gt;&gt; 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 &lt;gocdundar@gmail.com&gt;
Co-Authored-By: Arnout Engelen &lt;arnout@bzzt.net&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>test: avoid noise in NVIM_LOG_FILE</title>
<updated>2023-01-16T22:56:56+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2023-01-16T19:43:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6ec7bcb6184f562157eebc8d0f25f78ba333c6a5'/>
<id>6ec7bcb6184f562157eebc8d0f25f78ba333c6a5</id>
<content type='text'>
Problem:
Tests that _intentionally_ fail certain conditions cause noise in
$NVIM_LOG_FILE:

    $NVIM_LOG_FILE: /home/runner/work/neovim/neovim/build/.nvimlog
    (last 100 lines)
    WRN 2023-01-16T18:26:27.673 T599.7799.0 unsubscribe:519: RPC: ch 1: tried to unsubscribe unknown event 'doesnotexist'
    WRN 2023-01-16T18:29:00.557 ?.11151    server_start:163: Failed to start server: no such file or directory: /X/X/X/...
    WRN 2023-01-16T18:33:07.269 127.0.0.1:12345 server_start:163: Failed to start server: address already in use: 127.0.0.1
    ...
    -- Output to stderr:
    module 'vim.shared' not found:
    	no field package.preload['vim.shared']
    	no file './vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared/init.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared/init.lua'
    	no file './vim/shared.so'
    	...
    E970: Failed to initialize builtin lua modules

Solution:
- Log to a private $NVIM_LOG_FILE in tests that intentionally fail and
  cause ERR log messages.
- Assert that the expected messages are actually logged.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
Tests that _intentionally_ fail certain conditions cause noise in
$NVIM_LOG_FILE:

    $NVIM_LOG_FILE: /home/runner/work/neovim/neovim/build/.nvimlog
    (last 100 lines)
    WRN 2023-01-16T18:26:27.673 T599.7799.0 unsubscribe:519: RPC: ch 1: tried to unsubscribe unknown event 'doesnotexist'
    WRN 2023-01-16T18:29:00.557 ?.11151    server_start:163: Failed to start server: no such file or directory: /X/X/X/...
    WRN 2023-01-16T18:33:07.269 127.0.0.1:12345 server_start:163: Failed to start server: address already in use: 127.0.0.1
    ...
    -- Output to stderr:
    module 'vim.shared' not found:
    	no field package.preload['vim.shared']
    	no file './vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/share/lua/5.1/vim/shared/init.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared.lua'
    	no file '/home/runner/nvim-deps/usr/lib/lua/5.1/vim/shared/init.lua'
    	no file './vim/shared.so'
    	...
    E970: Failed to initialize builtin lua modules

Solution:
- Log to a private $NVIM_LOG_FILE in tests that intentionally fail and
  cause ERR log messages.
- Assert that the expected messages are actually logged.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lua): always return nil values in vim.tbl_get when no results</title>
<updated>2022-12-15T01:43:43+00:00</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-12-15T01:27:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=26c918d03f5b38df900316c0601065ec1ea96264'/>
<id>26c918d03f5b38df900316c0601065ec1ea96264</id>
<content type='text'>
While `return` and `return nil` are for most intents and purposes
identical, there are situations where they're not. For example,
calculating the amount of values via the `select()` function will yield
varying results:

```lua
local function nothing() return     end
local function null()    return nil end

select('#', nothing()) -- 0
select('#', null())    -- 1
```

`vim.tbl_get` currently returns both nil and no results, which makes it
unreliable to use in certain situations without manually accounting for
these discrepancies.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While `return` and `return nil` are for most intents and purposes
identical, there are situations where they're not. For example,
calculating the amount of values via the `select()` function will yield
varying results:

```lua
local function nothing() return     end
local function null()    return nil end

select('#', nothing()) -- 0
select('#', null())    -- 1
```

`vim.tbl_get` currently returns both nil and no results, which makes it
unreliable to use in certain situations without manually accounting for
these discrepancies.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: vim.opt_local:append ignoring global option value (#21382)</title>
<updated>2022-12-12T15:14:50+00:00</updated>
<author>
<name>Phelipe Teles</name>
<email>39670535+phelipetls@users.noreply.github.com</email>
</author>
<published>2022-12-12T15:14:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=8b9bf3e3b997f033dcf73d506cceb12231501a22'/>
<id>8b9bf3e3b997f033dcf73d506cceb12231501a22</id>
<content type='text'>
Closes https://github.com/neovim/neovim/issues/18225</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes https://github.com/neovim/neovim/issues/18225</pre>
</div>
</content>
</entry>
<entry>
<title>feat(aucmd_win): allow crazy things with hidden buffers (#21250)</title>
<updated>2022-12-02T12:39:24+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2022-12-02T12:39:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=1145a9b2485a4e5072cffe28a958da983cd59e84'/>
<id>1145a9b2485a4e5072cffe28a958da983cd59e84</id>
<content type='text'>
Problem:    Crash when doing crazy things with hidden buffers.
Solution:   Dynamically allocate the list of autocommand windows.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:    Crash when doing crazy things with hidden buffers.
Solution:   Dynamically allocate the list of autocommand windows.</pre>
</div>
</content>
</entry>
<entry>
<title>docs: fix typos (#21196)</title>
<updated>2022-11-29T01:45:48+00:00</updated>
<author>
<name>dundargoc</name>
<email>33953936+dundargoc@users.noreply.github.com</email>
</author>
<published>2022-11-29T01:45:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=615f124003376c007442319b31a172360796974c'/>
<id>615f124003376c007442319b31a172360796974c</id>
<content type='text'>
Co-authored-by: zeertzjq &lt;zeertzjq@outlook.com&gt;
Co-authored-by: Raphael &lt;glephunter@gmail.com&gt;
Co-authored-by: Gregory Anders &lt;greg@gpanders.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: zeertzjq &lt;zeertzjq@outlook.com&gt;
Co-authored-by: Raphael &lt;glephunter@gmail.com&gt;
Co-authored-by: Gregory Anders &lt;greg@gpanders.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lua): make `vim.deepcopy` work with `vim.NIL`</title>
<updated>2022-11-14T20:14:27+00:00</updated>
<author>
<name>Max</name>
<email>max.heinzer397@gmx.ch</email>
</author>
<published>2022-11-14T19:26:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=e15f61b1bd60f6a198a0d9969cea407784ff71d0'/>
<id>e15f61b1bd60f6a198a0d9969cea407784ff71d0</id>
<content type='text'>
style: changed double quotes to single quotes

feat: add tests

fix tests
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
style: changed double quotes to single quotes

feat: add tests

fix tests
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(test): add Lua forms for API methods (#20152)</title>
<updated>2022-11-14T10:01:35+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2022-11-14T10:01:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=e8cc489accc435076afb4fdf89778b64f0a48473'/>
<id>e8cc489accc435076afb4fdf89778b64f0a48473</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lua): pesc, tbl_islist result types #20751</title>
<updated>2022-10-24T12:53:53+00:00</updated>
<author>
<name>NAKAI Tsuyoshi</name>
<email>82267684+uga-rosa@users.noreply.github.com</email>
</author>
<published>2022-10-24T12:53:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=4573cfa3adac3a7dbf1b6b032471a1c14adc7427'/>
<id>4573cfa3adac3a7dbf1b6b032471a1c14adc7427</id>
<content type='text'>
Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first

Solution:
Constrain docstring annotations.
Fix return types.

Co-authored-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
- pesc() returns multiple results, it should return a single result.
- tbl_islist() returns non-boolean in some branches.
- Docstring: @generic must be declared first

Solution:
Constrain docstring annotations.
Fix return types.

Co-authored-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>docs: fix typos (#20724)</title>
<updated>2022-10-23T01:45:39+00:00</updated>
<author>
<name>dundargoc</name>
<email>33953936+dundargoc@users.noreply.github.com</email>
</author>
<published>2022-10-23T01:45:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=1887d8d7d0dd619fa90fe11182c436bc3c71c9d5'/>
<id>1887d8d7d0dd619fa90fe11182c436bc3c71c9d5</id>
<content type='text'>
Co-authored-by: Marco Lehmann &lt;m99@posteo.de&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Marco Lehmann &lt;m99@posteo.de&gt;</pre>
</div>
</content>
</entry>
</feed>
