Skip to content

luaPackages.lgi: fail to dlopen cairo #413112

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

Open
3 tasks done
booxter opened this issue Jun 2, 2025 · 1 comment
Open
3 tasks done

luaPackages.lgi: fail to dlopen cairo #413112

booxter opened this issue Jun 2, 2025 · 1 comment
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin

Comments

@booxter
Copy link
Contributor

booxter commented Jun 2, 2025

Nixpkgs version

Please select a version.

Describe the bug

This is happening on Darwin only. Linux is fine.

If I understand the derivation correctly, there's a patch applied to lgi that forces typelib loading of the cairo library through ffi first; this is done so that dlopen (triggered by g_module_open) is executed only when the library is already pre-loaded through gobject-introspection.

But evidently this is not happening on Darwin, and the library is loaded with dlopen (which fails).

Steps to reproduce

On Darwin:

$ nix-shell -p lua53Packages.lgi gobject-introspection --command 'lua -e "local lgi = require \"lgi\".cairo"'
lua: ...-lua5.3-lgi-0.9.2-1/share/lua/5.3/lgi/override/cairo.lua:59: attempt to index a nil value (field '_module')
stack traceback:
	...-lua5.3-lgi-0.9.2-1/share/lua/5.3/lgi/override/cairo.lua:59: in main chunk
	[C]: in function 'require'
	...466v3-lua5.3-lgi-0.9.2-1/share/lua/5.3/lgi/namespace.lua:183: in function 'lgi.namespace.require'
	(...tail calls...)
	(command line):1: in main chunk
	[C]: in ?
$

On Linux:

$ nix-shell -p lua53Packages.lgi gobject-introspection --command 'lua -e "local lgi = require \"lgi\".cairo"'
$

Workaround:

nix-shell -p lua53Packages.lgi gobject-introspection --command 'DYLD_LIBRARY_PATH=/nix/store/bq3m86rj6c27lgzp3s9akw4j7hl8ypkz-cairo-1.18.2/lib lua test.lua'

Expected behaviour

require "lgi".cairo works.

Screenshots

No response

Relevant log output

Additional context

No response

System metadata

 - system: `"aarch64-darwin"`
 - host os: `Darwin 24.5.0, macOS 15.5`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.28.3`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/store/69gs81mpggzz4a8hima3faml7vmkmkzj-source`

Are you using nix-darwin?

Yes, I am using nix-darwin.

Notify maintainers


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

@booxter booxter added 0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin labels Jun 2, 2025
@booxter
Copy link
Contributor Author

booxter commented Jun 2, 2025

There's also an old #139159 though symptoms reported are different there and there were some fixes to introspection code path since then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

1 participant