Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
The instrospection use flag in dependencies
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
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Mon Dec 10, 2012 10:46 am    Post subject: The instrospection use flag in dependencies Reply with quote

This discussion started on irc but I find that asking for help on irc channels is not very handy when one is a complete n00b in the matter.
So... if someone here can help me understanding.

1/ I get a package which actually installs code depending on gobject-introspection.
2/ This package also actually depends on other packages (gtk+, pango, atk, librsvg, webkit-gtk...) which also honour the introspection use flag.
3/ Of course the introspection use flag defaults to set for all these dependencies but devs rightly say that one should not assume that users use default settings.

My problem is : How can I know precisely (without reading thousands of lines of code) which of the dependencies actually need to be emerged USE=+introspection ?

Of course I have been suggested to test the package in a chroot environment with an empty world and consider what happens if I get a gtk use=-introspection for example...

But I find this just too crazy, well, I mean a suggestion equivalent to "hunting the haggies". I just cannot imagine testing that way the package waiting for something wrong to occur {for each dep in the deplist emerged -introspection} 8O

There must be something somewhere I must be missing.
Which one ?
_________________
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Dec 10, 2012 12:32 pm    Post subject: Reply with quote

Why not just
Code:
USE="-introspection" emerge -uDNpv world


You'll get a list of all package that will be rebuild if you drop the introspection use flag
And if for any reason, one package refuse that, emerge will bail out with a package X need package Y with change USE="+introspection" error.

Sample error output i've take on a random post.
Code:
!! Problem resolving dependencies for app-arch/p7zip from @selected
... done!

!!! The ebuild selected to satisfy "app-arch/p7zip" has unmet requirements.
- app-arch/p7zip-9.20.1-r3::gentoo USE="kde (multilib) -doc -pch -rar (-static) -wxwidgets"

  The following REQUIRED_USE flag constraints are unsatisfied:
    kde? ( wxwidgets )
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Mon Dec 10, 2012 12:48 pm    Post subject: Reply with quote

Thanks krinn.

Well... I should have started saying that I am trying to write the ebuild for the first package. So... portage wont refuse building it if I make it rdepend gtk+
My question in fact is : How can I know that I should write the rdepend gtk+[introspection] ?
gtk+ being an example among half a dozen...
_________________
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Dec 10, 2012 1:30 pm    Post subject: Reply with quote

well, i would say you are suppose to have access to the program API you will depend on, and that doc should tell you if a function depend on another one.
so if you need funcTT from gtk+, you should read somewhere in gtk api doc that funcTT is only enable if introspection is enable. In this case, you would then know you should depend on gtk+[introspection] to make sure gtk+ have the function enable.

If you're doing it blindly, no doc... I understand more now why someone told you to chroot in a clean env to test it.
You can just make your ebuild gtk+ and one day or another you will certainly get a bug report telling you it fail with unknown function/symbol functTT.

But you should just read the doc to find out what you need, and you don't have to care about reading all dependencies doc to find out the one you need. If X need Z need Y that need H that need K that need B to finally have gtk+ providing A. You should write your dependency on gtk+ need A, and while portage try to provide A it will complain for any missing Z, Y, H, K, B in order to have A enable. It's A ebuild task to care about its dependencies not your.

It's easier if you don't depend on a function/symbols but on a program from another ebuild, as you could just "equery f thefile" to find who provide it, and read its ebuild to see conditions to provide the program.

here's how i would find distccmon-gnome presence
Code:
equery b distccmon-gnome
 * Searching for distccmon-gnome ...
sys-devel/distcc-3.1-r6 (/usr/bin/distccmon-gnome -> distccmon-gui)

then
Code:
equery u distcc
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-devel/distcc-3.1-r6:
 U I
 - - avahi    : Add avahi/Zeroconf support
 + + gnome    : Adds GNOME support
 + + gtk      : Adds support for x11-libs/gtk+ (The GIMP Toolkit)
 - - hardened : activate default security enhancements for toolchain (gcc,
                glibc, binutils)
 + + ipv6     : Adds support for IP version 6
 - - xinetd   : Add support for the xinetd super-server

Well, pretty easy for that package (lol that's why i pickup this one as example), your ebuild should distcc[gnome] to make sure you could use it then. And you don't need to care about any dependencies, if to enable gnome use flags, gtk+ is need, it's distcc ebuild task to enforce that, not your ebuild.
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Mon Dec 10, 2012 1:55 pm    Post subject: Reply with quote

krinn wrote:
well, i would say you are suppose to have access to the program API you will depend on, and that doc should tell you if a function depend on another one.
so if you need funcTT from gtk+, you should read somewhere in gtk api doc that funcTT is only enable if introspection is enable. In this case, you would then know you should depend on gtk+[introspection] to make sure gtk+ have the function enable.

I definitely agree with you that it is the only honest and accurate method to solve this out.
It's just... well... that... my lazyness just cannot afford this.
Well... I mean... All this work just in order to guarantee that users who deliberately change default settings don't run into problems... well... :?
krinn wrote:
it's easier if you don't depend on a function/symbols but on a program from another ebuild

Oh yes. I have done this approximately the way you describe + digging into the build logs for all depending programs but... with that introspection stuff... it comes to includes...

Pfff! If gentoo-devs work that way with the application packages they maintain then, I say it and sign it :

They are true heroes !

I have always loved kernels ! I just get an additional reason for that.
_________________
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Mon Dec 10, 2012 2:11 pm    Post subject: Reply with quote

aCOSwt wrote:
Well... I mean... All this work just in order to guarantee that users who deliberately change default settings don't run into problems... well...

Actually, I think most users don't need introspection (unless they are heavy Gnome-only guys). At least, here everything runs fine without it. So at least these users will appreciate the work.
Back to top
View user's profile Send private message
Onip
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2912
Location: Parma (Italy)

PostPosted: Mon Dec 10, 2012 4:35 pm    Post subject: Reply with quote

I think that you have three methods:


  • the one they suggest you on irc ("clean room" try and error)
  • reading through documentation (or sources if the first one fails)
  • write a "naive" ebuild and then wait for bugreports to come... this seems not too serious, but if you will be able to react and correct quickly then it may be enough


out of curiosity, which package are we talking about?

p.s. for what I understood from my readings when a package uses introspection then it probably needs it for everyone of its deps (at least glib based ones)
_________________
Linux Registered User n. 373835

Titus Lucretius Carus, De Rerum Natura - Tantum religio potuit suadere malorum
Back to top
View user's profile Send private message
aCOSwt
Bodhisattva
Bodhisattva


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Mon Dec 10, 2012 8:32 pm    Post subject: Reply with quote

@mv : Thank you for your support.

Onip wrote:
I think that you have three methods:

Well... of course... I like your third one ! :D
But the problem here for me was not that much to make a buildable package but to make it buildable according to Gentoo standards.
And the third method is... in this context... prohibited ! :twisted:

BTW... 8O Gentoo standards are... 8O Very Hight ! :!:
I had suspected this already but... well... a tenth of what it really is. :?

The conclusion of this story is that I am very happy to be a Gentoo user... but... would not want to be a Gentoo dev... :twisted:

Onip wrote:
out of curiosity, which package are we talking about?

Its the cairo-docks + official plugins.
They are just entering the post-reviewed phase on sunrise.
_________________
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Dec 10, 2012 8:47 pm    Post subject: Reply with quote

aCOSwt wrote:
They are just entering the post-reviewed phase on sunrise.


gonna killed the post-reviewer dev :)
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