Skip to content

cmake: change Linux linking to add an explicit lua dependency#803

Open
mcepl wants to merge 1 commit intoluvit:masterfrom
openSUSE-Python:lua-link
Open

cmake: change Linux linking to add an explicit lua dependency#803
mcepl wants to merge 1 commit intoluvit:masterfrom
openSUSE-Python:lua-link

Conversation

@mcepl
Copy link
Contributor

@mcepl mcepl commented Feb 26, 2026

The point of the patch is to avoid relying on indirect/implicit Lua linkage on Linux, because we are building luv against system Lua.

The point of the patch is to avoid relying on indirect/implicit Lua
linkage on Linux, because we are building luv against system Lua.

Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
@mcepl mcepl changed the title cmake: change the Linux linking to add an explicit lua dependency cmake: change Linux linking to add an explicit lua dependency Feb 26, 2026
@clason
Copy link

clason commented Feb 26, 2026

What if people want to build against LuaJIT? (Which most people who don't hate performance do.)

@truemedian
Copy link
Member

truemedian commented Feb 26, 2026

I'm really not sure what situation this is intended to solve.

A Lua module depends on the application embedding/loading it for the lua symbols. If you explicitly link Lua then you will break any application not using the system lua library (including other versions of PUC Lua).

An example of what this would fix would be great because the CI failures seem to reinforce this being a bad idea.

@mcepl
Copy link
Contributor Author

mcepl commented Feb 26, 2026

What if people want to build against LuaJIT? (Which most people who don't hate performance do.)

We built against the LuaJIT as well, I use Neovim, I was porting (unsuccessfully) vis to LuaJIT, so I know what I am talking about. And yes, openSUSE has a symlink from various versions of Lua (and LuaJIT) to /usr/lib64/liblua.so and /usr/lib64/pkgconfig/lua.pc.

However, you are probably also right, that this patch should stay on the distribution level only and it may not be useful here in the upstream repository.

Feel free to close this, if you don’t see any use for you.

@truemedian
Copy link
Member

truemedian commented Feb 26, 2026

At a bare minimum this change must be applied only when linking system lua (linking our built static/shared lua and system lua is a bug), and should use the found LUA_LIBRARIES instead of a hardcoded library name.

@truemedian
Copy link
Member

I'm a bit more confused about this change after a quick look through opensuse's Lua packages, because none of them add -llua or similar. What makes luv special where this is necessary, even at the distribution level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants