Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

../rpmio/rpmlua.h:5:10: fatal error: lauxlib.h: No such file or directory #888

Closed
KOLANICH opened this issue Oct 7, 2019 · 11 comments · Fixed by #893
Closed

../rpmio/rpmlua.h:5:10: fatal error: lauxlib.h: No such file or directory #888

KOLANICH opened this issue Oct 7, 2019 · 11 comments · Fixed by #893
Labels
bug build Build-system related

Comments

@KOLANICH
Copy link

KOLANICH commented Oct 7, 2019

depbase=`echo parsePreamble.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H   -I.. -I.. -I../include/ -I../misc  -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes  -fno-strict-aliasing -fstack-protector -Wempty-body -fopenmp -g -O2 -MT parsePreamble.lo -MD -MP -MF $depbase.Tpo -c -o parsePreamble.lo parsePreamble.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  gcc -DHAVE_CONFIG_H -I.. -I.. -I../include/ -I../misc -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -fno-strict-aliasing -fstack-protector -Wempty-body -fopenmp -g -O2 -MT parsePreamble.lo -MD -MP -MF .deps/parsePreamble.Tpo -c parsePreamble.c  -fPIC -DPIC -o .libs/parsePreamble.o
In file included from parsePreamble.c:15:
../rpmio/rpmlua.h:5:10: fatal error: lauxlib.h: No such file or directory

The distro is Ubuntu eoan, liblua5.3-dev is installed, configure.ac was modified to find it using pkg-config. The configure flags are: --with-lua.

@pmatilai
Copy link
Member

pmatilai commented Oct 8, 2019

Where's lauxlib.h on the system? My crystal ball seems broken today.

rpm simply expects lua includes to be in the compilers include path, so either it's not present at all, or it's not in the path, that's all there is to it. If it's not on the path you need to tell rpm about it. You're talking about a modified source so I can't tell you how to fix it, but the standard way to pass additional include paths would be appending CPPFLAGS="-I/some/path" to the configure line.

@KOLANICH
Copy link
Author

KOLANICH commented Oct 8, 2019

Where's lauxlib.h on the system? My crystal ball seems broken today.

pkg-config --cflags-only-I lua5.3
-I/usr/include/lua5.3
ls -l /usr/include/lua5.3
total 60
-rw-r--r-- 1 root root  8432 Nov 23  2015 lauxlib.h
-rw-r--r-- 1 root root 14833 May 30  2016 lua.h
-rw-r--r-- 1 root root   191 Dec 23  2004 lua.hpp
-rw-r--r-- 1 root root 21503 Apr  8  2019 luaconf.h
-rw-r--r-- 1 root root  1173 Feb  6  2014 lualib.h

As I have said, I have replaced lua with lua5.3 in https://github.com/rpm-software-management/rpm/blob/master/configure.ac#L968 .

@mlschroe
Copy link
Contributor

mlschroe commented Oct 8, 2019

I used the following patch to fix the build:

--- ./build/Makefile.am.orig    2019-10-02 13:12:00.031823903 +0000
+++ ./build/Makefile.am 2019-10-02 13:13:09.743668564 +0000
@@ -10,6 +10,9 @@ AM_CPPFLAGS += @WITH_NSS_INCLUDE@
 AM_CPPFLAGS += @WITH_MAGIC_INCLUDE@
 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
 AM_CPPFLAGS += -I$(top_srcdir)/misc
+if WITH_LUA
+AM_CPPFLAGS += @LUA_CFLAGS@
+endif

@mlschroe
Copy link
Contributor

mlschroe commented Oct 8, 2019

(That's also what Makefile.am in the lib directory does)

@pmatilai
Copy link
Member

pmatilai commented Oct 8, 2019

Oh, right... I didn't remember we use pkg-config to find Lua in the first place, I thought the initial comment was about changing configure to do so, but it's only about changing the "target". And yes in that case it's rpm's responsibility to pass LUA_CFLAGS around.

On that note, one shouldn't have to edit configure.ac to do anything normal, the ---with-lua test should support passing in a custom name as an argument (eg --with-lua=lua5.3). A PR from somebody who can actually test it would be welcome, I can't easily test such things (which is why the problem exists in the first place)

@pmatilai pmatilai added bug build Build-system related labels Oct 8, 2019
@KOLANICH
Copy link
Author

KOLANICH commented Oct 8, 2019

@mlschroe, thanks. But the fix doesn't work. I don't mean that the patch cannot be applied, I have applied it manually. I mean I still get the same error.

  1. if the conditional is present, -I/usr/include/lua5.3 is not added into the makefile
  2. I have removed the conditional. Even though the makefile contains -I/usr/include/lua5.3 I still get the error.

@pmatilai
Copy link
Member

Oh, now I see the problem: commit 62bd622 added the lauxlib.h include to the rpmlua.h header which used to be independent of lua headers, and thus gets included from places where LUA_CFLAGS are not enabled. Will fix.

pmatilai added a commit to pmatilai/rpm that referenced this issue Oct 10, 2019
rpmlua.h was originally written in a way that allows it to be included
regardless of whether Lua is actually enabled in rpm or not, or where
Lua headers are, specifically to isolate the rest of rpm from these
details. That was changed in commit 62bd622
when <lauxlib.h> started getting included in rpmlua.h, which leaks to
places like librpmbuild which do not directly use Lua.

The way Lua typedef's the luaL_Reg struct to itself defies my C fu for
for handling this in some nicer typesafe way, fix this all by just using
a void pointer instead, this is just an internal API where buyer can be
expected to beware.

Fixes rpm-software-management#888
@pmatilai
Copy link
Member

Should be fixed by #893 (doesn't help with the pkgconfig module name though)

@KOLANICH
Copy link
Author

Thanks, it really fixes this.

@pmatilai
Copy link
Member

Excellent. Thanks for testing and confirming.

pmatilai added a commit that referenced this issue Oct 10, 2019
rpmlua.h was originally written in a way that allows it to be included
regardless of whether Lua is actually enabled in rpm or not, or where
Lua headers are, specifically to isolate the rest of rpm from these
details. That was changed in commit 62bd622
when <lauxlib.h> started getting included in rpmlua.h, which leaks to
places like librpmbuild which do not directly use Lua.

The way Lua typedef's the luaL_Reg struct to itself defies my C fu for
for handling this in some nicer typesafe way, fix this all by just using
a void pointer instead, this is just an internal API where buyer can be
expected to beware.

Fixes #888
@pmatilai
Copy link
Member

Oh, and thanks for reporting too.

pmatilai added a commit to pmatilai/rpm that referenced this issue Nov 4, 2019
rpmlua.h was originally written in a way that allows it to be included
regardless of whether Lua is actually enabled in rpm or not, or where
Lua headers are, specifically to isolate the rest of rpm from these
details. That was changed in commit 62bd622
when <lauxlib.h> started getting included in rpmlua.h, which leaks to
places like librpmbuild which do not directly use Lua.

The way Lua typedef's the luaL_Reg struct to itself defies my C fu for
for handling this in some nicer typesafe way, fix this all by just using
a void pointer instead, this is just an internal API where buyer can be
expected to beware.

Fixes rpm-software-management#888

(cherry picked from commit facee2c)
pmatilai added a commit that referenced this issue Nov 18, 2019
rpmlua.h was originally written in a way that allows it to be included
regardless of whether Lua is actually enabled in rpm or not, or where
Lua headers are, specifically to isolate the rest of rpm from these
details. That was changed in commit 62bd622
when <lauxlib.h> started getting included in rpmlua.h, which leaks to
places like librpmbuild which do not directly use Lua.

The way Lua typedef's the luaL_Reg struct to itself defies my C fu for
for handling this in some nicer typesafe way, fix this all by just using
a void pointer instead, this is just an internal API where buyer can be
expected to beware.

Fixes #888

(cherry picked from commit facee2c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build Build-system related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants