From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 luajit 1/6] test: fix setting of {DY}LD_LIBRARY_PATH variables
Date: Mon, 29 May 2023 17:37:08 +0300 [thread overview]
Message-ID: <e61e3bbb-adcd-1b77-7f8f-5cbb6d404361@tarantool.org> (raw)
In-Reply-To: <ZGxhd/3Vum523GrC@root>
This patch is LGTM.
On 5/23/23 09:47, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
>
> On 22.05.23, Sergey Bronnikov wrote:
>> Hi, Sergey!
>>
>> Thanks for the patch. See one comment below.
>>
>> On 5/18/23 23:44, Sergey Kaplun wrote:
>>> When we set `LUA_TEST_ENV_MORE` variable to be used in the additional
>>> env command for run testing if `"` is used to wrap the `LD_LIBRARY_PATH`
>>> value the content of this environment variable is literally
>>> `"/abs/path1:/abs/path2:...:"`. So, the first entry is treated as the
>>> relative path starting with `"`. In that case if we need the library to
>>> be loaded via FFI for this particular test, that loading fails with the
>>> error "cannot open shared object file", since the path to it is
>>> incorrect.
>>>
>>> This patch removes `"` wrapping for the aforementioned variables.
>>> ---
>>> test/tarantool-tests/CMakeLists.txt | 9 +++++++--
>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
>>> index a428d009..38d6ae49 100644
>>> --- a/test/tarantool-tests/CMakeLists.txt
>>> +++ b/test/tarantool-tests/CMakeLists.txt
>>> @@ -102,6 +102,11 @@ endif()
>>> # loaded modules on MacOS instead of shared libraries as it is
>>> # done on Linux and BSD, another environment variable should be
>>> # used to guide <ffi.load> while searching the extension.
>>> +# XXX: Be noticed that we shouldn't use `"` here to wrap
>>> +# the variable's content. If we do this, the variable value will
>>> +# contain `"` at the beginning and the end, so this `"` at the
>>> +# beginning will be treated as the directory for the first entry
>>> +# (the last subdirectory added).
>>> if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
>>> # XXX: Apple tries their best to "protect their users from
>>> # malware". As a result SIP (see the link[1] below) has been
>>> @@ -122,9 +127,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
>>> #
>>> # [1]: https://support.apple.com/en-us/HT204899
>>> # [2]: https://developer.apple.com/library/archive/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html
>>> - list(APPEND LUA_TEST_ENV_MORE DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}")
>>> + list(APPEND LUA_TEST_ENV_MORE DYLD_LIBRARY_PATH=${LD_LIBRARY_PATH})
>>> else()
>>> - list(APPEND LUA_TEST_ENV_MORE LD_LIBRARY_PATH="${LD_LIBRARY_PATH}")
>>> + list(APPEND LUA_TEST_ENV_MORE LD_LIBRARY_PATH=${LD_LIBRARY_PATH})
>> LUA_TEST_ENV_MORE then will be passed to a shell for execution.
>>
>> I suspect that command line execution will be broken when env variable
>> will contain non-escaped whitespaces.
>>
>> It should be quoted or whitespaces should be escaped. So I propose to
>> escape whitespaces with backward slashes, see [1].
> Yes, but we have some other problems with whitespaces already:
>
> | Could not execute (/home/burii/reviews/luajit/dir\ space/src/luajit -e dofile[[/home/burii/reviews/luajit/dir;space/test/luajit-test-init.lua]] /home/burii/rev
> | iews/luajit/dir): open3: exec of /home/burii/reviews/luajit/dir\ space/src/luajit -e dofile[[/home/burii/reviews/luajit/dir;space/test/luajit-test-init.lua]] /
> | home/burii/reviews/luajit/dir failed: No such file or directory at /usr/lib64/perl5/5.34/TAP/Parser/Iterator/Process.pm line 165.
>
> I suppose we can cover all such cases in the separate patchset.
>
>>
>> 1.
>> https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#how-can-i-get-quoting-and-escapes-to-work-properly
>>
>>
>>> endif()
>>>
>>> # LUA_CPATH and LD_LIBRARY_PATH variables and also TESTLIBS list
next prev parent reply other threads:[~2023-05-29 14:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-18 20:44 [Tarantool-patches] [PATCH v2 luajit 0/6] Revorking C tests Sergey Kaplun via Tarantool-patches
2023-05-18 20:44 ` [Tarantool-patches] [PATCH v2 luajit 1/6] test: fix setting of {DY}LD_LIBRARY_PATH variables Sergey Kaplun via Tarantool-patches
2023-05-19 11:23 ` Maxim Kokryashkin via Tarantool-patches
2023-05-22 11:03 ` Sergey Bronnikov via Tarantool-patches
2023-05-23 6:47 ` Sergey Kaplun via Tarantool-patches
2023-05-29 14:37 ` Sergey Bronnikov via Tarantool-patches [this message]
2023-05-18 20:44 ` [Tarantool-patches] [PATCH v2 luajit 2/6] test: introduce module for C tests Sergey Kaplun via Tarantool-patches
2023-05-19 11:46 ` Maxim Kokryashkin via Tarantool-patches
2023-05-22 12:33 ` Sergey Bronnikov via Tarantool-patches
2023-05-24 6:41 ` Sergey Kaplun via Tarantool-patches
2023-05-25 17:33 ` Sergey Bronnikov via Tarantool-patches
2023-05-29 10:03 ` Sergey Kaplun via Tarantool-patches
2023-05-29 14:38 ` Sergey Bronnikov via Tarantool-patches
2023-05-31 13:32 ` Sergey Kaplun via Tarantool-patches
2023-05-18 20:44 ` [Tarantool-patches] [PATCH v2 luajit 3/6] test: introduce utils.h helper " Sergey Kaplun via Tarantool-patches
2023-05-19 11:58 ` Maxim Kokryashkin via Tarantool-patches
2023-05-20 7:52 ` Sergey Kaplun via Tarantool-patches
2023-05-29 15:26 ` Sergey Bronnikov via Tarantool-patches
2023-05-18 20:44 ` [Tarantool-patches] [PATCH v2 luajit 4/6] test: rewrite misclib-getmetrics-capi test in C Sergey Kaplun via Tarantool-patches
2023-05-19 12:17 ` Maxim Kokryashkin via Tarantool-patches
2023-05-20 8:08 ` Sergey Kaplun via Tarantool-patches
2023-05-29 16:15 ` Sergey Bronnikov via Tarantool-patches
2023-05-18 20:44 ` [Tarantool-patches] [PATCH v2 luajit 5/6] test: rewrite misclib-sysprof-capi " Sergey Kaplun via Tarantool-patches
2023-05-19 13:00 ` Maxim Kokryashkin via Tarantool-patches
2023-05-20 7:28 ` Sergey Kaplun via Tarantool-patches
2023-05-18 20:44 ` [Tarantool-patches] [PATCH v2 luajit 6/6] test: rewrite lj-49-bad-lightuserdata " Sergey Kaplun via Tarantool-patches
2023-05-19 12:40 ` Maxim Kokryashkin via Tarantool-patches
2023-05-19 14:29 ` [Tarantool-patches] [PATCH v2 luajit 0/6] Revorking C tests Maxim Kokryashkin via Tarantool-patches
2023-05-20 8:38 ` Sergey Kaplun via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e61e3bbb-adcd-1b77-7f8f-5cbb6d404361@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=sergeyb@tarantool.org \
--cc=skaplun@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2 luajit 1/6] test: fix setting of {DY}LD_LIBRARY_PATH variables' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox