Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What's introspection and do I need it?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Zarhan
l33t
l33t


Joined: 27 Feb 2004
Posts: 924

PostPosted: Wed Aug 17, 2011 8:57 am    Post subject: What's introspection and do I need it? Reply with quote

I'm running mostly KDE-based desktop. Anyway, the latest emerge -uvDaN world gave me this:

Code:

# emerge -uvDaN world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-apps/module-init-tools-3.16-r1 [3.12-r1] USE="-static" 233 kB
[ebuild   R    ] dev-libs/glib-2.28.8  USE="fam introspection* static-libs -debug -doc (-selinux) -test -xattr" 0 kB                                           
[ebuild   R    ] app-text/poppler-0.16.7  USE="cairo cjk curl cxx introspection* jpeg jpeg2k lcms png qt4 utils xpdf-headers -debug -doc -exceptions" 0 kB
[ebuild   R    ] media-libs/babl-0.1.4  USE="introspection* mmx sse (-altivec)" 0 kB
[ebuild   R    ] dev-python/pygobject-2.28.6  USE="cairo introspection* -doc -examples -libffi -test" 0 kB                                                     
[ebuild   R    ] sys-auth/polkit-0.101-r1  USE="gtk introspection* kde nls pam -debug -doc -examples" 0 kB                                                     
[ebuild   R    ] sys-power/upower-0.9.12  USE="introspection* -debug -doc -ios" 0 kB
[ebuild   R    ] gnome-extra/polkit-gnome-0.101-r1  USE="introspection* -doc -examples" 0 kB                                                                   


What is Introspection, do I need it, what does it do?
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9892
Location: Córdoba (Spain)

PostPosted: Wed Aug 17, 2011 10:42 am    Post subject: Reply with quote

All I can tell you is that's something related to dynamic bindings related to the use of many different language in objective-c code, and that gnome3 will use it intensively. Other than that, it's a mystery to me if this will bring any benefit to the rest of us, mere mortals, that are not related in any way to gnome3.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 7986

PostPosted: Thu Aug 18, 2011 6:19 am    Post subject: Reply with quote

It is, currently, specific to gobject introspection which, as i92guboj pointed out, is itself bound up with use in multiple language bindings for GTK. The current official recommendation from the GNOME team is that everyone should have USE +introspection set with the exception of certain use cases in embedded and server environments.
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9892
Location: Córdoba (Spain)

PostPosted: Thu Aug 18, 2011 7:25 am    Post subject: Reply with quote

desultory wrote:
It is, currently, specific to gobject introspection which, as i92guboj pointed out, is itself bound up with use in multiple language bindings for GTK. The current official recommendation from the GNOME team is that everyone should have USE +introspection set with the exception of certain use cases in embedded and server environments.


When they say "everyone" they mean "everyone using Gnome", don't they? Or did introspection find a use outside its place of birth? I am just curious. I already read some threads on the mailing lists including those you linked above; but it's hard to figure the whole story for someone that's not involved when they talk about so abstract things without any tangible and concrete instances in the real world (you know, real applications or functionality).
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
PanzerKanzler
Guru
Guru


Joined: 04 Dec 2005
Posts: 371
Location: Belgravia, London

PostPosted: Thu Aug 18, 2011 1:08 pm    Post subject: Reply with quote

i92guboj wrote:
When they say "everyone" they mean "everyone using Gnome", don't they?


I'm not convinced that they are aware of the difference there.. :roll:
_________________
If you've got nothing nice to say, you're probably not alone...
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 7986

PostPosted: Fri Aug 19, 2011 5:04 am    Post subject: Reply with quote

i92guboj wrote:
When they say "everyone" they mean "everyone using Gnome", don't they? Or did introspection find a use outside its place of birth?
I suspect that they mean everyone using GTK, aside from those who are fairly careful about picking packages based on languages.

PanzerKanzler wrote:
I'm not convinced that they are aware of the difference there.. :roll:
Is is entirely possible that from their perspective there is no difference. Considering the published plans regarding the use of introspection with regard to GTK it would be an understandable, if presently somewhat tenuous, position to hold.
Back to top
View user's profile Send private message
salahx
Guru
Guru


