After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621611 - GIRs must not be distributed
GIRs must not be distributed
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal critical
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on: 620268 621717 621718 621719 621724 621725 621726 621727 621728 621729 621730
Blocks:
 
 
Reported: 2010-06-15 06:30 UTC by Yaakov Selkowitz
Modified: 2015-02-07 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Yaakov Selkowitz 2010-06-15 06:30:07 UTC
The directions for integrating gobject-introspection on l.g.o[1], which are being incorporated into current packages, contain a serious flaw:

-dist_gir_DATA = $(INTROSPECTION_GIRS)
+gir_DATA = $(INTROSPECTION_GIRS)

By declaring the .gir dist_, it is shipped in tarballs, but .girs are not truly portable: the namespace shared-library attribute varies by platform (e.g. libatk-1.0.so.0 on Linux, cygatk-1.0-0.dll on Cygwin, libatk-1.0-0.dll on MinGW, libatk-1.0.sl.0 on most HPUXs, libatk-1.0.0.dylib on Darwin, etc.).  

The problem with this occurs with a VPATH (builddir != srcdir) parallel build.  The $builddir .gir is built after the .la is linked, but the %.typelib: %.gir rule picks up the existing $srcdir .gir:

/usr/bin/g-ir-compiler.exe  --includedir=. /usr/src/ports/gnome/atk1.0/atk1.0-1.30.0-1/src/atk-1.30.0/atk/Atk-1.0.gir -o Atk-1.0.typelib

The result is the installed .gir is correct but the .typelib is incorrect, and fails to load due to looking for the wrong platform shared-library.

The fix is to change dist_gir_DATA to gir_DATA, as above.  This will require changes to l.g.o and all modules using gobject-introspection, although perhaps some workaround can be found for Makefile.introspection in the meantime.

[1] http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration
Comment 1 Colin Walters 2010-06-15 12:39:48 UTC
Hmm...can we instead change the shared library attribute to look like:

<namespace
  unix-shared-library="libatk-1.0.so.0"
  cygwin-shared-library="cygatk-1.0-0.dll"
  ...
>

Or actually...even better, we could nuke it entirely and have the typelib compiler run pkg-config --libs.
Comment 2 Yaakov Selkowitz 2010-06-15 19:42:33 UTC
(In reply to comment #1)
> Hmm...can we instead change the shared library attribute to look like:
> 
> <namespace
>   unix-shared-library="libatk-1.0.so.0"
>   cygwin-shared-library="cygatk-1.0-0.dll"
>   ...
> >

Not as it stands now, because shared-library is derived by giscanner when building the gir, either from the .la dlname or from the linked introspection binary.  How would it know what this will look like on all other platforms?

> Or actually...even better, we could nuke it entirely and have the typelib
> compiler run pkg-config --libs.

I don't understand, how would that help?
Comment 3 Colin Walters 2010-06-15 20:01:48 UTC
(In reply to comment #2)
>
> Not as it stands now, because shared-library is derived by giscanner when
> building the gir, either from the .la dlname or from the linked introspection
> binary.  How would it know what this will look like on all other platforms?
> 
> > Or actually...even better, we could nuke it entirely and have the typelib
> > compiler run pkg-config --libs.
> 
> I don't understand, how would that help?

Since the shared-library argument would no longer exist?
Comment 4 Yaakov Selkowitz 2010-06-15 20:49:31 UTC
My apologies, I honestly haven't studied the internals of gobject-introspection.  Without the shared-library attribute, how would the typelib find the C library to do the heavy lifting?
Comment 5 Colin Walters 2010-06-15 21:02:22 UTC
In the .gir we have e.g.:

  <package name="gio-2.0"/>

g-ir-compiler would see that and run `pkg-config --libs gio-2.0` to get the shared library.
Comment 6 Yaakov Selkowitz 2010-06-16 01:10:55 UTC
On #introspection this evening:
<jdahlin> cygwinports: as we /mostly/ run on linux it makes sense so people can use it without having introspection installed
<jdahlin> but it's getting pretty system dependent already so it might just be better to not dist it.
<cygwinports> how is it usable w/o introspection?
<jdahlin> it's usable by bindings who only parses the xml
<cygwinports> but it's only installed if HAVE_INTROSPECTION, per the latest instructions
<cygwinports> http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration
<jdahlin> hmm, right
<jdahlin> let's just remove it from the dist then
Comment 7 Dan Winship 2010-08-02 21:36:19 UTC
this means we should also remove

  DISTCHECK_CONFIGURE_FLAGS = --enable-introspection

right?
Comment 8 Yaakov Selkowitz 2010-08-02 21:59:58 UTC
(In reply to comment #7)
> this means we should also remove
> 
>   DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
> 
> right?

You're right that it should no longer be required, since the source tarball will be identical either way, but it's probably not a bad idea to leave it in anyway to make sure that it builds.  At least it shouldn't hurt.
Comment 9 Johan (not receiving bugmail) Dahlin 2010-09-06 04:35:37 UTC
Closing this bug, there's no more discussion here.
Comment 10 Yaakov Selkowitz 2010-09-19 23:50:19 UTC
For the record, there is another reason not to dist girs: introspection format changes break the build if an incompatible version of g-i is used (bug 622378).
Comment 11 André Klapper 2015-02-07 16:46:19 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]