nsf / gogobject

GObject-introspection based bindings generator
MIT License
47 stars 5 forks source link

Compilation error (pango.go) #2

Closed ghost closed 12 years ago

ghost commented 12 years ago

pango.go:1372[_obj/pango.cgo1.go:1375]: cannot use (unsafe.Pointer)(iter.data) (type unsafe.Pointer) as type unsafe.Pointer in assignment

nsf commented 12 years ago

You should realize that the code you're compiling is generated, I don't have a copy to see what's that. Probably the bug is caused by the fact that you have an old version of pango which has incomplete or incorrect gobject-introspection annotations. Tell me at least the pango version.

And all I can suggest is to blacklist all the APIs that cause errors or update your libs. I said that on the mailing list and I'm happy to repeat it here. Gobject-introspection is a new project, and even at this moment some libraries got commits with annotations fixes, etc. Therefore, unfortunatelly I have to depend on recent versions of them.

I'm pretty sure it's the problem with annotations, because iter.data only appears in GList/GSList unmarshaling code and in your case error tells me that variable "elt" has type unsafe.Pointer, which doesn't make sense. Anyways, it would be nice to know in which function/method that error happens, so I can track it in the pango repo to see what's wrong with it.

ghost commented 12 years ago

Pango version is: 1.29.4

The function is:

func (this0 *GlyphItem) ApplyAttrs(text0 string, list0 *AttrList) []unsafe.Pointer

Would it be possible to add information about the versions you are using to the documentation section?

nsf commented 12 years ago

That's weird, the pango version here is 1.29.4 too. And my pango has that function, but my gir file (/usr/share/gir-1.0/Pango-1.0.gir has it marked as non-introspectable), therefore generator on my setup doesn't generate that function.

I will try to find out why it happens. Also I will add libs I'm using to the README.

nsf commented 12 years ago

Hm, looks like gobject-introspection annotation scanner and generator have some semantics on making values "non-introspectable", I'm using version 1.30.0 of gobject-introspection. Since you're using gentoo and building everything from the source code, probably that's the reason.

nsf commented 12 years ago

As far as I can tell, that was the fix: http://git.gnome.org/browse/gobject-introspection/commit/?id=edb4146278f74030fba9bfd79e21f070f24d4434

Maybe I'm wrong though.

ghost commented 12 years ago

The cause of the problem was that some packages were built prior to upgrading gobject-introspection to 1.30.0, so their gir files were generated with an older version of gobject-introspection.