Bug 1426880 - Lua plugin is built against luajit and cannot use some lua modules
Summary: Lua plugin is built against luajit and cannot use some lua modules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: hexchat
Version: 25
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Patrick Griffis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-26 02:10 UTC by Matthew Sage
Modified: 2017-03-26 06:15 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-03-26 06:15:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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`.


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