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

gtk doesn't export symbol that is listed in GIR file #55692

Closed
mdorman opened this issue Feb 13, 2019 · 10 comments
Closed

gtk doesn't export symbol that is listed in GIR file #55692

mdorman opened this issue Feb 13, 2019 · 10 comments
Labels
0.kind: bug 0.kind: regression Something that worked before working no longer 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@mdorman
Copy link
Contributor

mdorman commented Feb 13, 2019

Issue description

(At least) Haskell projects using gtk can't be built:

Building library for termonad-1.1.0.0..
[ 1 of 13] Compiling Paths_termonad   ( dist/build/autogen/Paths_termonad.hs, dist/build/Paths_termonad.o )
[ 2 of 13] Compiling Termonad.Prelude ( src/Termonad/Prelude.hs, dist/build/Termonad/Prelude.o )
[ 3 of 13] Compiling Termonad.Gtk     ( src/Termonad/Gtk.hs, dist/build/Termonad/Gtk.o )
[ 4 of 13] Compiling Termonad.Config.Vec ( src/Termonad/Config/Vec.hs, dist/build/Termonad/Config/Vec.o )

<no location info>: error:
    ghc: panic! (the 'impossible' happened)
  (GHC version 8.6.3 for x86_64-unknown-linux):
	Dynamic linker not initialised

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

[ 5 of 13] Compiling Termonad.Types   ( src/Termonad/Types.hs, dist/build/Termonad/Types.o )
[ 6 of 13] Compiling Termonad.Lenses  ( src/Termonad/Lenses.hs, dist/build/Termonad/Lenses.o )

<no location info>: error:
    ghc: panic! (the 'impossible' happened)
  (GHC version 8.6.3 for x86_64-unknown-linux):
	Dynamic linker not initialised

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

[10 of 13] Compiling Termonad.Config  ( src/Termonad/Config.hs, dist/build/Termonad/Config.o )

src/Termonad/Config.hs:59:1: warning: [-Wunused-imports]
    The import of ‘Termonad.Prelude’ is redundant
      except perhaps to import instances from ‘Termonad.Prelude’
    To import instances alone, use: import Termonad.Prelude()
   |
59 | import Termonad.Prelude hiding ((\\), index)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[11 of 13] Compiling Termonad.XML     ( src/Termonad/XML.hs, dist/build/Termonad/XML.o )

<no location info>: error:
    <command line>: can't load .so/.DLL for: /nix/store/bxn1z7cd6xfk0sbf7lfx7b494i0rkdd2-gi-gtk-3.0.27/lib/ghc-8.6.3/x86_64-linux-ghc-8.6.3/libHSgi-gtk-3.0.27-HjUeo8DG7OPGZlez0Dvqrr-ghc8.6.3.so (/nix/store/bxn1z7cd6xfk0sbf7lfx7b494i0rkdd2-gi-gtk-3.0.27/lib/ghc-8.6.3/x86_64-linux-ghc-8.6.3/libHSgi-gtk-3.0.27-HjUeo8DG7OPGZlez0Dvqrr-ghc8.6.3.so: undefined symbol: gtk_cell_accessible_parent_get_row_header_cells)

Per https://bugs.archlinux.org/task/61486, the problem seems to be a mismatch between what is actually exported by the library and what the interface file says is available (oh, for a single source of truth!).

https://gitlab.gnome.org/GNOME/gtk/commit/95c0f07295fd300ab7f3416a39290ae33585ea6c has a patch that may resolve it---I'm going to try, but of course it means recompiling everything that touches Gtk. Sigh.

Steps to reproduce

