[oe] [RFC] Handling of virtual/* namespace in packages

Richard Purdie rpurdie at rpsys.net
Mon Oct 15 16:10:32 UTC 2007


On Mon, 2007-10-15 at 14:19 +0200, Marcin Juszkiewicz wrote:
> In OpenedHand we got hit by virtual/update-alternatives and packaging. 
> Poky contains two providers for virtual/u-a:
> 
> 1. update-alternatives-cworth
> 2. update-alternatives-dpkg
> 
> First one comes from IPKG source and is written in pure shell. Second one 
> is in Perl so it fetch too much to be usable.
> 
> The problem comes when you build both of them (it happens on our 
> autobuilder due to 'world' build) - package manager (ipkg) selects random 
> one - in our case it is always 'update-alternatives-dpkg' so generated 
> rootfs is too big to be usable.
> 
> Solution which came to my mind is quite simple. Our distro (Poky) already 
> prefers 'u-a-cworth' as provider for 'virtual/update-alternatives'. So if 
> package depends on 'virtual/update-alternatives' then let package.bbclass 
> mangle its dependencies in such way that 'u-a-cworth' (preferred by 
> distro) would be writen in package.
> 
> What do you think about it?

I really liked this idea and I did some experiments but they had mixed
results. The problem is if we have:

RDEPENDS_${PN} = "virtual/xyz" 

then bitbake gets upset as it can't work out what to build to fulfil
that. 

We also need to avoid cross contaminating the DEPENDS and RDEPENDS
namespaces, they're separate and people *need* to think of them
separately.

I've started thinking of lots of perverse edge cases with the above too,
the problem is PREFERRED_PROVIDER is just a preference, not an absolute
and bitbake can ignore it to make a build work, especially in -k
(continue on failure) mode.

I was thinking we could have bitbake eject a set of variables:

VRPROVIDER_xyz = "abc"
VRPROVIDER_wxy = "bcd"

etc. which would tell us which provider bitbake was planning on using.
We could also adjust bitbake internals to cope with "virtual-runtime/"
variables in the RDEPENDS space but even that isn't going to be enough.
Consider:

PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive"

and bitbake setting:

VRPROVIDER_xserver = "xserver-kdrive"

None of this fixes the existing problem of how to get
"xserver-kdrive-fbdev" back and bitbake is always going to need help to
work that one out...


So perhaps we should just standardise the existing xserver behaviour
into a dedicated namespace:

DEPENDS = "virtual/xserver"
RDEPENDS_xyz = "${VIRTUAL-RUNTIME_xserver}"

and the machine.conf in this case would say

PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive"
VIRTUAL-RUNTIME_xserver = "xserver-kdrive-fbdev"

I'd love to find a nicer solution but I just can't come up with one that
will work...

Cheers,

Richard







More information about the Openembedded-devel mailing list