lgi-devs / lgi

Dynamic Lua binding to GObject libraries using GObject-Introspection
MIT License
440 stars 70 forks source link

Fails to install on fedora 36, Lua 5.4-1 #306

Closed airtonix closed 1 year ago

airtonix commented 1 year ago
x sudo dnf install gobject-introspection-devel
Last metadata expiration check: 1:07:50 ago on Fri 23 Dec 2022 14:41:00.
Package gobject-introspection-devel-1.72.0-1.fc36.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

x sudo luarocks install --server=https://luarocks.org/dev lgi
Installing https://luarocks.org/lgi-0.9.2-1.src.rock

lgi 0.9.2-1 depends on lua >= 5.1 (5.4-1 provided by VM)
make -C lgi
make[1]: Entering directory '/tmp/luarocks_lgi-0.9.2-1-zwznPe/lgi/lgi'
pkg-config --exists 'gobject-introspection-1.0 >= 0.10.8' --print-errors
touch .depcheck
gcc -fPIC  -O2 -fPIC -I/usr/include -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o buffer.o buffer.c
gcc -fPIC  -O2 -fPIC -I/usr/include -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o callable.o callable.c
callable.c: In function ‘closure_callback’:
callable.c:1237:13: error: too few arguments to function ‘lua_resume’
 1237 |       res = lua_resume (L, NULL, npos);
      |             ^~~~~~~~~~
In file included from lgi.h:11,
                 from callable.c:12:
