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 654156 - Add rpm dependency generator, to automatically get Requires/Provides for typelib()
Add rpm dependency generator, to automatically get Requires/Provides for type...
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Igor Gnatenko
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-07-07 13:36 UTC by Vincent Untz
Modified: 2018-02-08 12:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Definitions of the generator (299 bytes, text/plain)
2011-07-07 13:37 UTC, Vincent Untz
  Details
Script to analyze the files (2.33 KB, text/plain)
2011-07-07 13:38 UTC, Vincent Untz
  Details
g-ir-dep-scanner: Scan dependencies of a typelib and give information. (4.46 KB, patch)
2016-04-28 23:19 UTC, Igor Gnatenko
none Details | Review
g-ir-dep-scanner: Scan dependencies of a typelib and give information (4.42 KB, patch)
2016-04-28 23:23 UTC, Igor Gnatenko
rejected Details | Review

Description Vincent Untz 2011-07-07 13:36:29 UTC
In openSUSE, we ship those two files with gobject-introspection, so that a package installing a typelib will get a Provides for it, and a package depending on a typelib will get a Requires for it (this only works for py and js right now).

This results in things like this:

$ rpm -q --provides mutter | grep typelib
typelib(Meta) = 3.0
$ rpm -q --requires gnome-shell | grep typelib
typelib(Clutter)  
typelib(Cogl)  
typelib(GConf)  
typelib(GLib)  
typelib(GObject)  
typelib(Gdk)  
typelib(GdkPixbuf)  
typelib(Gdm)  
typelib(Gio)  
typelib(Gkbd)  
typelib(GnomeBluetoothApplet)  
typelib(Gtk)  
typelib(Gvc)  
typelib(Meta)  
typelib(NMClient)  
typelib(NetworkManager)  
typelib(Pango)  
typelib(Polkit)  
typelib(PolkitAgent)  
typelib(Shell)  
typelib(St)  
typelib(TelepathyGLib)  
typelib(TelepathyLogger)  
typelib(UPowerGlib)

I think this could be shipped upstream so that all rpm-based distro can use this.
Comment 1 Vincent Untz 2011-07-07 13:37:43 UTC
Created attachment 191450 [details]
Definitions of the generator

This should get installed in /usr/lib/rpm/fileattrs/
Comment 2 Vincent Untz 2011-07-07 13:38:08 UTC
Created attachment 191451 [details]
Script to analyze the files
Comment 3 Vincent Untz 2011-07-07 13:38:29 UTC
All this work was done by Dominique Leuenberger, btw :-)
Comment 4 Dan Winship 2011-07-07 15:14:32 UTC
drive-by comment: we need this for gsettings schemas too. Very few packages in Fedora depend on gsettings-desktop-schemas, which is kinda bad given the "abort on missing schema" thing.
Comment 5 Matthias Clasen 2011-07-08 12:07:02 UTC
Sounds good to me, in principle.

For Fedora, we still need to get this accepted by the packaging committee, but that shouldn't preclude its upstream inclusion.
Comment 6 Matthias Clasen 2011-07-08 19:54:10 UTC
Sent mail to the packaging committee now:

http://lists.fedoraproject.org/pipermail/packaging/2011-July/007832.html
Comment 7 Colin Walters 2011-07-10 16:51:58 UTC
I don't understand why the indirection; while it's true that a JavaScript or Python script depends on the typelib, it *also* depends on the native library.

So why not just have this dependency scanner emit that?  For example, a Requires: libglib-2.0.so.0()(64bit) or whatever.

Note that even if going with the indirection approach, this script really needs to handle versions, otherwise it's going to fail in the most important cases (like gtk2 versus gtk3).  In fact, I'd say it should *only* support the versioned case (and we should really deprecate unversioned imports in both JS and Python).
Comment 8 Vincent Untz 2011-07-10 17:35:13 UTC
(In reply to comment #7)
> I don't understand why the indirection; while it's true that a JavaScript or
> Python script depends on the typelib, it *also* depends on the native library.
> 
> So why not just have this dependency scanner emit that?  For example, a
> Requires: libglib-2.0.so.0()(64bit) or whatever.

Because there might be reasons to not have the typelib in the same package as the library (on Debian, for instance, it's a different package). What we know for sure is that the typelib must depend, packaging-wise, on the library. We don't know more than that.

> Note that even if going with the indirection approach, this script really needs
> to handle versions, otherwise it's going to fail in the most important cases
> (like gtk2 versus gtk3).

There's already preliminary support for that (although not for all forms), but yes, we probably want to complete (or rewrite) that.

> In fact, I'd say it should *only* support the
> versioned case (and we should really deprecate unversioned imports in both JS
> and Python).

I think that'd be wrong, unless unversioned imports in js/python get unsupported. It's really too easy to break packaging because of this.
Comment 9 Toshio Kuratomi 2011-07-20 16:18:54 UTC
Fedora Packaging Committee discussed this briefly and decided that we don't have enough information to decide on most things.  Asked some questions here that weren't answered:
  http://lists.fedoraproject.org/pipermail/packaging/2011-July/007833.html

One thing that we did agree on at our meeting today, though, was that typelib() is a bit generic.  If you could namespace it (something like goi-typelib() was proposed at the meeting).

These Requires and Provides are a bit "interesting".  It would be nice if they could be coordinated across distros but putting them into project packages upstream runs the risk of not getting coordination across projects.  namespacing is one way to help with this.  Another might be to coordinate this with rpm.org (even if they don't want to provide the dep generators in rpm itself, maybe we could document on their wiki what dep namespaces are being used.)

Regarding the dep-gen script implementation, the message I linked has some comments about shortcomings in the python extraction.  Relevant to the talk about versioning is that at least the comments about extracting versioned deps for python is wrong.
Comment 10 Colin Walters 2012-04-26 20:47:08 UTC
A quick update on my thoughts on this; basically 0) is a blocker for me merging this, the rest are somewhat optional but would be nice.

0) Must support versioned syntax - otherwise we get incorrect results for people who try to Do The Right Thing.

1) Shell script is really not an ideal language for, well just about anything, but parsing source code is a particular low point.  I guess this goes along with Toshio's comments about Python syntax handling.

