<HTML><BODY><div>Hi, Igor!</div><div>Thanks for the fixes!</div><div>LGTM.</div><div data-signature-widget="container"><div data-signature-widget="content"><div>--<br>Best regards,</div><div>Maxim Kokryashkin</div></div></div><div> </div><div> </div><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">Понедельник, 27 февраля 2023, 12:19 +03:00 от Igor Munkin <imun@tarantool.org>:<br> <div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_16774895461676391167_BODY">Max,<br><br>Thanks for your review! See my answers below.<br><br>On 16.02.23, Maxim Kokryashkin wrote:<br>><br>> Hi, Igor!<br>> LGTM, except for a few nits below.<br>> <br><br><snipped><br><br>> >>diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua<br>> >>index dd02130c..f4795db0 100644<br>> >>--- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua<br>> >>+++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua<br>> >>@@ -3,52 +3,43 @@ local utils = require('utils')<br>> ><snipped><br>> >>+ -- TODO: Leave another toxic comment regarding SIP on macOS.<br>> >That comment is unnecessary. Here and below.<br><br>================================================================================<br><br>diff --git a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua<br>index ff3eaf01..ad06c329 100644<br>--- a/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua<br>+++ b/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua<br>@@ -6,8 +6,23 @@ local test = tap.test('gh-4427-ffi-sandwich'):skipcond({<br> <br> test:plan(2)<br> <br>+-- <makecmd> runs %testname%/script.lua by <LUAJIT_TEST_BINARY><br>+-- with the given environment, launch options and CLI arguments.<br> local script = require('utils').makecmd(arg, {<br>- -- TODO: Leave another toxic comment regarding SIP on macOS.<br>+ -- XXX: Apple tries their best to "protect their users from<br>+ -- malware". As a result SIP (see the link[1] below) has been<br>+ -- designed and released. Now, Apple developers are so<br>+ -- protected, that they can load nothing being not installed in<br>+ -- the system, since the environment is sanitized before the<br>+ -- child process is launched. In particular, environment<br>+ -- variables starting with DYLD_ and LD_ are unset for child<br>+ -- process. For more info, see the docs[2] below.<br>+ --<br>+ -- The environment variable below is used by FFI machinery to<br>+ -- find the proper shared library.<br>+ --<br>+ -- [1]: <a href="https://support.apple.com/en-us/HT204899" target="_blank">https://support.apple.com/en-us/HT204899</a><br>+ -- [2]: <a href="https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html" target="_blank">https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html</a><br> env = { DYLD_LIBRARY_PATH = os.getenv('DYLD_LIBRARY_PATH') },<br> redirect = '2>&1',<br> })<br><br>================================================================================<br><br>> > <br>> ><snipped><br>> >><br>> >>diff --git a/test/tarantool-tests/utils.lua b/test/tarantool-tests/utils.lua<br>> >>index eb11d40d..41a7c22a 100644<br>> >>--- a/test/tarantool-tests/utils.lua<br>> >>+++ b/test/tarantool-tests/utils.lua<br><br><snipped><br><br>> >>+ }, {<br>> >>+ __call = function(self, ...)<br>> >>+ local cmd = ('<ENV> <LUABIN> <REDIRECT> <SCRIPT>'):gsub('%<(%w+)>', self)<br>> >>+ .. (' %s'):rep(select('#', ...)):format(...)<br>> >>+ return io.popen(cmd):read('*all'):gsub('^%s+', ''):gsub('%s+$', '')<br>> >>+ end<br>> >>+ })<br>> >That part is barely readable, so I think you should either drop<br>> >a comment with explanation, or rewrite it in a more readable way.<br><br>Well, yeah... my Perl background is coming out ;)<br><br>Anyway, here is the comment:<br><br>================================================================================<br><br>diff --git a/test/tarantool-tests/tap.lua b/test/tarantool-tests/tap.lua<br>index ac04c01d..f5e08043 100644<br>--- a/test/tarantool-tests/tap.lua<br>+++ b/test/tarantool-tests/tap.lua<br>@@ -60,8 +65,17 @@ function M.makecmd(arg, opts)<br> REDIRECT = opts and opts.redirect or '',<br> }, {<br> __call = function(self, ...)<br>+ -- This line just makes the command for <io.popen> by the<br>+ -- following steps:<br>+ -- 1. Replace the placeholders with the corresponding values<br>+ -- given to the command constructor (e.g. script, env)<br>+ -- 2. Join all CLI arguments given to the __call metamethod<br>+ -- 3. Concatenate the results of step 1 and step 2 to obtain<br>+ -- the resulting command.<br> local cmd = ('<ENV> <LUABIN> <REDIRECT> <SCRIPT>'):gsub('%<(%w+)>', self)<br> .. (' %s'):rep(select('#', ...)):format(...)<br>+ -- Trim both leading and trailing whitespace from the output<br>+ -- produced by the child process.<br> return io.popen(cmd):read('*all'):gsub('^%s+', ''):gsub('%s+$', '')<br> end<br> })<br><br>================================================================================<br><br>> >> end<br>> >> <br>> >> function M.skipcond(condition, message)<br>> >>--<br>> >>2.30.2<br>> >--<br>> >Best regards,<br>> >Maxim Kokryashkin<br>> > <br><br>--<br>Best regards,<br>IM</div></div></div></div></blockquote><div> </div></BODY></HTML>