Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#13742 closed enhancement (fixed)

lua-5.4.0

Reported by: Douglas R. Reno Owned by: Douglas R. Reno
Priority: normal Milestone: 10.0
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

New minor version

Similar to 5.2 and 5.3, it seems like this is incompatible with previous versions.

We might want to hold on this one until we have something that needs it

Change History (21)

comment:1 by Douglas R. Reno, 4 years ago

https://www.lua.org/manual/5.4/manual.html#8

Do we want to hold on this until we have something that needs it?

comment:2 by Douglas R. Reno, 4 years ago

Owner: changed from blfs-book to Douglas R. Reno
Status: newassigned

comment:3 by Douglas R. Reno, 4 years ago

As part of this, I will test the following packages to make sure that this version of Lua doesn't break their builds:

general/genlib/brotli.xml:      <xref linkend="lua"/> (to create Lua bindings) and
general/genutils/graphviz.xml:      <xref linkend="lua"/>,
general/genutils/highlight.xml:      <xref linkend="lua"/>
multimedia/videoutils/vlc.xml:      <xref linkend="lua"/>, and
multimedia/videoutils/vlc.xml:      building with the current version of <xref linkend="lua"/>.
networking/netutils/nmap.xml:      <xref linkend="lua"/>, 
postlfs/editors/vim.xml:      <xref linkend="lua"/>,
server/major/apache.xml:      <xref linkend="lua"/>,
server/mail/dovecot.xml:      <xref linkend="lua"/>,
x/lib/keybinder2.xml:      <xref linkend="lua"/> (currently broken because an older lua version
x/lib/gtk-engines.xml:      <xref linkend="lua"/> and
xsoft/other/hexchat.xml:      <xref linkend="lua"/>

I'll build Wireshark as well to verify that this doesn't break the setup that we have for lua5.2

comment:4 by Douglas R. Reno, 4 years ago

I made some minor modifications to the shared library patch to adapt it to lua-5.4, as well as simplify some instructions. Using any kind of optimizations with this package results in a SIGBUS error (invalid memory access), and finding mailing lists for this package is difficult. There is one, but there doesn't seem to be any trouble reports for Lua-5.4. As a result, I adapted the makefile to use -O0 instead of -O2.

comment:5 by Douglas R. Reno, 4 years ago

Changes since Lua 5.3

Here are the main changes introduced in Lua 5.4. The reference manual lists the incompatibilities that had to be introduced.
Main changes

    new generational mode for garbage collection
    to-be-closed variables
    const variables
    userdata can have multiple user values
    new implementation for math.random
    warning system
    debug information about function arguments and returns
    new semantics for the integer 'for' loop
    optional 'init' argument to 'string.gmatch'
    new functions 'lua_resetthread' and 'coroutine.close'
    string-to-number coercions moved to the string library
    allocation function allowed to fail when shrinking a memory block
    new format '%p' in 'string.format'
    utf8 library accepts codepoints up to 2^31 

Note that you'll want to check the reference manual as well for the incompatibilty section if you encounter problems.

comment:6 by Douglas R. Reno, 4 years ago

Shared library patch submitted at r4141 in the patches repo.

Text changes include the removal of the MY_CFLAGS option, and the sed for the luaconf.h file. I've rolled those into the patch.

comment:7 by Douglas R. Reno, 4 years ago

Brotli does not have a Lua binding. There is a separate package that provides one though, but we don't specify it. I'll remove the dependency on Lua in brotli with the update

comment:8 by Douglas R. Reno, 4 years ago

Graphviz builds and runs OK.

comment:9 by Douglas R. Reno, 4 years ago

Highlight builds and works without issue

As I've been testing packages, I am confirming via 'ldd' that they are using /usr/lib/liblua.so.5.4

comment:10 by Douglas R. Reno, 4 years ago

VLC builds and runs OK (I used Big Buck Bunny to test it)

It's Lua module is located in /usr/lib/vlc/plugins/lua/liblua_plugin.so

To check if it's using the new version, run 'ldd /usr/lib/vlc/plugins/lua/liblua_plugin.so' and look for 'liblua.so.5.4'

comment:11 by Douglas R. Reno, 4 years ago

Nmap builds and functions properly. You can see it's lua files in /usr/share/nmap

comment:12 by Douglas R. Reno, 4 years ago

VIM does need a small tweak to get working properly: '460 s/static int/int/'

This is due to an API change in liblua.

After fixing it, /usr/bin/gvim links to liblua.so.5.4

Version 0, edited 4 years ago by Douglas R. Reno (next)

comment:13 by Douglas R. Reno, 4 years ago

httpd needs a tweak because of the lua_resume() function changes.

A fourth argument is now required for lua_resume, *nresults. This argument is supposed to return the number of values at the top of the stack that were yielded or returned by the routine that was called.

In httpd's case, this argument is not needed, and we can bypass the build error by using the following sed:

sed -i s/lua_resume(a, NULL, b)/lua_resume(a, NULL, b, NULL)/' modules/lua/mod_lua.h

comment:14 by Douglas R. Reno, 4 years ago

After the tweak is used though, httpd builds and runs as expected.

You can check which version is in use by using the following command (and looking for liblua.so):

renodr [ /sources ]$ ldd /usr/lib/httpd/modules/mod_lua.so

comment:15 by Douglas R. Reno, 4 years ago

Dovecot works great

To check what version of lua is in use (note that you have to pass --with-lua, I'll add that to the command explanations), run 'ldd' on /usr/lib/dovecot/lib01_mail_lua_plugin.so and /usr/lib/dovecot/lib22_push_notification_lua_plugin.so

comment:16 by Douglas R. Reno, 4 years ago

Since keybinder is unmaintained upstream and would require significant porting effort, I'll leave that one alone.

comment:17 by Douglas R. Reno, 4 years ago

gtk-engines builds and installs OK with --enable-lua --with-system-lua. When built with this, /usr/lib/gtk-2.0/2.10.0/engines/liblua_engine.so will be present

comment:18 by Douglas R. Reno, 4 years ago

Hexchat builds and runs OK too.

I'm going to give lua5.2 and Wireshark a build to make sure that lua-5.4 doesn't clobber it, and then after testing Wireshark, I'll commit this update.

comment:19 by Douglas R. Reno, 4 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r23350

A recap:

httpd/VIM had to be adjusted Everything else tested OK

comment:20 by Bruce Dubbs, 4 years ago

Milestone: 9.210,0

Milestone renamed

comment:21 by Bruce Dubbs, 4 years ago

Milestone: 10,010.0

Milestone renamed

Note: See TracTickets for help on using tickets.