Joined: 12 Mar 2005
Posts: 408

PostPosted: Fri Aug 19, 2011 7:00 am    Post subject: Reply with quote

Introspection is actually a GLib thing, and not Gtk+ (although Gtk+ uses it too). It allows GObjects written in C to be used by other languages without any (or minimal) extra effort Special comments in C programs using GLib are used to create XML files. These XML files can then either be fed appropriate compiler to generate the binders (with 1 compiler per language) or used at runtime to generate code on the fly. Vala is an example of the former: the .gir files can be passed to vapigen, which generates Vala code to access the GObjects. Python is an example of the latter: by using PyObject the code will be generated on the fly. Introspection isn't limited to languages either: One can use it the generate binding for a different platform, for example, so that GObject can be used by Qt transpartly.

Note, in particular, udev-extras (gudev) is a GLib application which supports introspection.
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9892
Location: Córdoba (Spain)

PostPosted: Fri Aug 19, 2011 7:24 am    Post subject: Reply with quote

So, this promises to the the definitive fix to our particular Tower of Babel when it comes to programming languages, the "one ring to rule them all" and probably also the solution to the current bindingmania as it starts propagating.

But, do you know if there's something concrete that introspection has done for the users, or something that's going to provide soon or in a middle term? Is it maybe aimed to bring the mainstream desktops closer than ever and make them more compatible i.e. to reuse widgets, applets, etc. from one in the others? Is it something that adds options or functionality to gtk+ or glib based applications automatically? Is it something that will allow drag and drop from nautilus to midnight commander?

Or is it just a thing for the programmers? And in such case, why should users care at all about this new use flag (and about introspection itself)? Users do not care about, let's say, the main glib loop, why do they need to care or know about introspection?

I understand the theory, all I am asking is if there's something concrete about the whole introspection thing that users can see with their eyes and play with. We all know what phonon is and have a rough idea that it's used to bring multimedia to KDE, all we know what webkit is and we know it's used to build web browsers, all we know what opengl is and that supporting it via hardware will bring us better and faster graphics; but, for introspection, I have the feeling that we all know what is but no one has an idea what will it do for us, final users (if anything).

:roll:
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
haveimooed
n00b
n00b


Joined: 09 Mar 2009
Posts: 19

PostPosted: Fri Aug 19, 2011 7:47 am    Post subject: Reply with quote

Yes, to paraphrase the question, what do users gain by enabling the introspection useflag? (some features of the programs? or do they perform better? or what?)
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9892
Location: Córdoba (Spain)

PostPosted: Fri Aug 19, 2011 8:52 am    Post subject: Reply with quote

Another way to express my question would be with a direct example.

For example, qt-gui has an USE flag called qt3support. This flag when enabled gives support for qt3-like code that some developers have used as a mean to port quickly kde3-based apps while the complete migration to qt4/kde4 takes place. This adds nothing for the final user, and you can safely set USE=-qt3support system wide. If a given program requires that support, it will let you know when you run emerge because the dependency checks will say that it requires x11-libs/qt-gui[qt3support].

On the other side, imlib has a jpeg USE flag, and if you don't enable it then imlib based programs will not show jpeg images, so if you disable that flag you are removing functionality on a silent, non-direct and non-straightforward to guess way, and users will then wonder why fluxbox doesn't show menu icons in Gentoo (used to happen years ago, I have no idea if this still applies).

The question is, which of these two categories would fit introspection into?
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 7986

PostPosted: Fri Aug 19, 2011 8:54 am    Post subject: Reply with quote

The former, complete with the implied rebuild of a sizable toolkit and dependencies when changed.
Back to top
View user's profile Send private message
i92guboj
Moderator
Moderator


Joined: 30 Nov 2004
Posts: 9892
Location: Córdoba (Spain)

PostPosted: Fri Aug 19, 2011 8:59 am    Post subject: Reply with quote

