Skip to content

Incompatibility with gobject-introspection 1.86: core.record.fromarray() receives table instead of lgi.record #362

Description

@User-web698

Environment

  • lgi: 0.9.2 (also tested with current master dfa8297)
  • gobject-introspection: 1.86.0
  • Lua: 5.4.8
  • OS: Chimera Linux (musl libc)

Description

When loading cairo via lgi, core.record.fromarray() in ffi.lua:86
receives a Lua table instead of an lgi.record when iterating
GEnumClass.values, causing a crash at startup.

Error

lgi/ffi.lua:86: bad argument #1 to 'fromarray' (lgi.record expected, got table)

Stack trace:

[C]: in field 'fromarray' /usr/share/lua/5.4/lgi/ffi.lua:86: in function 'lgi.ffi.load_enum' /usr/share/lua/5.4/lgi/override/cairo.lua:49: in main chunk

Cause

GEnumClass.values in gobject-introspection 1.86 appears to be exposed
as a Lua table instead of a lgi.record, breaking core.record.fromarray()
in record.c. This seems to be a behavioral change in how g-i 1.86
exposes GEnumValue* arrays.

Impact

Any application using lgi + cairo on systems with gobject-introspection
1.86 (e.g. AwesomeWM) is completely broken.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions