Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] test: fix dynamic modules loading on macOS
@ 2021-12-29 11:58 Sergey Kaplun via Tarantool-patches
  2021-12-30  9:59 ` Kirill Yukhin via Tarantool-patches
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2021-12-29 11:58 UTC (permalink / raw)
  To: Kirill Yukhin, Igor Munkin; +Cc: tarantool-patches

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. Hence the paths are set in test need to be set
to `DYLD_LIBRARY_PATH` variable instead of `LD_LIBRARY_PATH` on macOS.
---

Branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-fix-macos-fiber-switch-test-full-ci

 .../gh-1700-abort-recording-on-fiber-switch.test.lua        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua b/test/app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua
index 7b9156c22..47408e5b8 100755
--- a/test/app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua
+++ b/test/app-tap/gh-1700-abort-recording-on-fiber-switch.test.lua
@@ -25,17 +25,19 @@ if #arg == 0 then
 
   test:plan(#checks)
 
+  local libext = package.cpath:match('?.(%a+);')
   local vars = {
     LUABIN = arg[-1],
     SCRIPT = arg[0],
     -- To support out-of-source build use relative paths in repo
     PATH   = arg[-1]:gsub('src/tarantool$', 'test/app-tap'),
-    SUFFIX = package.cpath:match('?.(%a+);'),
+    SUFFIX = libext,
   }
 
   local cmd = string.gsub('LUA_CPATH="$LUA_CPATH;<PATH>/?.<SUFFIX>" ' ..
                           'LUA_PATH="$LUA_PATH;<PATH>/?.lua" ' ..
-                          'LD_LIBRARY_PATH=<PATH> ' ..
+                          ((libext == 'dylib' and 'DYLD' or 'LD') ..
+                           '_LIBRARY_PATH=<PATH> ') ..
                           '<LUABIN> 2>&1 <SCRIPT>', '%<(%w+)>', vars)
 
   for _, ch in pairs(checks) do
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-30 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 11:58 [Tarantool-patches] [PATCH] test: fix dynamic modules loading on macOS Sergey Kaplun via Tarantool-patches
2021-12-30  9:59 ` Kirill Yukhin via Tarantool-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox