diamondburned / gotk4

Autogenerated GTK4 bindings for Go
GNU Affero General Public License v3.0
525 stars 20 forks source link

gir-generate failed to decode gir XML #102

Closed OmegaRogue closed 1 year ago

OmegaRogue commented 1 year ago

When trying to run sudo gir-generate, I get the error

2023/03/30 22:59:15 error adding package "gobject-introspection-1.0": failed to parse file "/usr/share/gir-1.0/GTop-2.0.gir": failed to decode gir XML: XML syntax error on line 46: illegal character code U+0004

Looking into that file, there is:

<constant name="EOT_STR" value="" c:type="EOT_STR">
  <source-position filename="include/glibtop/gnuserv.h" line="146"/>
  <type name="utf8" c:type="gchar*"/>
</constant>
diamondburned commented 1 year ago

Yeah, I don't think you can do much other than patching the string off the XML. Go's encoding/xml doesn't like this character.

OmegaRogue commented 1 year ago

This only happens without the nix environment, tho in the nix environment, I can't figure out how to add the package gstreamer properly

diamondburned commented 1 year ago

This only happens without the nix environment

Could it be a Go version issue?

in the nix environment, I can't figure out how to add the package gstreamer properly

Adding buildInputs = pkgs: with pkgs; [ gst_all_1.gstreamer ]; into the base attrs of .nix/default.nix should suffice.

OmegaRogue commented 1 year ago

Could it be a Go version issue?

No, its just that in there the offending package isn't installed there