2) No objections to goi-typelib() over typelib().

3) Does it really work to use /usr/lib/rpm/fileattrs for all current RPM consumers or do we need configure logic here?

4) The implementation of function find_provides is wrong - we should only add Provides for typelibs in $libdir/girepository-1.0.  Otherwise we'll pick up private typelibs (like /usr/lib64/gnome-shell/Shell-0.1.typelib which no component outside of gnome-shell should be using)
Comment 11 Vincent Untz 2012-04-26 21:01:17 UTC
(In reply to comment #10)
> 0) Must support versioned syntax - otherwise we get incorrect results for
> people who try to Do The Right Thing.

This is already the case (unless I misunderstand what you mean):

$ rpm -q --requires gnome-shell | grep typelib | grep Meta
typelib(Meta)  
typelib(Meta) = 3.0

(interesting that we have both -- that's because the shell is using versioned and non-versioned imports)

> 3) Does it really work to use /usr/lib/rpm/fileattrs for all current RPM
> consumers or do we need configure logic here?

Good question. Dominique, do you know? I'd think it's standard (we can always add the configure logic later if needed).

> 4) The implementation of function find_provides is wrong - we should only add
> Provides for typelibs in $libdir/girepository-1.0.  Otherwise we'll pick up
> private typelibs (like /usr/lib64/gnome-shell/Shell-0.1.typelib which no
> component outside of gnome-shell should be using)

typelib(Meta) is exactly one example showing why we need this: mutter installs its typelib in /usr/lib/mutter/Meta-3.0.typelib. I agree it's not an amazing thing, though :/
Comment 12 Vincent Untz 2012-04-26 21:07:49 UTC
For reference, the latest files are available at https://build.opensuse.org/package/files?package=gobject-introspection&project=GNOME%3AFactory (it's likely that we had some changes since last July).
Comment 13 André Klapper 2015-02-07 17:17:33 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 14 Igor Gnatenko 2016-04-28 23:19:21 UTC
Created attachment 326974 [details] [review]
g-ir-dep-scanner: Scan dependencies of a typelib and give information.

This allows distributions to create automatic dependency tracking coming
from .typelib files.

The dependencies identified at this time are:
typelib - based dependencies
shared library - dependencies

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=654156
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
Comment 15 Igor Gnatenko 2016-04-28 23:23:17 UTC
Created attachment 326975 [details] [review]
g-ir-dep-scanner: Scan dependencies of a typelib and give information

This allows distributions to create automatic dependency tracking coming
from .typelib files.

The dependencies identified at this time are:
typelib - based dependencies
shared library - dependencies

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=654156
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
Comment 16 Dominique Leuenberger 2016-04-29 07:12:34 UTC
(In reply to Igor Gnatenko from comment #15)
> Created attachment 326975 [details] [review] [review]
> g-ir-dep-scanner: Scan dependencies of a typelib and give information
>

Note that this bug is not about the scanner itself: the introduction of the same is handled in bug 665672  - Don't mix up things or patches go lost in one or the other.
Comment 17 Dominique Leuenberger 2016-04-29 07:13:34 UTC
Review of attachment 326975 [details] [review]:

Patch does not belong to this bug - let's not duplicate the patches in multiple bugs. This only leads to nobody knowing which patch should be used in the end.
Comment 18 Igor Gnatenko 2016-04-29 08:28:49 UTC
(In reply to Dominique Leuenberger from comment #17)
> Review of attachment 326975 [details] [review] [review]:
> 
> Patch does not belong to this bug - let's not duplicate the patches in
> multiple bugs. This only leads to nobody knowing which patch should be used
> in the end.

ah, I didn't know about that bug.
Comment 19 GNOME Infrastructure Team 2018-02-08 12:07:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/53.