Unable do load lua-rrd, no rrd.so exists

Bug #1424602 reported by Kim Alvefur
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rrdtool (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Package installs /usr/lib/lua/5.1/rrd.so.0.0.0 and creates a symlink rrd.so.0 in the same directory, but no rrd.so, so Lua does not find it.

Expected:

~$ lua5.1 -l rrd
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
>

Acual:

~$ lua5.1 -l rrd
lua5.1: module 'rrd' not found:
 no field package.preload['rrd']
 no file './rrd.lua'
 no file '/usr/local/share/lua/5.1/rrd.lua'
 no file '/usr/local/share/lua/5.1/rrd/init.lua'
 no file '/usr/local/lib/lua/5.1/rrd.lua'
 no file '/usr/local/lib/lua/5.1/rrd/init.lua'
 no file '/usr/share/lua/5.1/rrd.lua'
 no file '/usr/share/lua/5.1/rrd/init.lua'
 no file './rrd.so'
 no file '/usr/local/lib/lua/5.1/rrd.so'
 no file '/usr/lib/x86_64-linux-gnu/lua/5.1/rrd.so'
 no file '/usr/lib/lua/5.1/rrd.so'
 no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
 [C]: ?
 [C]: ?

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: liblua5.1-rrd0 1.4.7-1
ProcVersionSignature: Ubuntu 3.2.0-75.110-generic 3.2.64
Uname: Linux 3.2.0-75-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.8
Architecture: amd64
Date: Mon Feb 23 12:32:49 2015
InstallationMedia: Xubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120817.3)
MarkForUpload: True
SourcePackage: rrdtool
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Kim Alvefur (zash) wrote :
Revision history for this message
Robie Basak (racb) wrote :

Thank you for your report.

This looks like a local configuration problem, rather than a bug in Ubuntu. You want the liblua5.1-rrd-dev package (or its equivalent in more recent Ubuntu releases).

You can find pointers to get help for this sort of problem here: http://www.ubuntu.com/support/community

Since we use this bug tracker to track bugs in Ubuntu, rather than configuration problems, I'm marking this bug as Invalid. This helps us to focus on fixing bugs in Ubuntu.

If you believe that this is really a bug, then please explain and then change the bug status back to New.

Changed in rrdtool (Ubuntu):
status: New → Invalid
Revision history for this message
Kim Alvefur (zash) wrote :

Look at http://packages.ubuntu.com/precise/i386/liblua5.1-rrd0/filelist

Note that these two entries exist:
/usr/lib/lua/5.1/rrd.so.0
/usr/lib/lua/5.1/rrd.so.0.0.0

If a file named /usr/lib/lua/5.1/rrd.so had existed, it would work as expected.

However, this looks like it is the case in Debian as well.

Revision history for this message
Robie Basak (racb) wrote :

It's standard in Debian and Ubuntu to provide the .so symlink only in the -dev package. This is because anything linking against it at runtime should access the version of the library it has specifically been built with (or designed for) by accessing <libary>.so.<version>. Otherwise it could pick up the wrong file and this would break things.

On the other hand, when developing you generally want to link against the "current" or "latest", so the symlink is provided for that (but you shouldn't install the -dev packages from multiple versions at once).

As this is the standard for all packages in Debian, we can't treat it as a bug unless there's some specific reason that this package should diverge from the standard.

Revision history for this message
Kim Alvefur (zash) wrote :

Lua does not link against libraries, it loads them dynamically.

Revision history for this message
Robie Basak (racb) wrote : Re: [Bug 1424602] Re: Unable do load lua-rrd, no rrd.so exists

Why should that matter? Anything automated will break if the .so symlink
changes to a newer version causing an ABI break, no?

Revision history for this message
Daniel Silverstone (dsilvers) wrote :

The fundamental misunderstanding here is in thinking of the rrd.so as a shared library -- it is not a shared library, it is a module.

The ABI which the object exports is irrelevant because in reality it cannot change that ABI without failing to be loaded by Lua 5.1. The presence of the 5.1 in the file path encodes that ABI dependency.

Lua dynamically loads the modules in question at runtime in general, though it is possible to statically (or dynamically) link them to an application which contains an interpreter, that simply isn't done in general.

Consider how dh_lua splits the contents of the foo and foo-dev packages (use lua-rex-pcre and lua-rex-pcre-dev as examples if you wish) and try to follow that approach.

I hope this helps to clarify the issue and helps the maintainer of rrdtool's source fix the lua rrd package appropriately.

Revision history for this message
Robie Basak (racb) wrote :

On Tue, Feb 24, 2015 at 01:25:44PM -0000, Daniel Silverstone wrote:
> I hope this helps to clarify the issue and helps the maintainer of
> rrdtool's source fix the lua rrd package appropriately.

You'll need to send this up to Debian if you need it looked at further,
since any change would need to originate there.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.