From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 6AE2647DF11; Mon, 29 May 2023 17:37:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6AE2647DF11 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1685371031; bh=VGT2Hk3nDO+5wKGuhSnNbZFgvVE7d1poV4WiC/SRqeQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=NIC7QxLI6fQ1K1D5cJqOx97OXwkTgBaIt3HBWBW0lK2dJN6LP8ZLAcjc9wjETvGB8 RBdIzym4WIHyalQ1LnKoalvYVMjyS8F5gdVFzbWSEBv+NOqqkTTKcRslrhz45EdFGo O7+fD9oU3v+rUkLMUJSh9n+r3C30rVP4AK8Y0ZnI= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [95.163.41.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BAE1747DF11 for ; Mon, 29 May 2023 17:37:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BAE1747DF11 Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1q3dzg-00292U-MF; Mon, 29 May 2023 17:37:09 +0300 Message-ID: Date: Mon, 29 May 2023 17:37:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: Sergey Kaplun References: <848c82043f91fcaa4883c711cfa85bf1a1bc9959.1684442182.git.skaplun@tarantool.org> <30f947ca-eddc-0804-9c42-400d5ff15ea2@tarantool.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9FA9FE7958A526B7705822D423BE8C8D4063FE8E7256D289D00894C459B0CD1B9CFBDBA06B304DE742BF38646A7BC09C326B686E80FE633A8661B221002496221 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A72B1EA4C8D5AD81EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637FC59FE045852DCED8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D83F30BED77694F77429B0A90ADCB65A7C117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC07CB022245CAE856389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC85E59ED9F89912417117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF41889BC8E60666F9BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B64A19EED482128B833AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735D2D576BCF940C736C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A510720123B246D2C2D890BCC4D957C96377A72A163F6F1199F87CCE6106E1FC07E67D4AC08A07B9B062B3BD3CC35DA588CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFB723B6F90F078117C0EF985C5125D7281D59199A1BCD1347D5D54020A7B938E2A8F268452FA2DF71A0A56A47F2C7DF647ABF17B855C7D2C7AE20DD2F2EF28233F4E8A8FB6BF8EBF5 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojjwJ7vqadnRvYRMiorjM5dw== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769390A6F28983E2D41286344E0EA1FF3266565FCDE7E403FA1EBA65886582A37BD66FEC6BF5C9C28D98A98C1125256619760D574B6FC815AB872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 1/6] test: fix setting of {DY}LD_LIBRARY_PATH variables X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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 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