Conversation
|
@leafo I've tested this in the CI runs for luasystem at lunarmodules/luasystem#17 and I confirm this works! Without this patch, the resulting binary can only run pure Lua code (which meant LuaRocks ran fine, but then the C-based packages built by it wouldn't load in the interpreter). |
| await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [ "lua.exe", "luac.exe", dllFile ]) | ||
| await install_files(pathJoin(luaInstallPath, "lib"), luaExtractPath, [ dllFile, libFile ]) |
There was a problem hiding this comment.
I think the dll should be installed in only one place, not in both lib and bin:
| await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [ "lua.exe", "luac.exe", dllFile ]) | |
| await install_files(pathJoin(luaInstallPath, "lib"), luaExtractPath, [ dllFile, libFile ]) | |
| await install_files(pathJoin(luaInstallPath, "bin"), luaExtractPath, [ "lua.exe", "luac.exe", dllFile ]) | |
| await install_files(pathJoin(luaInstallPath, "lib"), luaExtractPath, [ libFile ]) |
There was a problem hiding this comment.
Copying the file in both places won't hurt (it's a small file in a temporary CI environment), and I can't tell for certain that not copying the file to lib won't break someone else's flows which are relying on that file being there. What I do know is that this PR as is fixes the C module loading behavior.
@leafo Can we merge this as-is? Let's not get this held back on whether it produces a redundant file.
There was a problem hiding this comment.
Sorry for the late reply, must have overseen this. @hishamhm Agreed, I believe to remember seeing some linking problems with some rocks when the file was not present in lib, I think it was related to stub-libs on Windows / MSVC.
This PR addresses #39 and introduces 2 changes to the windows plain lua build:
luaxx.dllnext tolua.exe(bin/) where it can be picked up at runtime by native libraries linked against itlua.exeagainstluaxx.dllto avoid "multiple lua VMs" errors