/usr/include/lua.h:300:15: note: declared here
  300 | LUA_API int  (lua_resume)     (lua_State *L, lua_State *from, int narg,
      |               ^~~~~~~~~~
make[1]: *** [Makefile:63: callable.o] Error 1
make[1]: Leaving directory '/tmp/luarocks_lgi-0.9.2-1-zwznPe/lgi/lgi'
make: *** [Makefile:16: all] Error 2

Error: Build error: Failed building.

x inxi -S
System:
  Host: pennyroyal Kernel: 5.19.15-201.fc36.x86_64 arch: x86_64 bits: 64
    Desktop: awesome v: 4.3 Distro: Fedora release 36 (Thirty Six)
airtonix commented 1 year ago

works if i specify an older version of lua.

> luarocks --local --lua-version 5.1 install --server=https://luarocks.org/dev lgi
Installing https://luarocks.org/lgi-0.9.2-1.src.rock

lgi 0.9.2-1 depends on lua >= 5.1 (5.1-1 provided by VM)
make -C lgi
make[1]: Entering directory '/tmp/luarocks_lgi-0.9.2-1-s5F35q/lgi/lgi'
pkg-config --exists 'gobject-introspection-1.0 >= 0.10.8' --print-errors
touch .depcheck
gcc -fPIC  -O2 -fPIC -I/usr/include/lua-5.1 -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o buffer.o buffer.c
gcc -fPIC  -O2 -fPIC -I/usr/include/lua-5.1 -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o callable.o callable.c
gcc -fPIC  -O2 -fPIC -I/usr/include/lua-5.1 -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o core.o core.c
gcc -fPIC  -O2 -fPIC -I/usr/include/lua-5.1 -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o gi.o gi.c
gcc -fPIC  -O2 -fPIC -I/usr/include/lua-5.1 -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o marshal.o marshal.c
marshal.c: In function ‘marshal_2c_array’:
marshal.c:328:13: warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead [-Wdeprecated-declarations]
  328 |             *out_array = g_memdup (*out_array, size);
      |             ^
In file included from /usr/include/glib-2.0/glib.h:82,
                 from lgi.h:32,
                 from marshal.c:13:
/usr/include/glib-2.0/glib/gstrfuncs.h:257:23: note: declared here
  257 | gpointer              g_memdup         (gconstpointer mem,
      |                       ^~~~~~~~
gcc -fPIC  -O2 -fPIC -I/usr/include/lua-5.1 -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o object.o object.c
object.c: In function ‘object_new’:
object.c:553:7: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
  553 |       GParameter *params;
      |       ^~~~~~~~~~
In file included from /usr/include/glib-2.0/gobject/gobject.h:26,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from lgi.h:33,
                 from object.c:12:
/usr/include/glib-2.0/gobject/gparam.h:273:8: note: declared here
  273 | struct _GParameter /* auxiliary structure for _setv() variants */
      |        ^~~~~~~~~~~
object.c:565:7: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
  565 |       params = g_newa (GParameter, size);
      |       ^~~~~~
/usr/include/glib-2.0/gobject/gparam.h:273:8: note: declared here
  273 | struct _GParameter /* auxiliary structure for _setv() variants */
      |        ^~~~~~~~~~~
object.c:565:7: warning: ‘GParameter’ is deprecated [-Wdeprecated-declarations]
  565 |       params = g_newa (GParameter, size);
      |       ^~~~~~
/usr/include/glib-2.0/gobject/gparam.h:273:8: note: declared here
  273 | struct _GParameter /* auxiliary structure for _setv() variants */
      |        ^~~~~~~~~~~
object.c:576:7: warning: ‘g_object_newv’ is deprecated: Use 'g_object_new_with_properties' instead [-Wdeprecated-declarations]
  576 |       return lgi_object_2lua (L, g_object_newv (gtype, size, params),
      |       ^~~~~~
/usr/include/glib-2.0/gobject/gobject.h:452:13: note: declared here
  452 | gpointer    g_object_newv                     (GType           object_type,
      |             ^~~~~~~~~~~~~
gcc -fPIC  -O2 -fPIC -I/usr/include/lua-5.1 -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -Wall -Wextra -O2 -g -c -o record.o record.c
gcc -shared  -o corelgilua51.so buffer.o callable.o core.o gi.o marshal.o object.o record.o -lgirepository-1.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lglib-2.0 -L/usr/lib64/../lib64 -lffi 
echo "return '0.9.2'" > version.lua
make[1]: Leaving directory '/tmp/luarocks_lgi-0.9.2-1-s5F35q/lgi/lgi'
make -C lgi install
make[1]: Entering directory '/tmp/luarocks_lgi-0.9.2-1-s5F35q/lgi/lgi'
mkdir -p /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lib/lgi
cp corelgilua51.so /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lib/lgi
mkdir -p /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lua
cp ../lgi.lua /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lua
mkdir -p /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lua/lgi
cp class.lua component.lua core.lua enum.lua ffi.lua init.lua log.lua namespace.lua package.lua record.lua version.lua /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lua/lgi
mkdir -p /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lua/lgi/override
cp override/cairo.lua override/Clutter.lua override/Gdk.lua override/Gio-DBus.lua override/Gio.lua override/GLib-Bytes.lua override/GLib-Error.lua override/GLib.lua override/GLib-Markup.lua override/GLib-Source.lua override/GLib-Timer.lua override/GLib-Variant.lua override/GObject-Closure.lua override/GObject-Object.lua override/GObject-Type.lua override/GObject-Value.lua override/GooCanvas.lua override/Gst.lua override/Gtk.lua override/PangoCairo.lua override/Pango.lua /home/zenobius/.luarocks/lib/luarocks/rocks-5.1/lgi/0.9.2-1/lua/lgi/override
make[1]: Leaving directory '/tmp/luarocks_lgi-0.9.2-1-s5F35q/lgi/lgi'
No existing manifest. Attempting to rebuild...
lgi 0.9.2-1 is now installed in /home/zenobius/.luarocks (license: MIT/X11)
airtonix commented 1 year ago

But this then fails to work properly when required and executed.

psychon commented 1 year ago

Closing as a duplicate of #247. You are trying to build a version of LGI with Lua 5.4 that does not work with Lua 5.4.

psychon commented 1 year ago

Wait, no, now I am confused what is going on...?!

psychon commented 1 year ago
sudo luarocks install --server=https://luarocks.org/dev lgi
Installing https://luarocks.org/lgi-0.9.2-1.src.rock

I downloaded the above URL, unpacked the zip file and found this in lgi-0.9.2-1.rockspec:

source = {
   url = 'git://github.com/pavouk/lgi.git',
   tag = '0.9.2'
}

That version is three years older than Lua 5.4 and fails to build with Lua 5.4. I am closing this again. Please try building a version that includes the changes from #249.

(Yes, there is no release that includes that PR. That is tracked in #302 which you already found.)

So, closing this issue again. Sorry for the noise!