Unexpected interaction between gobject-introspection and grafts

  • Open
  • quality assurance status badge
Details
3 participants
  • Collin J. Doering
  • Josselin Poiret
  • John Kehayias
Owner
unassigned
Submitted by
Collin J. Doering
Severity
normal
C
C
Collin J. Doering wrote on 5 Apr 2023 02:04
(address . bug-guix@gnu.org)
87bkk3m9pm.fsf@rekahsoft.ca
Hi team Guix!

I was working on packaging taffybar (https://github.com/taffybar/taffybar),which depends on haskell-gi (https://github.com/haskell-gi/haskell-gi) - haskell bindings for goject-introspection capable libraries. While packaging gi-gdk, I hit this error:

Toggle snippet (7 lines)
** (process:23): WARNING **: 00:09:56.407: Failed to load shared library '/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libgtk-4.so.1' referenced by the typelib: libgtk-4.so.1: cannot open shared object file: No such file or directory
Could not resolve symbol "gdk_device_pad_get_type" in namespace "Gdk-4.0"
CallStack (from HasCallStack):
error, called at lib/Data/GI/CodeGen/LibGIRepository.hs:202:16 in haskell-gi-0.26.4-HCp1omjln8S5hdZ8Oexk5N:Data.GI.CodeGen.LibGIRepository
error: in phase 'configure': uncaught exception:

However, confusingly enough the shared library that is referenced by the typelib exists in my store (and is also included via the gtk package as a dependency, so I would expect its available during the build). It took me a bit to realize that the un-grafted gtk package is being used in the typelib, but really the grafted one is needed.

Toggle snippet (8 lines)
? guix build --no-grafts gtk
...
/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1
? guix build gtk
...
/gnu/store/sz90zf6yynsymb1a74zai87f2yi3da82-gtk-4.8.1

In the manual "Debugging Build Failures" (https://guix.gnu.org/manual/devel/en/html_node/Debugging-Build-Failures.html#Debugging-Build-Failures),it notes that the build environment can be mimicked using guix shell (explicitly specifying the '--no-grafts' options). Entering this environment and looking more closely at the gtk package in use, it appears that its typelib for libgtk references the .so appropriately.

Toggle snippet (7 lines)
? guix shell --no-grafts -L . -C -D ghc-gi-gdk binutils
[env]$ readlink -f $GUIX_ENVIRONMENT/lib/girepository-1.0/Gtk-4.0.typelib
/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/girepository-1.0/Gtk-4.0.typelib
[env]$ strings $GUIX_ENVIRONMENT/lib/girepository-1.0/Gtk-4.0.typelib | grep libgtk
/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libgtk-4.so.1

So this all to say that I'm not sure whats going wrong with my build, but I suspect it has something to do with grafting. Any help appreciated.

Here is my definition of ghc-gi-gtk (the package that causes this build failure to become apparent):

Toggle snippet (31 lines)
(define-public ghc-gi-gdk
(package
(name "ghc-gi-gdk")
(version "4.0.5")
(source (origin
(method url-fetch)
(uri (hackage-uri "gi-gdk" version))
(sha256
(base32
"1pa8vbm931xq3rb9xr441sccga9h1y03lzf6hp2rwkhyhs006hax"))))
(build-system haskell-build-system)
(properties '((upstream-name . "gi-gdk")))
(inputs (list gtk
gdk-pixbuf
ghc-haskell-gi-base
ghc-haskell-gi
ghc-haskell-gi-overloading
ghc-gi-cairo
ghc-gi-pango
ghc-gi-gio
ghc-gi-gdkpixbuf
ghc-gi-gobject
ghc-gi-glib))
(native-inputs (list pkg-config
gobject-introspection-cairo)) ; for GI repository files (.gir files)
(home-page "https://github.com/haskell-gi/haskell-gi")
(synopsis "Gdk bindings")
(description "Bindings for Gdk, autogenerated by haskell-gi.")
(license license:lgpl2.1)))

I did not include other dependencies that are not yet packaged upstream (eg. ghc-gi-*, ...), but am happy to provide them if they are useful for reproduction of this issue.

PS: If you noticed I'm using the package 'gobject-introspection-cairo', this is because I found that the cairo typelibs are not included in the cairo package, or gobject-introspection. I worked around this using the aforementioned variant, which is defined like so:

Toggle snippet (18 lines)
(define-public gobject-introspection-cairo
(package
(inherit gobject-introspection)
(name "gobject-introspection")
(inputs (cons* (list "cairo" cairo) (package-inputs gobject-introspection)))
(arguments
`(#:phases
(modify-phases %standard-phases
(add-before 'configure 'patch-cairo-gir
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(cairo (assoc-ref inputs "cairo")))
(substitute* '("gir/cairo-1.0.gir.in")
(("@CAIRO_SHARED_LIBRARY@")
(string-append cairo "/lib/@CAIRO_SHARED_LIBRARY@")))
#t))))))))

Note: this adjustment to gobject-introspection should likely make it upstream (and was inspired by a similar change to nix (described https://github.com/NixOS/nixpkgs/pull/34081)).

--
Collin J. Doering

J
J
Josselin Poiret wrote on 5 Apr 2023 10:11
874jpun3xx.fsf@jpoiret.xyz
Hi Collin,

"Collin J. Doering" via Bug reports for GNU Guix <bug-guix@gnu.org>
writes:

Toggle quote (12 lines)
> Hi team Guix!
>
> I was working on packaging taffybar (https://github.com/taffybar/taffybar), which depends on haskell-gi (https://github.com/haskell-gi/haskell-gi) - haskell bindings for goject-introspection capable libraries. While packaging gi-gdk, I hit this error:
>
> --8<---------------cut here---------------start------------->8---
> ** (process:23): WARNING **: 00:09:56.407: Failed to load shared library '/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libgtk-4.so.1' referenced by the typelib: libgtk-4.so.1: cannot open shared object file: No such file or directory
> Could not resolve symbol "gdk_device_pad_get_type" in namespace "Gdk-4.0"
> CallStack (from HasCallStack):
> error, called at lib/Data/GI/CodeGen/LibGIRepository.hs:202:16 in haskell-gi-0.26.4-HCp1omjln8S5hdZ8Oexk5N:Data.GI.CodeGen.LibGIRepository
> error: in phase 'configure': uncaught exception:
> --8<---------------cut here---------------end--------------->8---

These errors can also be caused by dependent libraries not being found,
or linker errors, etc. I would suggest to run `ldd` on the .so itself
(from glibc), and see what the output is.

Grafts are applied after all packages have been built, so it is normal
that the build environment would see and use the ungrafted gtk.

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmQtLUoQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaivOXC/9xZKpnnPSXRHmMvBxaKnM00JvEpTyJ0eOy
Ji6aIXQDZUJgTBDHe179purYV6xAgjluNEHtryLFFM9G02MW3arqho0RMDgoNRBL
gQiAVfJnM58FrCN3eUwqu9P22RjpcPrQIAUW8EtZyFt1FM5Z5pSgZ6al9/upIcpN
7Svpi4F1Jg55CqusArcIf1nQFi3e+ImBgpDymaCKPrwKVX0ODomBfX0zqA15nQ2b
LjkadkFMeZr5aRRniSZVNTexaN8xy778I2GKtvAMVtkC0r7fFFgZJQaL0iyLxiyD
I9MtMq52oFXVrByrMvmEHdk7GwgSP/Row5xxsyA1SCUu/HhYHnamS6SWm4kbfAcL
E2nQWIu2wxMdaNrCgSQi8GJvMa8VejjmJM6s5N0PmcsVRXzF2Z0q3LbLxtdrRtWp
T9a1GhJG3/xxKbHK5DZ5X7fEO7lK2fKWiGV86K64B2AUpI54TqPmGPbn6rCjlhoF
Ccz7nuBzVbtSzmYNhSs1hTRqbinREE8=
=3lTW
-----END PGP SIGNATURE-----

C
C
Collin J. Doering wrote on 5 Apr 2023 18:59
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 62672@debbugs.gnu.org)
877cuqmf8t.fsf@rekahsoft.ca
Hi Josselin,

Thanks for your quick reply. It appears that all dynamic libraries referenced by libgtk.so are correctly referenced (and not missing):

Toggle snippet (71 lines)
$ ldd /gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libgtk-4.so.1
linux-vdso.so.1 (0x00007fff6435f000)
libwayland-client.so.0 => /gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libwayland-client.so.0 (0x00007f0058b89000)
libwayland-egl.so.1 => /gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libwayland-egl.so.1 (0x00007f0058b84000)
libgmodule-2.0.so.0 => /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libgmodule-2.0.so.0 (0x00007f0058b7d000)
libglib-2.0.so.0 => /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libglib-2.0.so.0 (0x00007f00580cc000)
libgobject-2.0.so.0 => /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libgobject-2.0.so.0 (0x00007f0058b23000)
libgio-2.0.so.0 => /gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libgio-2.0.so.0 (0x00007f0057ee6000)
libpangocairo-1.0.so.0 => /gnu/store/6zfdna9yh2y35dps8h17w4sp6ggvnmwi-pango-next-1.50.4/lib/libpangocairo-1.0.so.0 (0x00007f0058b10000)
libpango-1.0.so.0 => /gnu/store/6zfdna9yh2y35dps8h17w4sp6ggvnmwi-pango-next-1.50.4/lib/libpango-1.0.so.0 (0x00007f0058aa9000)
libharfbuzz.so.0 => /gnu/store/f6ibajh7x233cvr30c2p314l2absk36h-harfbuzz-2.8.2/lib/libharfbuzz.so.0 (0x00007f0057dfb000)
libcairo.so.2 => /gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/lib/libcairo.so.2 (0x00007f0057cda000)
libfribidi.so.0 => /gnu/store/v5x6f3dml69pmn4pfkl51j6y03v6rlsg-fribidi-1.0.9/lib/libfribidi.so.0 (0x00007f0058a8b000)
libcairo-gobject.so.2 => /gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/lib/libcairo-gobject.so.2 (0x00007f0058a7d000)
libfontconfig.so.1 => /gnu/store/3r5sl1l02kjxzw3gicjpjz4kw6v4rgs9-fontconfig-minimal-2.13.94/lib/libfontconfig.so.1 (0x00007f0057c8f000)
libgdk_pixbuf-2.0.so.0 => /gnu/store/xgiz9rvzvfhwx655lb6jpjx1whc4kjg8-gdk-pixbuf-2.42.4/lib/libgdk_pixbuf-2.0.so.0 (0x00007f0057c69000)
libepoxy.so.0 => /gnu/store/kxa5gvaydh012g4ar7xcvj4fq9wqlsmd-libepoxy-1.5.10/lib/libepoxy.so.0 (0x00007f0057b33000)
libm.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm.so.6 (0x00007f00579f2000)
libgraphene-1.0.so.0 => /gnu/store/98f762si3nl2qmchqf8ni22zw32cimg5-graphene-1.10.6/lib/libgraphene-1.0.so.0 (0x00007f00579d4000)
libXi.so.6 => /gnu/store/3s0xcy15rkh08y8cd50skbs5b4js8zb5-libxi-1.7.10/lib/libXi.so.6 (0x00007f0058a68000)
libX11.so.6 => /gnu/store/fa43ijbrb96x08621qigxxiphp503lsi-libx11-1.7.3.1/lib/libX11.so.6 (0x00007f0057893000)
libpangoft2-1.0.so.0 => /gnu/store/6zfdna9yh2y35dps8h17w4sp6ggvnmwi-pango-next-1.50.4/lib/libpangoft2-1.0.so.0 (0x00007f0057879000)
libcloudproviders.so.0 => /gnu/store/h1dsawqf4s4q7ypxs6ijs7d5022m7x0v-libcloudproviders-0.3.1/lib/libcloudproviders.so.0 (0x00007f0057862000)
libtracker-sparql-3.0.so.0 => /gnu/store/c5zz7lhl1qnzd9a493a418z8wrg2ibwq-tracker-3.4.2/lib/libtracker-sparql-3.0.so.0 (0x00007f0057795000)
libpng16.so.16 => /gnu/store/p7iq81hxxyk9zy7a9dngbf16zm8d4klx-libpng-1.6.37/lib/libpng16.so.16 (0x00007f005775f000)
libtiff.so.5 => /gnu/store/343iqv9hvbvzp2in0hs03dvygccrcapl-libtiff-4.3.0/lib/libtiff.so.5 (0x00007f00576dd000)
libjpeg.so.62 => /gnu/store/g5hf1zhqlcyx9vw3q1xa52bgddaqsfm5-libjpeg-turbo-2.0.5/lib/libjpeg.so.62 (0x00007f0057646000)
librt.so.1 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/librt.so.1 (0x00007f005763c000)
libxkbcommon.so.0 => /gnu/store/5sdcrp4591sb2m3h6903vhpdb6zy1cnm-libxkbcommon-1.3.0/lib/libxkbcommon.so.0 (0x00007f00575f6000)
libXext.so.6 => /gnu/store/4fhg8f8c6q647v7pysbng3j30frg0hcl-libxext-1.3.4/lib/libXext.so.6 (0x00007f00575e0000)
libXcursor.so.1 => /gnu/store/mx0bsijgajia8b0s7zfsc135ichy111d-libxcursor-1.2.0/lib/libXcursor.so.1 (0x00007f00575d4000)
libXdamage.so.1 => /gnu/store/i4yh9pwl39qvl9nf8q48gmjgq3wxi36b-libxdamage-1.1.5/lib/libXdamage.so.1 (0x00007f00575cf000)
libXfixes.so.3 => /gnu/store/7rwz6yjir4ysnhskcw5k8azksjwqd6pa-libxfixes-6.0.0/lib/libXfixes.so.3 (0x00007f00575c6000)
libXrandr.so.2 => /gnu/store/25k894kwhf4ljw1nl9rz6rm0c9sz5qaz-libxrandr-1.5.2/lib/libXrandr.so.2 (0x00007f00575b9000)
libXinerama.so.1 => /gnu/store/6h8skg2n4gpbi0bwfmw6qyh03phic6dm-libxinerama-1.1.4/lib/libXinerama.so.1 (0x00007f00575b4000)
libcairo-script-interpreter.so.2 => /gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/lib/libcairo-script-interpreter.so.2 (0x00007f005758b000)
libpthread.so.0 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0 (0x00007f005756b000)
libc.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6 (0x00007f00573a9000)
libffi.so.7 => /gnu/store/wgqhlc12qvlwiklam7hz2r311fdcqfim-libffi-3.3/lib/libffi.so.7 (0x00007f005739c000)
libdl.so.2 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl.so.2 (0x00007f0057397000)
libpcre.so.1 => /gnu/store/di5bqb45hi5lvp2q08hlxqjdcl9phjb1-pcre-8.45/lib/libpcre.so.1 (0x00007f005731d000)
libz.so.1 => /gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1 (0x00007f0057300000)
libmount.so.1 => /gnu/store/5583c2za2jsn9g6az79rnksgvigwnsk7-util-linux-2.37.2-lib/lib/libmount.so.1 (0x00007f00572a3000)
libresolv.so.2 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libresolv.so.2 (0x00007f005728a000)
libthai.so.0 => /gnu/store/2zlx5p93icsrqvc0w3lzgkc6dd3wd4jl-libthai-0.1.28/lib/libthai.so.0 (0x00007f005727c000)
libfreetype.so.6 => /gnu/store/ak70pk2hjks17cx7zjdmdmzpcpiy9gpi-freetype-2.10.4/lib/libfreetype.so.6 (0x00007f00571cc000)
libgraphite2.so.3 => /gnu/store/z6d288h1g876vypda400nhh224yz49im-graphite2-1.3.13/lib/libgraphite2.so.3 (0x00007f00571a9000)
libgcc_s.so.1 => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0x00007f005718f000)
libpixman-1.so.0 => /gnu/store/j8x167zaka2h6pxk7wiq5zkg67hzf8a2-pixman-0.40.0/lib/libpixman-1.so.0 (0x00007f00570e5000)
libxcb-shm.so.0 => /gnu/store/v8raqm2shh9azkl71107p53j55hir306-libxcb-1.14/lib/libxcb-shm.so.0 (0x00007f00570e0000)
libxcb.so.1 => /gnu/store/v8raqm2shh9azkl71107p53j55hir306-libxcb-1.14/lib/libxcb.so.1 (0x00007f00570b7000)
libxcb-render.so.0 => /gnu/store/v8raqm2shh9azkl71107p53j55hir306-libxcb-1.14/lib/libxcb-render.so.0 (0x00007f00570a7000)
libXrender.so.1 => /gnu/store/jh778dla5w316bsfc63q8fnhn87j81lw-libxrender-0.9.10/lib/libXrender.so.1 (0x00007f0057098000)
libbz2.so.1.0 => /gnu/store/s3hl12jxz9ybs7nsy7kq7ybzz7qnzmsg-bzip2-1.0.8/lib/libbz2.so.1.0 (0x00007f0057085000)
libexpat.so.1 => /gnu/store/iwcw80p8lkqsqbvchjvypvl06qlbjc3d-expat-2.4.1/lib/libexpat.so.1 (0x00007f0057054000)
/gnu/store/ayc9r7162rphy4zjw8ch01pmyh214h82-glibc-2.33/lib/ld-linux-x86-64.so.2 (0x00007f0058ba0000)
libXau.so.6 => /gnu/store/9k6slxs8ynz46h85bcy3zk2mx0nn8rpf-libxau-1.0.9/lib/libXau.so.6 (0x00007f005704d000)
libXdmcp.so.6 => /gnu/store/dfzp4rhkzqqagx3djn2kcnaflz1m8446-libxdmcp-1.1.3/lib/libXdmcp.so.6 (0x00007f0057045000)
libbsd.so.0 => /gnu/store/7b5qsjh2cbhwnqbdicvl81496k7b0g0j-libbsd-0.10.0/lib/libbsd.so.0 (0x00007f005702c000)
libicuuc.so.69 => /gnu/store/bjycxjjkp1da53ijsa4hfdrz9mcgg55h-icu4c-69.1/lib/libicuuc.so.69 (0x00007f0056e3b000)
libicui18n.so.69 => /gnu/store/bjycxjjkp1da53ijsa4hfdrz9mcgg55h-icu4c-69.1/lib/libicui18n.so.69 (0x00007f0056a00000)
libjson-glib-1.0.so.0 => /gnu/store/vp510k7i9lqan4d61nddlhhgdigbcx14-json-glib-1.6.2/lib/libjson-glib-1.0.so.0 (0x00007f0056e0c000)
libxml2.so.2 => /gnu/store/g3y6ifhm0751vgsxv90yipfw6mk189kj-libxml2-2.9.12/lib/libxml2.so.2 (0x00007f0056892000)
libsqlite3.so.0 => /gnu/store/xmzx5mzv4863yw9kmr2ykndgp37p8if0-sqlite-3.36.0/lib/libsqlite3.so.0 (0x00007f0056757000)
liblzma.so.5 => /gnu/store/c8isj4jq6knv0icfgr43di6q3nvdzkx7-xz-5.2.5/lib/liblzma.so.5 (0x00007f0056de3000)
libblkid.so.1 => /gnu/store/5583c2za2jsn9g6az79rnksgvigwnsk7-util-linux-2.37.2-lib/lib/libblkid.so.1 (0x00007f0056d8e000)
libdatrie.so.1 => /gnu/store/qlz21x91bs9n3f8nangfsk6g5rfqxvaz-libdatrie-0.2.13/lib/libdatrie.so.1 (0x00007f0056d84000)
libicudata.so.69 => /gnu/store/bjycxjjkp1da53ijsa4hfdrz9mcgg55h-icu4c-69.1/lib/libicudata.so.69 (0x00007f0054a00000)
libstdc++.so.6 => /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/libstdc++.so.6 (0x00007f0056582000)

You'll noticed linux-vdso.so.1 doesn't reference a file but afaik this is expected as its a virtual library provided by the kernel.

Toggle quote (4 lines)
> These errors can also be caused by dependent libraries not being found,
> or linker errors, etc. I would suggest to run `ldd` on the .so itself
> (from glibc), and see what the output is.

This doesn't appear to be the case. Did I miss something?

Toggle quote (3 lines)
> Grafts are applied after all packages have been built, so it is normal
> that the build environment would see and use the ungrafted gtk.

Yes, but that makes the error all the more confusing; the original error says that it can't find "/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libgtk-4.so.1", however this is the ungrafted gtk package, so it SHOULD (afaik) exist throughout the build. Further, when I enter a simulated build environment, the file does indeed exist.

Thanks again for you ongoing help and support!

On 05 Apr 2023 at 10:11, Josselin Poiret <dev@jpoiret.xyz> wrote:

Toggle quote (32 lines)
> [[PGP Signed Part:Undecided]]
> Hi Collin,
>
> "Collin J. Doering" via Bug reports for GNU Guix <bug-guix@gnu.org>
> writes:
>
>> Hi team Guix!
>>
>> I was working on packaging taffybar (https://github.com/taffybar/taffybar), which depends
>> on haskell-gi (https://github.com/haskell-gi/haskell-gi) - haskell bindings for
>> goject-introspection capable libraries. While packaging gi-gdk, I hit this error:
>>
>> --8<---------------cut here---------------start------------->8---
>> ** (process:23): WARNING **: 00:09:56.407: Failed to load shared library
>> '/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libgtk-4.so.1' referenced by the
>> typelib: libgtk-4.so.1: cannot open shared object file: No such file or directory
>> Could not resolve symbol "gdk_device_pad_get_type" in namespace "Gdk-4.0"
>> CallStack (from HasCallStack):
>> error, called at lib/Data/GI/CodeGen/LibGIRepository.hs:202:16 in haskell-gi-0.26.4-HCp1omjln8S5hdZ8Oexk5N:Data.GI.CodeGen.LibGIRepository
>> error: in phase 'configure': uncaught exception:
>> --8<---------------cut here---------------end--------------->8---
>
> These errors can also be caused by dependent libraries not being found,
> or linker errors, etc. I would suggest to run `ldd` on the .so itself
> (from glibc), and see what the output is.
>
> Grafts are applied after all packages have been built, so it is normal
> that the build environment would see and use the ungrafted gtk.
>
> Best,


J
J
John Kehayias wrote on 5 Apr 2023 21:55
(name . Collin J. Doering)(address . collin@rekahsoft.ca)
87cz4i85pf.fsf@protonmail.com
Hi Collin and Josselin,

I haven't fully read this thread but wanted to chime in with work I did
but never finalized to upstream here. In short, I did get taffybar to
build and run if I recall. There was a lot of fussing with versions,
some Haskell packages that were broken/undergoing some breaking changes
at the time...I don't remember the details, sorry.


Checking now taffybar does not build (some dependent package failing,
looks like needs an input change) but ghc-gi-gdk does. This should be
the bulk of the work you need beyond polishing (linting, license checks,
all that). It is a lot of packages, many are the autogenerated
haskell-gi packages as I'm sure you are familiar.

On the gobject-introspection front, I do remember needing some tinkering
there for cairo, and ended up using what was suggested here:

I haven't used Taffybar much since I went back to my lisp land (StumpWM)
but hopefully this is helpful. Some Haskell experts can chime in with
other details or polishing once it builds.

Let me know if you need help parsing this early and rough packaging I
did, though I think it shouldn't take much to get it to build again
(famous last words, I know).

John
C
C
Collin J. Doering wrote on 5 Apr 2023 22:21
(name . John Kehayias)(address . john.kehayias@protonmail.com)
87355em5n0.fsf@rekahsoft.ca
Hi John,

Thanks for taking the time to chime in, much appreciated!

Toggle quote (2 lines)
I took a look at your repo and found that our definition of ghc-gi-gdk is almost exactly the same (sans some historical differences (eg, using gtk (v4) vs gtk+)).

Toggle quote (4 lines)
> On the gobject-introspection front, I do remember needing some tinkering
> there for cairo, and ended up using what was suggested here:
> https://issues.guix.gnu.org/49122#4

Interesting! Sadly I rediscovered this and provided a very similar solution in the first message of this bug report (with the help of a similar issue in nix). imho we should adjust the goject-introspection package to include working cairo typelib files.

Toggle quote (6 lines)
> Checking now taffybar does not build (some dependent package failing,
> looks like needs an input change) but ghc-gi-gdk does. This should be
> the bulk of the work you need beyond polishing (linting, license checks,
> all that). It is a lot of packages, many are the autogenerated
> haskell-gi packages as I'm sure you are familiar.

I'll take a closer look this evening whether or not there is some other difference that could be causing the reported build failure.

Toggle quote (2 lines)
> but hopefully this is helpful

Definitely useful insight, thanks again John!

Toggle quote (4 lines)
> Let me know if you need help parsing this early and rough packaging I
> did, though I think it shouldn't take much to get it to build again
> (famous last words, I know).

I don't foresee any issues with understanding whats going on (similarly, famous last works ?) but if I have any questions I'll let you know in this thread.

On 05 Apr 2023 at 19:55, John Kehayias <john.kehayias@protonmail.com> wrote:

Toggle quote (31 lines)
> Hi Collin and Josselin,
>
> I haven't fully read this thread but wanted to chime in with work I did
> but never finalized to upstream here. In short, I did get taffybar to
> build and run if I recall. There was a lot of fussing with versions,
> some Haskell packages that were broken/undergoing some breaking changes
> at the time...I don't remember the details, sorry.
>
> https://gitlab.com/podiki/guix-pod/-/blob/main/taffybar.scm
>
> Checking now taffybar does not build (some dependent package failing,
> looks like needs an input change) but ghc-gi-gdk does. This should be
> the bulk of the work you need beyond polishing (linting, license checks,
> all that). It is a lot of packages, many are the autogenerated
> haskell-gi packages as I'm sure you are familiar.
>
> On the gobject-introspection front, I do remember needing some tinkering
> there for cairo, and ended up using what was suggested here:
> https://issues.guix.gnu.org/49122#4
>
> I haven't used Taffybar much since I went back to my lisp land (StumpWM)
> but hopefully this is helpful. Some Haskell experts can chime in with
> other details or polishing once it builds.
>
> Let me know if you need help parsing this early and rough packaging I
> did, though I think it shouldn't take much to get it to build again
> (famous last words, I know).
>
> John


J
J
Josselin Poiret wrote on 6 Apr 2023 21:33
(name . Collin J. Doering)(address . collin@rekahsoft.ca)(address . 62672@debbugs.gnu.org)
87y1n47qly.fsf@jpoiret.xyz
Hi Collin,

"Collin J. Doering" <collin@rekahsoft.ca> writes:

Toggle quote (16 lines)
> Hi Josselin,
>
> Thanks for your quick reply. It appears that all dynamic libraries referenced by libgtk.so are correctly referenced (and not missing):
> [...]
> You'll noticed linux-vdso.so.1 doesn't reference a file but afaik this is expected as its a virtual library provided by the kernel.
>
>> These errors can also be caused by dependent libraries not being found,
>> or linker errors, etc. I would suggest to run `ldd` on the .so itself
>> (from glibc), and see what the output is.
>
> This doesn't appear to be the case. Did I miss something?
>
> [...]
>
> Yes, but that makes the error all the more confusing; the original error says that it can't find "/gnu/store/91ar3zh59n19rdn00png5r9hxp3k0y13-gtk-4.8.1/lib/libgtk-4.so.1", however this is the ungrafted gtk package, so it SHOULD (afaik) exist throughout the build. Further, when I enter a simulated build environment, the file does indeed exist.

The ENOFILE can happen while loading _any_ dependency of the required
lib, and will be propagated back. Since the file seems to exist in the
development environment as you mentioned, my guess is that some
dependency somewhere seems to be missing somehow. You could try
manually running the `./configure` script or equivalent that's failing,
with LD_DEBUG=libs set in the environment (or even =all), and seeing if
that error still happens/what the error is precisely. If it doesn't
happen, this would be even more suspicious.

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmQvHokQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaiqbrC/9uI7i21XApwL6ZtHlirGEpXWO7BlVznrIh
qQAGgIh8IKWwOsrCj6TFaWiBMbZnZ1jaIsEWiVU9fzGm7C9ZDTsalHKKncsre9Zk
zLRBPPx3ZLVUjIjT+yAfloF8IUomxyFg0h4u8qd3wsez2i7Z1zNp8BGPAUZwINMq
xMAnwPCama6AT8E0l3jCjxIeHRy3atN2X6xsoZwxl00eSZ24h//O0sQfrMjzjxCa
UtMt/tZ6z2FDTZnYX0/rWfxHiRevqlkuY5pNDpLzsJ5tz3t1eoxA3fbhXdOqF1f7
ypW0SmrSPhitWDJTUxXmm1e/dT7D5CkNzRM1BBzD2PFgiNOOOkL9cUl9mON7bTWq
/OgsT/jcEuTIxXRNyIiThYBWGmXPWVVonrBiCeKUOa715VfBMWGVtcOlUhrnwQUm
XfkVqDt68jJOvijs6wXgX6ep59aNfVmdRNX3qRIpph9zb0RuTLU9HnPIFxAqdKhP
OszRhaNpO9umDHU6ObiMmVOgpBXoHqA=
=n1mQ
-----END PGP SIGNATURE-----

?