Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 434238 - app-admin/lsyncd-2.0.7 with dev-lang/lua-5.2.1: inotify.c:132:1: error: unknown type name ‘luaL_reg’
Summary: app-admin/lsyncd-2.0.7 with dev-lang/lua-5.2.1: inotify.c:132:1: error: unkno...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Tim Harder
URL: https://github.com/axkibe/lsyncd/pull...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: lua-5.2
  Show dependency tree
 
Reported: 2012-09-07 19:43 UTC by Dennis Schridde
Modified: 2012-12-02 00:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,14.33 KB, text/plain)
2012-09-07 19:43 UTC, Dennis Schridde
Details
Patch fixing typo in lsyncd.c (0001-Fix-typo-in-name-of-Lua-global-table-lysncd-lsyncd.patch,945 bytes, patch)
2012-10-01 17:54 UTC, Dennis Schridde
Details | Diff
Patch fixing typo in lsyncd.c applied to lsyncd 2.0.7 (typo-working.patch,568 bytes, patch)
2012-10-02 14:09 UTC, Anders Aagaard
Details | Diff
lsyncd-2.1.4 for Lua 5.2 without compat enabled (lsyncd-2.1.4-lua-5.2-no-compat.patch,3.70 KB, patch)
2012-12-01 18:29 UTC, Dennis Schridde
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Schridde 2012-09-07 19:43:20 UTC
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.     -pipe -O2 -march=athlon64-sse3 -Wall  -c inotify.c
inotify.c:132:1: error: unknown type name ‘luaL_reg’
[…]

Reproducible: Always
Comment 1 Dennis Schridde 2012-09-07 19:43:43 UTC
Created attachment 323154 [details]
build.log
Comment 2 Dennis Schridde 2012-09-16 11:19:07 UTC
See-Also: https://github.com/axkibe/lsyncd/issues/146
Comment 3 Pacho Ramos gentoo-dev 2012-09-16 12:47:28 UTC
Thanks for reporting to upstream
Comment 4 Pacho Ramos gentoo-dev 2012-09-23 08:37:18 UTC
+  23 Sep 2012; Pacho Ramos <pacho@gentoo.org> +files/lsyncd-2.0.7-lua51.patch,
+  +files/lsyncd-2.0.7-lua52.patch, lsyncd-2.0.7.ebuild:
+  Fix compilation with lua-5.2, bug #434238 by Dennis Schridde.
+
Comment 5 Anders Aagaard 2012-10-01 16:03:52 UTC
This makes lsyncd crash on lua 5.1.5:

# lsyncd --help
PANIC: unprotected error in call to Lua API (attempt to index a nil value)

[ebuild R ] dev-lang/lua-5.1.5 USE="deprecated readline -emacs -static" 217 kB
[ebuild R ] app-admin/lsyncd-2.0.7 139 kB

If I remove files/lsyncd-2.0.7-lua52.patch it works fine again.

(Should I file stuff like this as new issues or request this be reopened?)
Comment 6 Dennis Schridde 2012-10-01 16:23:45 UTC
This is the patch upstream applied:
https://github.com/axkibe/lsyncd/commit/ab36ab782339a243a39455154ca8d3a59b4ec990

Could you please try that instead of the one in Gentoo?
Comment 7 Dennis Schridde 2012-10-01 16:53:24 UTC
$ lsyncd --help
Error: preparing runner: lsyncd.lua:38: attempt to index local 'lsyncd' (a nil value)

Anders: Which Lua version do you use?
Comment 8 Dennis Schridde 2012-10-01 17:54:02 UTC
Created attachment 325488 [details, diff]
Patch fixing typo in lsyncd.c

lsyncd.c had an undetected typo: It sets the global with name "lysncd" instead of "lsyncd". Attached patch fixes this.
Comment 9 Dennis Schridde 2012-10-02 01:29:50 UTC
Turns out my Lua 5.1 backwards compatibility patch had indeed a bug. While luaL_newlib creates a new table on top of the stack, luaL_register *uses* the one there.

