Nixpkgs: gobject-introspection-1.52.1: cairo-1.0.typelib contains non-absolute path

Created on 20 Jan 2018  Â·  11Comments  Â·  Source: NixOS/nixpkgs

Issue description

The typelib for cairo contains a non-absolute path:

$ strings /nix/store/*-gobject-introspection-1.52.1/lib/girepository-1.0/cairo-1.0.typelib | grep lib
libcairo-gobject.so.2

This means that the resulting call to dlopen("libcairo-gobject.so.2") will need a correctly set up $LD_LIBRARY_PATH to succeed. This in turn causes #14164.

Other typelibs contain absolute paths into the nix store (tested with the other typelib files from gobject-introspection and with pango 1.40.11).

Possible way to test this

$ unset LD_LIBRARY_PATH
$ Xephyr :1 &
$ cat $(which awesome) | sed -e 's/LD_LIBRARY_PATH/FOOO/g' | DISPLAY=:1 bash -

The above fails with Failed to load shared library 'libcairo-gobject.so.2' referenced by the typelib: libcairo-gobject.so.2: cannot open shared object file: No such file or directory. Awesome still tries to continue, but lots of stuff errors out.

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the results.

Sorry, but (a) I don't think this is necessary and (b) I cannot copy&paste from the VM and so this is quite non-trivial for me to provide. But it's x86_64-linux, NixOS 17.09.2799....

bug GNOME

Most helpful comment

The issue is that the cairo is not really needed by gobjectIntrospection, only by the single GIR/typelib file. It would make more sense if the typelib were part of the cairo package but apparently we cannot have nice things.

All 11 comments

This can be actually fixed quite easily: https://github.com/jtojnar/nixpkgs/tree/gir-abs-cairo Though there might be a problem with increased closure size?

Though there might be a problem with increased closure size?

Is it okay for me to read this as "this stops being broken and now actually depends on its dependencies"? ;-)

The issue is that the cairo is not really needed by gobjectIntrospection, only by the single GIR/typelib file. It would make more sense if the typelib were part of the cairo package but apparently we cannot have nice things.

Libraries should always be hardcoded.

Though there might be a problem with increased closure size?

What are the sizes with and without the change?

The issue is that the cairo is not really needed by gobjectIntrospection, only by the single GIR/typelib file.

I'm not familiar with this code, but maybe we can put it in a separate output.

What are the sizes with and without the change?

How do I measure it? du -sclh (nix-store -qR (nix-build -A gobjectIntrospection)) | grep total? In that case it is 41M → 56M.

I'm not familiar with this code, but maybe we can put it in a separate output.

That would work but we would need to check all packages depending on gobjectIntrospection if they use the cairo typelib. And could only be found out during runtime.

I suggest merging your fix along with a comment/reference to this issue. Whoever wants to reduce the closure size can then look into multiple-outputs.

I do not really like it but at the moment I do not have time for the effort.

Fix (#34081) is in staging.

Can't we drop the cairo-1.0.gir.in file totally from the gobjectIntrospection package and then patch the cairo package to extract that file from gobjectIntrospection.src?

@dezgeg We could but it would make the packages needlessly complex and the different behaviour from upstream might be confusing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ob7 picture ob7  Â·  3Comments

sid-kap picture sid-kap  Â·  3Comments

lverns picture lverns  Â·  3Comments

yawnt picture yawnt  Â·  3Comments

langston-barrett picture langston-barrett  Â·  3Comments