Attempt to install the termonad haskell package.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.20.7, NixOS, 19.03.git.8489ee3 (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2
  • channels(root): ""
  • channels(mdorman): ""
  • nixpkgs: /var/nixup/nixpkgs
@mdorman
Copy link
Contributor Author

mdorman commented Feb 13, 2019

I can confirm that the referenced patch resolves the issue.

@vcunat
Copy link
Member

vcunat commented Feb 13, 2019

This issue isn't relevant to 18.09, right? EDIT: termonad seems to compile fine for me as of 89bf747.

@mdorman
Copy link
Contributor Author

mdorman commented Feb 13, 2019

I track master, so I'm happy to take your word for it.

@srhb
Copy link
Contributor

srhb commented Feb 14, 2019

It affects gtk 3.24.3, 3.24.4 and 3.24.5 fwiw.

For anyone who wants a local fix on unstable, including the patch in just the gtk3 passed to whatever haskell-gi components are used should probably do it. For instance, taffybar links correctly with just gi-gdk depending on a patched gtk3.

@mdorman
Copy link
Contributor Author

mdorman commented Feb 17, 2019

It affects gtk 3.24.3, 3.24.4 and 3.24.5 fwiw.

For anyone who wants a local fix on unstable, including the patch in just the gtk3 passed to whatever haskell-gi components are used should probably do it. For instance, taffybar links correctly with just gi-gdk depending on a patched gtk3.

I haven't been able to construct an expression that does this; could you perhaps share your solution?

@srhb
Copy link
Contributor

srhb commented Feb 18, 2019

@mdormon For taffybar specifically, this overlay should work:

self: super:
let
  gtk3 = super.gtk3.overrideAttrs (oa: {
    patches = [
      (self.fetchpatch {
        # missing symbols but exported from gir
        url = https://gitlab.gnome.org/GNOME/gtk/commit/95c0f07295fd300ab7f3416a39290ae33585ea6c.patch;
        sha256 = "0z9w7f39xcn1cbcd8jhx731vq64nvi5q6kyc86bq8r00daysjwnl";
      })
    ];
  });
in
{
  haskellPackages = with self.haskell.lib; super.haskellPackages.extend (hself: hsuper: {
    gi-gdk = hsuper.gi-gdk.override { inherit gtk3; };
    taffybar = hsuper.taffybar.overrideAttrs (oa : {
      src = self.fetchFromGitHub {
        owner = "taffybar";
        repo = "taffybar";
        rev = "e382599358bb06383ba4b08d469fc093c11f5915";
        sha256 = "0qncwpfz0v2b6nbdf7qgzl93kb30yxznkfk49awrz8ms3pq6vq6g";
      };
    });
  });
}

@vcunat vcunat closed this as completed in d576825 Feb 20, 2019
@puffnfresh
Copy link
Contributor

Using master, I still can't build Taffybar:

<command line>: can't load .so/.DLL for: /nix/store/1lvixr2066lb9069826i9r7djhb1lk5c-gi-gtk-3.0.27/lib/ghc-8.6.3/x86_64-linux-ghc-8.6.3/libHSgi-gtk-3.0.27-8Ml40RERHMfClp1aWsK8RM-ghc8.6.3.so (/nix/store/1lvixr2066lb9069826i9r7djhb1lk5c-gi-gtk-3.0.27/lib/ghc-8.6.3/x86_64-linux-ghc-8.6.3/libHSgi-gtk-3.0.27-8Ml40RERHMfClp1aWsK8RM-ghc8.6.3.so: undefined symbol: gtk_cell_accessible_parent_get_row_header_cells)

Did f9a62db undo the change?

@jtojnar jtojnar reopened this Mar 3, 2019
@jtojnar jtojnar added 0.kind: bug 6.topic: GNOME GNOME desktop environment and its underlying platform 0.kind: regression Something that worked before working no longer labels Mar 3, 2019
infinisil added a commit to infinisil/nixpkgs that referenced this issue Mar 8, 2019
Was removed again in f9a62db, but it
was still needed after all, see NixOS#55692 (comment)
infinisil added a commit to infinisil/nixpkgs that referenced this issue Mar 9, 2019
Was removed again in f9a62db, but it
was still needed after all, see NixOS#55692 (comment)
infinisil added a commit that referenced this issue Mar 9, 2019
Was removed again in f9a62db, but it
was still needed after all, see #55692 (comment)

(cherry picked from commit e0cc49c)
@vcunat
Copy link
Member

vcunat commented Mar 10, 2019

This should be fixed again, ATM in staging-next and staging-19.03.

@vcunat vcunat closed this as completed Mar 10, 2019
@rvl
Copy link
Contributor

rvl commented Mar 22, 2019

Thanks @srhb, that overlay helped me today (except I had to change it to oa.patches = oa.patches ++ [ ... ]).

hedning pushed a commit to hedning/nixpkgs that referenced this issue Apr 2, 2019
Was removed again in f9a62db, but it
was still needed after all, see NixOS#55692 (comment)

(cherry picked from commit e0cc49c)
hedning pushed a commit that referenced this issue Apr 4, 2019
Was removed again in f9a62db, but it
was still needed after all, see #55692 (comment)

(cherry picked from commit e0cc49c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 0.kind: regression Something that worked before working no longer 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
None yet
Development

No branches or pull requests

6 participants