I recreated the commit [1]. If you still want to use these patches, make sure you use 3ab30d41295135ba88517d1a18ce8729292a1a53 (Lua 5.1 compatibility fallbacks) and not the older one. Together with the typo fix (3d065fccba86f7622f15ca1e89f22bca558b27c9) lsyncd works now when using Lua 5.1.
Comment 10 Dennis Schridde 2012-10-02 01:33:20 UTC
(In reply to comment #9)
> Turns out my Lua 5.1 backwards compatibility patch had indeed a bug. While
> luaL_newlib creates a new table on top of the stack, luaL_register *uses*
> the one there.
> 
> I recreated the commit [1]. If you still want to use these patches, make
> sure you use 3ab30d41295135ba88517d1a18ce8729292a1a53 (Lua 5.1 compatibility
> fallbacks) and not the older one. Together with the typo fix
> (3d065fccba86f7622f15ca1e89f22bca558b27c9) lsyncd works now when using Lua
> 5.1.

[1] https://github.com/devurandom/lsyncd/commits/fix/lua52
Comment 11 Anders Aagaard 2012-10-02 11:27:19 UTC
(In reply to comment #6)
> This is the patch upstream applied:
> https://github.com/axkibe/lsyncd/commit/
> ab36ab782339a243a39455154ca8d3a59b4ec990
> 
> Could you please try that instead of the one in Gentoo?

lsyncd-2.0.7-lua51.patch + that patch works with lua 5.1.5
Comment 12 Dennis Schridde 2012-10-02 11:36:35 UTC
(In reply to comment #11)
> (In reply to comment #6)
> > This is the patch upstream applied:
> > https://github.com/axkibe/lsyncd/commit/
> > ab36ab782339a243a39455154ca8d3a59b4ec990
> > 
> > Could you please try that instead of the one in Gentoo?
> 
> lsyncd-2.0.7-lua51.patch + that patch works with lua 5.1.5
If you use the patch by upstream, you don't need any of the Gentoo patches anymore. You just need the typo fix (attachment #325488 [details, diff]).

Thanks for testing!
Comment 13 Anders Aagaard 2012-10-02 14:09:02 UTC
Created attachment 325530 [details, diff]
Patch fixing typo in lsyncd.c applied to lsyncd 2.0.7

Attachment #325488 [details, diff] probably applies to HEAD, this applies cleanly to 2.0.7.
Comment 14 Anders Aagaard 2012-10-02 14:09:38 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #6)
> > > This is the patch upstream applied:
> > > https://github.com/axkibe/lsyncd/commit/
> > > ab36ab782339a243a39455154ca8d3a59b4ec990
> > > 
> > > Could you please try that instead of the one in Gentoo?
> > 
> > lsyncd-2.0.7-lua51.patch + that patch works with lua 5.1.5
> If you use the patch by upstream, you don't need any of the Gentoo patches
> anymore. You just need the typo fix (attachment #325488 [details, diff] [details, diff]).
> 
> Thanks for testing!

Didn't apply cleanly, but patching with upstream fix + #325488 works for lua 5.1.5 :)
Comment 15 Tim Harder gentoo-dev 2012-11-24 07:04:27 UTC
Should be fixed in 2.1.3 now in CVS.
Comment 16 Dennis Schridde 2012-11-24 17:11:07 UTC
checking whether Lua library was compiled with compat support... no
configure: error: Lua library needs to be compiled with compat support

-> DEPEND is broken, should be:
|| ( >=dev-lang/lua-5.1 >=dev-lang/lua-5.2[compat] )
Comment 17 Dennis Schridde 2012-11-24 17:14:53 UTC
(In reply to comment #16)
> checking whether Lua library was compiled with compat support... no
> configure: error: Lua library needs to be compiled with compat support
> 
> -> DEPEND is broken, should be:
> || ( >=dev-lang/lua-5.1 >=dev-lang/lua-5.2[compat] )

Sorry, I meant:
> || ( >=dev-lang/lua-5.1 >=dev-lang/lua-5.2[deprecated] )
Comment 18 Dennis Schridde 2012-12-01 18:29:55 UTC
Created attachment 331148 [details, diff]
lsyncd-2.1.4 for Lua 5.2 without compat enabled

(In reply to comment #16)
> checking whether Lua library was compiled with compat support... no
> configure: error: Lua library needs to be compiled with compat support
> 
> -> DEPEND is broken, should be:
> || ( >=dev-lang/lua-5.1 >=dev-lang/lua-5.2[deprecated] )
Attached patch fixes this issue by patching lsyncd to no longer require Lua 5.1 compatibility enabled.
Comment 19 Tim Harder gentoo-dev 2012-12-02 00:39:12 UTC
(In reply to comment #18)
> Created attachment 331148 [details, diff] [details, diff]

> Attached patch fixes this issue by patching lsyncd to no longer require Lua
> 5.1 compatibility enabled.

Upstream that.

Fixed lua dep in 2.1.4.