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 700B4EBBD99; Tue, 24 Sep 2024 17:18:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 700B4EBBD99 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1727187496; bh=zYbMJ5fxANkSAnjCTf/TNW0jpmPsQSE8w5SveVvB0OY=; 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=ZpQuxUe75J6fCgkRgPM8eZq5ScHIz9Z6wKzZQLCo/DJfpFz+PnU26VSpQqz6C12jZ QdG+mpO7D8lKM5WhLAmRjRpQbGxplHM9Uf4h0UebHwIQvWA18upTXcVmI8froizHkC GjSV+0Wx939Ne48ZMc7wKXGTCGqPZ0jSfNHwJDz4= Received: from smtp57.i.mail.ru (smtp57.i.mail.ru [95.163.41.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A7CAEEBBDA2 for ; Tue, 24 Sep 2024 17:18:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A7CAEEBBDA2 Received: by smtp57.i.mail.ru with esmtpa (envelope-from ) id 1st6Mm-0000000A3B6-10Ok; Tue, 24 Sep 2024 17:18:12 +0300 Content-Type: multipart/alternative; boundary="------------xihTLyIcjoU4bj0rz9PeKiTg" Message-ID: Date: Tue, 24 Sep 2024 17:18:09 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun References: <15a3b416520eac8f799a59fa51c6dcd9515ec90b.1727172936.git.skaplun@tarantool.org> <4c633d2d-2945-4a4a-9571-742c54f8e620@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD968D81A599CAF0ABB63135D16F13F66067E3A031DAB8B5617182A05F538085040A907C778E297F1C3C591814E25D11F9F6B5012A80B70DE31ECBEE71F5DB76FACA65EC38BD4A67DDF X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71BDE6A359BD5B800EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375D6F9E2FC7F7A8E98638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D422DB5AD88E460469DA685FF59703E336D6F8B0EC8F1364CC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2DCF9CF1F528DBCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C632EDEA9CD5989A36136E347CC761E074AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3CF39425AD3EEC986BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7A9D141641BA1E09E731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5876B973B90A6570F5002B1117B3ED69683B875FD336B810A92B673A2F5DDD7E7823CB91A9FED034534781492E4B8EEAD69BF13FED57427F1BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D344F2126FF337FA6512E2B8528173F330A79191ED45DE868FCB9738718E4AEA411EF6F40F05F526BE51D7E09C32AA3244C4FADEAFEF0F62A77EBBA027F22CEDE667560C2AFDFBD3958EA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojamSMdo1tbG8Okc/7naox6A== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140F71FEB94F8A1C8024049ED6734B801E3D5448F0F6CD7B5410152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 5/7] test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH 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 is a multi-part message in MIME format. --------------xihTLyIcjoU4bj0rz9PeKiTg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks, LGTM. On 24.09.2024 14:28, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the review! > Fixed your comment and force-pushed the branch. > > On 24.09.24, Sergey Bronnikov wrote: >> Hi, Sergey, >> >> thanks for the updated patch! >> >> I'm happy to see how much code was removed. >> >> See my comments below. >> >> On 24.09.2024 13:29, Sergey Kaplun wrote: >>> This patch sets the unique value of each of these variables for each of >>> the tests and only where they are needed. Also, it drops the comment >>> about SIP [1] tricks since it is obsolete after >>> 29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using >>> utils.selfrun in tests"). >>> >>> [1]:https://support.apple.com/en-us/HT204899 >>> >>> Resolves tarantool/tarantool#9898 >>> --- > > >>> + >>> + if(LIBS_${test_name}) >>> + foreach(path ${LIBS_${test_name}}) >>> + # Add the directory where the library is built to the list >>> + # with entries for the LUA_CPATH environment variable, so >>> + # LuaJIT can find and load it. >>> + AppendTestEnvVar(${test_title} >>> + LUA_CPATH "${path}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;" >>> + ) >>> + # Also, add this directory to the LD_LIBRARY_PATH environment >>> + # variable so FFI machinery can find and load it. >>> + # 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 entry. >>> + # XXX: Since the auxiliary libraries are built as dynamically >>> + # 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. >>> + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") >>> + AppendTestEnvVar(${test_title} DYLD_LIBRARY_PATH ${path}:) >>> + else() >>> + AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:) >>> + endif() >> please add unset(LIBS_${test_name}) > =================================================================== > diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt > index 74086ca4..297d5801 100644 > --- a/test/tarantool-tests/CMakeLists.txt > +++ b/test/tarantool-tests/CMakeLists.txt > @@ -146,6 +146,8 @@ foreach(test_path ${tests}) > AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:) > endif() > endforeach() > + > + unset(LIBS_${test_name}) > endif() > endforeach() > > =================================================================== > >>> + endforeach() > > --------------xihTLyIcjoU4bj0rz9PeKiTg Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Thanks, LGTM.

On 24.09.2024 14:28, Sergey Kaplun wrote:
Hi, Sergey!
Thanks for the review!
Fixed your comment and force-pushed the branch.

On 24.09.24, Sergey Bronnikov wrote:
Hi, Sergey,

thanks for the updated patch!

I'm happy to see how much code was removed.

See my comments below.

On 24.09.2024 13:29, Sergey Kaplun wrote:
This patch sets the unique value of each of these variables for each of
the tests and only where they are needed. Also, it drops the comment
about SIP [1] tricks since it is obsolete after
29897567ee5ed57e961c730432c056a3dbaa8f09 ("test: stop using
utils.selfrun in tests").

[1]:https://support.apple.com/en-us/HT204899

Resolves tarantool/tarantool#9898
---
<snipped>

+
+  if(LIBS_${test_name})
+    foreach(path ${LIBS_${test_name}})
+      # Add the directory where the library is built to the list
+      # with entries for the LUA_CPATH environment variable, so
+      # LuaJIT can find and load it.
+      AppendTestEnvVar(${test_title}
+        LUA_CPATH "${path}/?${CMAKE_SHARED_LIBRARY_SUFFIX}\;"
+      )
+      # Also, add this directory to the LD_LIBRARY_PATH environment
+      # variable so FFI machinery can find and load it.
+      # 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 entry.
+      # XXX: Since the auxiliary libraries are built as dynamically
+      # 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.
+      if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+        AppendTestEnvVar(${test_title} DYLD_LIBRARY_PATH ${path}:)
+      else()
+        AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
+      endif()
please add unset(LIBS_${test_name})
===================================================================
diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 74086ca4..297d5801 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -146,6 +146,8 @@ foreach(test_path ${tests})
         AppendTestEnvVar(${test_title} LD_LIBRARY_PATH ${path}:)
       endif()
     endforeach()
+
+    unset(LIBS_${test_name})
   endif()
 endforeach()
 
===================================================================

+    endforeach()
<snipped>

--------------xihTLyIcjoU4bj0rz9PeKiTg--