haskell-gi icon indicating copy to clipboard operation
haskell-gi copied to clipboard

Couldn't find API description for GLib.time_t

Open swt2c opened this issue 1 year ago • 2 comments

When building haskell-gi in Debian, we started running into this:

Running debian/hlibrary.setup configure --ghc -v2 --package-db=/var/lib/ghc/package.conf.d --prefix=/usr --libdir=/usr/lib/haskell-packages/ghc/lib --libexecdir=/usr/lib --builddir=dist-ghc --ghc-option=-optl-Wl,-z,relro --haddockdir=/usr/lib/ghc-doc/haddock/gi-glib-2.0.29/ --datasubdir=gi-glib --htmldir=/usr/share/doc/libghc-gi-glib-doc/html/ --enable-library-profiling
Non-zero exit code 1.
Using Parsec parser
[1;91mERROR: [97mcouldn't find API description for GLib.time_t[22;94m
Please report this at https://github.com/haskell-gi/haskell-gi/issues[0m
CallStack (from HasCallStack):
  error, called at lib/Data/GI/CodeGen/Util.hs:126:6 in haskell-gi-0.26.7-C46MepbmwZA1H8dt48knUn:Data.GI.CodeGen.Util
  terror, called at lib/Data/GI/CodeGen/Code.hs:556:13 in haskell-gi-0.26.7-C46MepbmwZA1H8dt48knUn:Data.GI.CodeGen.Code
  findAPIByName, called at lib/Data/GI/CodeGen/GObject.hs:17:44 in haskell-gi-0.26.7-C46MepbmwZA1H8dt48knUn:Data.GI.CodeGen.GObject
 at /usr/share/perl5/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm line 109.

I suspect this is due to this being applied in Debian's glib package, which seems to be exposing time_t (and others) in the GIR XML. https://gitlab.gnome.org/GNOME/glib/-/commit/fa45ea2ac9ca2e85321c5d34f8f40f7f9b614db1

swt2c avatar Mar 31 '24 03:03 swt2c

Hi @swt2c, https://github.com/haskell-gi/haskell-gi/pull/430 should address this issue.

iliastsi avatar Apr 01 '24 16:04 iliastsi

Thanks @iliastsi nice fix, much nicer than what I was coming up with.

swt2c avatar Apr 01 '24 23:04 swt2c

Sorry for the noob question, but how exactly can I use the answers and/or updates presented in #430 to solve this? I'm getting this same error but in EndeavourOS/Arch.

c0nradLC avatar May 21 '24 22:05 c0nradLC

Sorry for the noob question, but how exactly can I use the answers and/or updates presented in #430 to solve this? I'm getting this same error but in EndeavourOS/Arch.

@c0nradLC I'm not sure how you're building the package, but if you're using cabal-install then you should be able to add the following to the cabal.project file:

-- Fix "ERROR: couldn't find API description for GLib.time_t"
source-repository-package
  type: git
  location: https://github.com/sheaf/haskell-gi
  tag: ec11dd69ab6a3a9f7f7e967f5f7ffa7d9206cd2a

This allows you to point to a commit in GitHub, before there is a corresponding release on Hackage.

sheaf avatar May 27 '24 13:05 sheaf

Sorry for the noob question, but how exactly can I use the answers and/or updates presented in #430 to solve this? I'm getting this same error but in EndeavourOS/Arch.

@c0nradLC I'm not sure how you're building the package, but if you're using cabal-install then you should be able to add the following to the cabal.project file:

-- Fix "ERROR: couldn't find API description for GLib.time_t"
source-repository-package
  type: git
  location: https://github.com/sheaf/haskell-gi
  tag: ec11dd69ab6a3a9f7f7e967f5f7ffa7d9206cd2a

This allows you to point to a commit in GitHub, before there is a corresponding release on Hackage.

Thank you very much for the answer, I knew it was possible to do something like this but just didn't know how to do it, amazing.

c0nradLC avatar May 29 '24 18:05 c0nradLC

This was fixed in https://github.com/haskell-gi/haskell-gi/commit/8fa06f827d5f7d41a4756576a783d9e682bbd4d5, so I believe this issue can now be closed (I don't have the rights to close an issue on this repository).

sheaf avatar Jun 13 '24 16:06 sheaf