desultory wrote:
The former, complete with the implied rebuild of a sizable toolkit and dependencies when changed.


So, it's perfectly fine to have it disabled globally. Ebuilds needing it should let us know so then we try to emerge them, right?

More and more, taking into account that some of us don't really have a use for >=x11-libs/gtk+-3 and have it masked so we don't have to build a new gtk+ version every week when nothing is using it. And right now, the few introspection consumers that there can be in portage (if there are any at all) would be gtk+3 based.
_________________
Gentoo Handbook | My website
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 7986

PostPosted: Fri Aug 19, 2011 9:06 am    Post subject: Reply with quote

i92guboj wrote:
So, it's perfectly fine to have it disabled globally. Ebuilds needing it should let us know so then we try to emerge them, right?
In theory, yes. Any packages which need it but do not explicitly require it at some point in the dependency tree would have a bug, one that should be trivial to fix in the ebuild.
Back to top
View user's profile Send private message
Yamakuzure
Veteran
Veteran


Joined: 21 Jun 2006
Posts: 1394
Location: Bardowick, Germany

PostPosted: Fri Aug 19, 2011 11:38 am    Post subject: Reply with quote

As a KDE user I have just disabled introspection globally, did a world update (with --newuse, yes.) and everything is still working fine.

btw. sys-fs/udev seems to be the only package that has introspection not enabled by default in its ebuild...
_________________
Boycott systemd!
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2536

PostPosted: Fri Aug 19, 2011 12:09 pm    Post subject: Reply with quote

I tend to run non-GNOME, non-KDE systems, though I do have some bits'n'pieces in order to run specific packages. So just for jollies, I ran "USE="introspection" emerge -ptuvDN world" :
Code:
# USE="introspection" emerge -ptuvDN world

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[nomerge       ] x11-terms/terminal-0.4.8  USE="dbus -debug"
[ebuild   R    ]  x11-libs/vte-0.28.1-r200  USE="introspection* python -debug -doc -glade" 0 kB
[nomerge       ] gnome-base/gdm-2.20.11  USE="branding consolekit pam tcpd -accessibility -afs -debug -dmx -gnome-keyring -ipv6 -remote (-selinux) -xinerama"
[nomerge       ]  x11-libs/gksu-2.0.2  USE="-doc -gnome"
[nomerge       ]   x11-libs/libgksu-2.0.12-r1  USE="nls -doc -static-libs"
[ebuild   R    ]    gnome-base/libgtop-2.28.3  USE="introspection* -debug -doc" 0 kB
[ebuild   R    ] sys-power/upower-0.9.12  USE="introspection* -debug -doc -ios" 0 kB
[nomerge       ] x11-libs/libgksu-2.0.12-r1  USE="nls -doc -static-libs"
[nomerge       ]  gnome-base/gconf-2.32.3  USE="ldap policykit -debug -doc (-introspection)"
[nomerge       ]   sys-auth/polkit-0.101-r1  USE="doc examples gtk introspection* nls pam -debug -kde"
[ebuild   R    ]    gnome-extra/polkit-gnome-0.101-r1  USE="introspection* -doc -examples" 0 kB
[nomerge       ] x11-terms/terminal-0.4.8  USE="dbus -debug"
[nomerge       ]  xfce-base/exo-0.6.0  USE="python -debug"
[nomerge       ]   dev-python/pygtk-2.24.0-r1  USE="-doc -examples -test"
[nomerge       ]    x11-libs/gtk+-2.24.4  USE="cups introspection* (-aqua) -debug -doc -examples -test -vim-syntax -xinerama"
[nomerge       ]     net-print/cups-1.4.6-r2  USE="X acl dbus gnutls java jpeg ldap pam perl png python ssl threads tiff -debug -kerberos -php -samba -slp -static-libs -xinetd" LINGUAS="-da -de -es -eu -fi -fr -id -it -ja -ko -nl -no -pl -pt -pt_BR -ru -sv -zh -zh_TW"
[ebuild   R    ]      app-text/poppler-0.16.7  USE="cairo curl cxx introspection* jpeg jpeg2k lcms png qt4 utils xpdf-headers -cjk -debug -doc -exceptions" 0 kB
[ebuild   R    ]    dev-python/pygobject-2.28.6  USE="cairo introspection* -doc -examples -libffi -test" 0 kB
[ebuild   R    ]    x11-libs/gtk+-2.24.4  USE="cups introspection* (-aqua) -debug -doc -examples -test -vim-syntax -xinerama" 0 kB
[ebuild   R    ]     x11-libs/pango-1.28.4  USE="X introspection* -debug -doc -test" 0 kB
[ebuild   R    ]     x11-libs/gdk-pixbuf-2.22.1-r2  USE="X introspection* jpeg jpeg2k svg tiff -debug -doc -test" 0 kB
[nomerge       ] sys-power/upower-0.9.12  USE="introspection* -debug -doc -ios"
[ebuild   R    ]  sys-auth/polkit-0.101-r1  USE="doc examples gtk introspection* nls pam -debug -kde" 0 kB
[ebuild   R   ~]  sys-fs/udev-171-r1  USE="acl extras gudev hwdb introspection* keymap -action_modeswitch -build -debug -edd -floppy -rule_generator (-selinux) -test" 0 kB
[nomerge       ] dev-python/pygtksourceview-2.10.1  USE="-debug -doc"
[nomerge       ]  dev-python/pygtk-2.24.0-r1  USE="-doc -examples -test"
[ebuild   R    ]   dev-libs/atk-1.32.0-r1  USE="introspection* nls -doc" 0 kB
[ebuild   R    ]    dev-libs/glib-2.28.8  USE="fam introspection* xattr -debug -doc (-selinux) -static-libs -test" 0 kB

