Auto chdir requires static link of lua library - ideas to revise #1974
Replies: 1 comment 3 replies
-
The way that works on all platforms, doesn't add any maintenance burdens, and doesn't break anything when linking a different Lua runtime. While that might seem unreasonable, we're not a huge team and what you're putting forward does not sound like a trivial thing to support. Our Lua scripts had to be modified when we moved from Lua 5.1 to 5.3, so I imagine we'll have people reporting issues using Lua 5.1 or LuaJIT. Unfortunately, Premake can't really have arbitrary Lua version changes, we might be able to upgrade in the 5.3 line, but other than a dozen commits we're basically at the end of the 5.3 line with no future releases of Lua 5.3 planned or expected. It would be a lot easier to just get those 14 commits.
This isn't really the point of your post, but I'm not sure this really holds true. Lua 5.3.3 was released in 2016 and was first packaged in Ubuntu 17.04 and has been the Lua 5.3 version in every release until Ubuntu 22.04 - 5 years later - which upgraded to 5.3.6, released in 2020. Lua 5.3.4 was released before Ubuntu 17.04 shipped too, so it shipped with an out of date version of Lua 5.3 and then never updated, nor did 17.10, 18.04, 18.10, 19.04, 19.10, 20.04, 20.10, 21.04, or 21.10. 10 versions of Ubuntu shipped with an out of date version of Lua 5.3, and continue(d) to only provide that out of date version. |
Beta Was this translation helpful? Give feedback.
-
I'm considering adding an optional build-time feature of dynamically linking the lua library instead of staticly linking to it. This will improve the security and reliability of premake, because then updates to the lua library can be more frequent and automatically done by distro maintainers.
The one sticking point is where to move the calls of do_chdir() in src/lua_auxlib.c:chunk_wrapper(). Any advice on how the chdir calls can be preserved?
Perhaps I can override the dynamically linked function, but at least one article about this indicates that it's necessary to place a proxy dll that would pass through every call to the target dll. Or, should I register callbacks at script entry and exit? What is the Right Way to do it?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions