`apt install liblua5.5-dev` contains a typo the breaks luarocks

Ubuntu Support Template

Ubuntu Version:
26.04

Desktop Environment (if applicable):
Docker container running on an M1 macOS laptop

Problem Description:
apt install liblua5.5-dev writes a pkgconf lua5.5.pc that contains a typo which breaks luarocks. I have tried two workarounds below, but neither fixes the problem.

Relevant System Information:
It is a Docker container.


Typo in the apt installed lua5.5.pc file

version=5.5.#define LUA_VERSION_RELEASE LUAI_TOSTR(LUA_VERSION_RELEASE_N)

% apt-get update -q -q --yes
% apt-get install -q -q --yes lua5.4 liblua5.4-dev lua5.5 liblua5.5-dev luarocks
% export PCDIR=$(pkgconf lua5.5 --variable pcfiledir)
% diff $PCDIR/lua5.4.pc $PCDIR/lua5.5.pc

Can you spot the typo below?

< major_version=5.4
< version=5.4.8
< lib_name_include=lua5.4
> major_version=5.5
> version=5.5.#define LUA_VERSION_RELEASE	LUAI_TOSTR(LUA_VERSION_RELEASE_N)
> lib_name_include=lua5.5

Fix the typo

sudo sed -i '/^version=5\.5\.\#define /c\version=5.5.0' $PCDIR/lua5.5.pc

Effects on luarocks

This causes luarocks --lua-version=5.5 config to not create a LUA_INCDIR variable even if the typo has been fixed before apt-get install luarocks!

luarocks --lua-version=5.4 config | grep INC  # --> "/usr/include/lua5.4"
luarocks --lua-version=5.5 config | grep INC  # --> Nothing!!!
# Let's manually set LUA_INCDIR...
mkdir -p $HOME/.luarocks  # required before setting luarocks config variables.
luarocks --lua-version=5.5 config variables.LUA_INCDIR /usr/include/lua5.5
luarocks --lua-version=5.5 config | grep INC  # --> "/usr/include/lua5.5"

Steps to reproduce

% docker run -it ubuntu:26.04

apt-get update  -q -q --yes
apt-get install -q -q --yes lua5.4 liblua5.4-dev lua5.5 liblua5.5-dev luarocks
luarocks --version  # /usr/bin/luarocks 3.8.0  # Not current >= 3.13.0
export PCDIR=$(pkgconf lua5.5 --variable pcfiledir)
diff $PCDIR/lua5.4.pc $PCDIR/lua5.5.pc | grep -E '^[<>] [^#]'
# Fix the typo...
sed -i '/^version=5\.5\.\#define /c\version=5.5.0' $PCDIR/lua5.5.pc
diff $PCDIR/lua5.4.pc $PCDIR/lua5.5.pc | grep -E '^[<>] [^#]

I was not able to reproduce this in debian:trixie because it does not include lua5.5 but I was able to replicate it in docker run -it debian:forky.

https://salsa.debian.org/lua-team/lua-5-5/-/commit/a407d9fb1d11431b020fab83e861361c6b3ae446?file_path=debian%2Frules#note_780460

You should send a proper bug report. Plus, it’s not a typo, so you may want to be more clear in your report. To me it looks like up to and including v5.4 the version number was hardcoded and has since been replaced by a macro, which is why the grep ... |cut ... pipeline returns the whole line.

The value the package rules script is after had been renamed to LUA_VERSION_RELEASE_N. I presume, there were other places needing pure numerical value and not string. In any case, it is the packaging bug, pkg-config files do not exist upstream.

1 Like

Perhaps lua.h can be processed by cpp first. That way nobody has to actually know the difference between <5.4 and >=5.5.

Sorry, should have made that more clear. I just assumed OP knew that already, because of the link to Debian’s salsa.

You should send a proper bug report.

Can you please provide a URL?

Agreed that this is a packaging bug because apt-get install liblua5.x-dev is what creates the defective $PCDIR/lua5.x.pc files.

Since this is Ubuntu and the bug is present in it, you can send a report, enriched with auto-collected info, by running this in a terminal:

ubuntu-bug liblua5.5-dev

% docker run -it ubuntu:26.04

apt-get update  -q -q --yes
apt-get install -q -q --yes lua5.4 liblua5.4-dev lua5.5 liblua5.5-dev luarocks
apt-get install ubuntu-bug  # --> E: Unable to locate package ubuntu-bug
ubuntu-bug liblua5.5-dev  # -> bash: ubuntu-bug: command not found

FYI, just trying to run ubuntu-bug should trigger the command not found hook, which searches for it, to then suggest:

sudo apt install apport

Or one can install apt-file and then do apt-file search ubuntu-bug. The benefit of the command not found hook is, that it also searches the snap store.

ubuntu-bug should be provided by the apport package.

1 Like

https://bugs.launchpad.net/ubuntu/+source/lua5.5/+bug/2160598

1 Like

Given that this bug renders the package and others pretty much useless, as it seems, you should raise the importance to “high”, if you can. I think, as the author of the report, you should be able to do that. The reason lies in the package being virtually unusable. Such is a release criticial bug in Debian speak, i.e. it will never make it into a (Debian) stable release with such a bug pending. If such are found after a release, they warrant a package upgrade, even if it’s not security related.

I’m not too familiar with Ubuntu’s policy and how this works on Lauchpad, but I’m pretty sure that’s a slam dunk, even if policies and terminology may differ.

Good job tracing the problem back to Debian!
But I don’t see a Debian bug report (which will ping the package maintainer).
Looks like you merely commented on the patch (which won’t ping the maintainer).

After you create the Debian bug (bugs.debian.org), be sure to link the Launchpad bug to the Debian bug.

3 Likes

The Ubuntu patch that I have tested locally and approved contains the text:

I’ve gone ahead and proposed your patch to Debian, and will also get things rolling regarding the fix here in Ubuntu.

I am delighted by the state of this issue (patch was created, I tested locally, and I approved).

I am now more worried about the luarocks LUA_INCDIR bug, which is my actual blocker and was not fixed by this patch.

Please see my last comment there. Mind you, I’m not a luarocks user, so I may have misunderstood what the expected behavior is. Running the config steps with a (manually) fixed lua5.5.pc seems to work.

This topic was automatically closed after 30 days. New replies are no longer allowed.