Total: 13 packages (13 reinstalls), Size of downloads: 0 kB


Incidentally, "make xconfig" requires USE="qt3support", but isn't listed as either required or optional on gentoo-sources, vanilla-sources, or genkernel. Moreover, up until a few releases ago, xconfig required genuine qt3, not qt4.x with qt3support. This is all trial'n'error learning.

I'm still not sure what "introspection" buys me. I get the gist that it eases cross-language development, but it would be really handy to see some sort of concrete example.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
neonl
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2007
Posts: 100
Location: Portugal

PostPosted: Sat Aug 20, 2011 11:59 am    Post subject: Reply with quote

Also, apparently some stable packages in Portage (like media-libs/babl-0.1.4, pulled as a dependency by GIMP), in a plain GNOME2 environment, fail to compile when the introspection USE-flag is enabled.
_________________
Core i5 760 | Gentoo x86-64 | Xfce 4.10
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Aug 20, 2011 12:46 pm    Post subject: Reply with quote

neonl wrote:
fail to compile when the introspection USE-flag is enabled.

I think that's because that, if compiling a package with introspection, the introspection part assumes that the lower packages in the compilation chain have also, already been compiled with introspection.

I just enabled it for all, then don't have such tedious compilation-chain errors.
Back to top
View user's profile Send private message
neonl
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2007
Posts: 100
Location: Portugal

PostPosted: Sat Aug 20, 2011 1:14 pm    Post subject: Reply with quote

PaulBredbury wrote:
I think that's because that, if compiling a package with introspection, the introspection part assumes that the lower packages in the compilation chain have also, already been compiled with introspection.

I just enabled it for all, then don't have such tedious compilation-chain errors.

Good point. However, is it worth to compile stuff with introspection?
_________________
Core i5 760 | Gentoo x86-64 | Xfce 4.10
Back to top
View user's profile Send private message
gerard82
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2228
Location: Netherlands

PostPosted: Sat Aug 20, 2011 1:46 pm    Post subject: Reply with quote

My 2 cents.
I fired up ufed and introspection is a local flag.
So I don't worry about it, AFAIK portage will take care of it when needed.
I use KDE but have a lot of GTK dependent programs installed like most I guess.
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum