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

gobjectIntrospection: use absolute path for cairo GIR #34081

Merged
merged 1 commit into from Jan 24, 2018

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Jan 20, 2018

Motivation for this change

Cairo does not provide its own GObject bindinds so they are provided by gobject-introspection package. Unfortunately, this means that if we want to use the absolute path, we need gi to depend on cairo, which increases the closure size from 41M to 56M. We will probably want to split the typelib into a separate output.

Closes: #34080

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

cc @psychon does this fix your thing?

Cairo does not provide its own GObject bindinds so they are provided
by gobject-introspection package. Unfortunately, this means that if we
want to use the absolute path, we need gi to depend on cairo, which
increases the closure size from 41M to 56M. We will probably want
to split the typelib into a separate output.

Closes: NixOS#34080
@jtojnar jtojnar added the 6.topic: GNOME GNOME desktop environment and its underlying platform label Jan 20, 2018
@jtojnar jtojnar changed the base branch from master to staging January 20, 2018 15:39
@psychon
Copy link
Contributor

psychon commented Jan 20, 2018

cc @psychon does this fix your thing?

I'll try to test tomorrow. (Which means: Getting rid of the $LD_LIBRARY_PATH for awesome and see if it still works)

@psychon
Copy link
Contributor

psychon commented Jan 21, 2018

TL;DR: @jtojnar I can confirm that this patch works.

Running

env -i HOME=$HOME DISPLAY=:1  \
GI_TYPELIB_PATH='/nix/store/ir2qdvcbj3zbgsicq3cdi2ccschxilw1-pango-1.40.14/lib/girepository-1.0:/nix/store/v8ypi220jcdj3hvw55cjk6b29nin7l1j-gdk-pixbuf-2.36.7/lib/girepository-1.0:/nix/store/3drjms2mf82595cnrlqfikh0x1ifdx5s-gobject-introspection-1.54.1/lib/girepository-1.0:/nix/store/ir2qdvcbj3zbgsicq3cdi2ccschxilw1-pango-1.40.14/lib/girepository-1.0' \
"/nix/store/4s4ca0dja51x7i4r5xvanyqb8k0cvz26-awesome-4.2/bin/.awesome-wrapped"  \
--search /nix/store/21izsmmbpkbpfqlzqzdld9ihg5mz9djb-lgi-0.9.1/share/lua/5.2 \
--search /nix/store/21izsmmbpkbpfqlzqzdld9ihg5mz9djb-lgi-0.9.1/lib/lua/5.2

fails with "Failed to load shared library 'libcairo-gobject.so.2' referenced by the typelib: libcairo-gobject.so.2", as expected. The above is just the "normal" in-tree awesome without the makeWrapper-wrapper (and with some other unnecessary stuff that the wrapper does also removed).
Then I built the patched gobjectIntrospection and added result/lib/girepository-1.0/: to the beginning of GI_TYPELIB_PATH, so that the new cairo-1.0.typelib is used. This resulted in awesome successfully starting.

@jtojnar Thank you for the fix and thank you for coming up with a fix so quickly.

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

Successfully merging this pull request may close these issues.

None yet

4 participants