Bug 1426880

Summary: Lua plugin is built against luajit and cannot use some lua modules
Product: [Fedora] Fedora Reporter: Matthew Sage <matthewsage>
Component: hexchatAssignee: Patrick Griffis <tingping>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 25CC: oliver, praiskup, tingping
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-26 06:15:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Sage 2017-02-26 02:10:51 UTC
Description of problem:

The Lua plugin shipping with Hexchat version 2.12.4 on Fedora 25 is compiled against Lua 5.1, when the Lua version that ships with F25 is 5.3.4. This causes problems when trying to load Lua modules in Lua-written Hexchat addons, since the Lua plugin will always try looking for modules under the Lua 5.1 directories.


Version-Release number of selected component (if applicable):

2.12.4


How reproducible:

It can be reproduced with any Lua addon that loads any Lua modules.


Steps to Reproduce:

1. Add any Lua script that explicitly requires a Lua module to the addons directory
2. Run Hexchat


Actual results:

Lua fails to load the required moduled. See sample output:

 Lua version 1.3/5.1 loaded.
 Lua error: /home/sage/.config/hexchat/addons/nowplaying.lua:1: module 'lgi' not found:
 no field package.preload['lgi']
 no file './lgi.lua'
 no file '/usr/share/luajit-2.0.4/lgi.lua'
 no file '/usr/local/share/lua/5.1/lgi.lua'
 no file '/usr/local/share/lua/5.1/lgi/init.lua'
 no file '/usr/share/lua/5.1/lgi.lua'
 no file '/usr/share/lua/5.1/lgi/init.lua'
 no file './lgi.so'
 no file '/usr/local/lib/lua/5.1/lgi.so'
 no file '/usr/lib64/lua/5.1/lgi.so'
 no file '/usr/local/lib/lua/5.1/loadall.so'
 stack traceback:
 [C]: in function 'require'
 /home/sage/.config/hexchat/addons/nowplaying.lua:1: in main chunk

As you can see in the following output, the LGI module is actually installed, however it is located in the 5.3 directory:

[sage@qub addons]$ ls -l /usr/share/lua/5.3/lgi.lua
-rw-r--r--. 1 root root 756 Jun  3  2016 /usr/share/lua/5.3/lgi.lua


Expected results:

The Lua-writted addon should load successfully. In fact, after manually compiling hexchat-lua against lua 5.3 and copying lua.so to /usr/lib64/hexchat/plugins, this is the expected output:

 lua version 1.3-5.3 loaded.

And my Lua-written addon loads properly and works after that.


Additional info:

None.

Comment 1 Patrick Griffis 2017-02-26 08:49:55 UTC
Well yes they are parallel ABIs like Python2 and Python3.

I have reported that lgi needs to be built against luajit here: https://bugzilla.redhat.com/show_bug.cgi?id=1323428

Comment 2 Patrick Griffis 2017-03-26 06:15:09 UTC
The lgi package has been updated and you can now just install `lua-lgi-compat`.