Bug 2440977 - luaL_openlibs not exported
Summary: luaL_openlibs not exported
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: lua
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2440557
TreeView+ depends on / blocked
 
Reported: 2026-02-19 13:32 UTC by Jaroslav Škarvada
Modified: 2026-02-19 14:28 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-02-19 14:28:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jaroslav Škarvada 2026-02-19 13:32:16 UTC
According to the Lua 5.5 doc the function should be available:
https://www.lua.org/manual/5.5/manual.html#luaL_openlibs

But it isn't exported. It's causing rrdtool Lua bindings not to build.


Reproducible: Always

Steps to Reproduce:
1. cat >test.c <<:EOF
char luaL_openlibs ();
int
main ()
{
return luaL_openlibs ();
  ;
  return 0;
}
:EOF
2. gcc -o test test.c -llua

Actual Results:
/usr/bin/ld.bfd: /tmp/ccnn2IFm.o: in function `main':
test.c:(.text+0x5): undefined reference to `luaL_openlibs'
collect2: error: ld returned 1 exit status


Expected Results:
No error

Additional Information:
With Lua 5.4 it works as expected.

Comment 1 Jaroslav Škarvada 2026-02-19 13:33:26 UTC
Related rrdtool FTBFS: https://bugzilla.redhat.com/show_bug.cgi?id=2440557

Comment 2 Jaroslav Škarvada 2026-02-19 13:35:36 UTC
rrdtool configure output:
checking for lua... /usr/bin/lua
checking for lua >= 5.0... 5.5 found
checking for lua55/lua.h... no
checking for lua5.5/lua.h... no
checking for lua.h... yes
checking for lualib.h... yes
checking for lauxlib.h... yes
checking for library containing lua_call... -llua
checking for library containing luaL_openlibs... no
checking for library containing luaL_module... no
checking for library containing luaL_openlib... no
Lua headers found but not the libraries! Please reinstall the dev packages for Lua 5.5

Comment 3 Tom "spot" Callaway 2026-02-19 14:19:53 UTC
So, the Lua 5.5 docs are wrong: there is no luaL_openlibs() function in the code anymore. It's been replaced with luaL_openselectedlibs(), and you can see that in the lualib.h header:

#define luaL_openlibs(L)	luaL_openselectedlibs(L, ~0, 0)

The rrdtool configure check needs to be updated to look for luaL_openselectedlibs(), ideally when lua 5.5+ is found, but crudely, as an optional function in the list it is already trying.

Comment 4 Jaroslav Škarvada 2026-02-19 14:28:40 UTC
Thanks, I will forward to rrdool upstream.


Note You need to log in before you can comment on or make changes to this bug.