Bug 2440977

Summary: luaL_openlibs not exported
Product: [Fedora] Fedora Reporter: Jaroslav Škarvada <jskarvad>
Component: luaAssignee: Tom "spot" Callaway <spotrh>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: 4le, drjohnson1, lua-packagers-sig, mhroncok, michel, spotrh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-02-19 14:28:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2440557    

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.