Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] package-deb: Ignore circular dependencies
@ 2016-03-09 18:19 Ricardo Ribalda Delgado
  2016-03-09 20:33 ` Burton, Ross
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Ribalda Delgado @ 2016-03-09 18:19 UTC (permalink / raw)
  To: Richard Purdie, Aníbal Limón, Matt Madison,
	openembedded-core

If a package depends on itself apt-get fails to install it with the
error attached to this patch.

This patch checks for this conditions and notifies the user so the
recipe maintainer can fix his RDEPENDS variable.

root@qt5022:~# apt-get install perl-module-cpan
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  perl-module-cpan
0 upgraded, 640 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5964 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
E: Internal error: MaxLoopCount reached in SmartUnPack (2) for
perl-module-cpan:amd64, aborting
E: Internal error, packages left unconfigured. perl-module-cpan:amd64
root@qt5022:~# apt-get install perl-modules

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 meta/classes/package_deb.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 6ecea0e1824e..2eee083cc130 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -235,6 +235,9 @@ python do_package_deb () {
         rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
         debian_cmp_remap(rdepends)
         for dep in rdepends.keys():
+                if dep == pkg:
+                        bb.warn("Package %s rdepends on itself. Ignoring this dependency" % pkg)
+                        del rdepends[dep]
                 if '*' in dep:
                         del rdepends[dep]
         rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 18:19 [PATCH] package-deb: Ignore circular dependencies Ricardo Ribalda Delgado
@ 2016-03-09 20:33 ` Burton, Ross
  2016-03-09 20:47   ` Aníbal Limón
  2016-03-09 21:23   ` Mark Hatle
  0 siblings, 2 replies; 9+ messages in thread
From: Burton, Ross @ 2016-03-09 20:33 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com
> wrote:

> +                        bb.warn("Package %s rdepends on itself. Ignoring
> this dependency" % pkg)
>

Depending on yourself seems wrong no matter what packaging backend you're
using, even if it isn't fatal.  Maybe this should be added to the general
sanity checks in insane.bbclass?

Ross

[-- Attachment #2: Type: text/html, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 20:33 ` Burton, Ross
@ 2016-03-09 20:47   ` Aníbal Limón
  2016-03-09 20:54     ` Aníbal Limón
  2016-03-09 21:23   ` Mark Hatle
  1 sibling, 1 reply; 9+ messages in thread
From: Aníbal Limón @ 2016-03-09 20:47 UTC (permalink / raw)
  To: Burton, Ross, Ricardo Ribalda Delgado; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]



On 03/09/2016 02:33 PM, Burton, Ross wrote:
> On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com
>> wrote:
> 
>> +                        bb.warn("Package %s rdepends on itself. Ignoring
>> this dependency" % pkg)
>>
> 
> Depending on yourself seems wrong no matter what packaging backend you're
> using, even if it isn't fatal.  Maybe this should be added to the general
> sanity checks in insane.bbclass?

I agree that this situation could happen in other package management
backends, i don't now if at insane class level we could access the
dependency tree of the recipes/packages, i like the idea for more
general mechanism.

    alimon


> 
> Ross
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 20:47   ` Aníbal Limón
@ 2016-03-09 20:54     ` Aníbal Limón
  2016-03-09 21:00       ` Ricardo Ribalda Delgado
  0 siblings, 1 reply; 9+ messages in thread
From: Aníbal Limón @ 2016-03-09 20:54 UTC (permalink / raw)
  To: Burton, Ross, Ricardo Ribalda Delgado; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]



On 03/09/2016 02:47 PM, Aníbal Limón wrote:
> 
> 
> On 03/09/2016 02:33 PM, Burton, Ross wrote:
>> On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com
>>> wrote:
>>
>>> +                        bb.warn("Package %s rdepends on itself. Ignoring
>>> this dependency" % pkg)
>>>
>>
>> Depending on yourself seems wrong no matter what packaging backend you're
>> using, even if it isn't fatal.  Maybe this should be added to the general
>> sanity checks in insane.bbclass?
> 
> I agree that this situation could happen in other package management
> backends, i don't now if at insane class level we could access the
> dependency tree of the recipes/packages, i like the idea for more
> general mechanism.

I forget to mention will be good if also handle circular dependencies
between recipe/packages. A time ago i added this support on postinst
scripts in package_{deb,ipk} [1].

[1]
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/lib/oe?id=b2c9e7347acdfd0efe1c3dabb853d609233b61b6



> 
>     alimon
> 
> 
>>
>> Ross
>>
> 
> 
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 20:54     ` Aníbal Limón
@ 2016-03-09 21:00       ` Ricardo Ribalda Delgado
  0 siblings, 0 replies; 9+ messages in thread
From: Ricardo Ribalda Delgado @ 2016-03-09 21:00 UTC (permalink / raw)
  To: Aníbal Limón; +Cc: OE-core

What about ack this patch until we have something more generic.

The fact that the perl-module package is wrong and we havent find it
out until today makes me think that it is only apt-get who has this
issue with circular depencies.

Regards!

On Wed, Mar 9, 2016 at 9:54 PM, Aníbal Limón
<anibal.limon@linux.intel.com> wrote:
>
>
> On 03/09/2016 02:47 PM, Aníbal Limón wrote:
>>
>>
>> On 03/09/2016 02:33 PM, Burton, Ross wrote:
>>> On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com
>>>> wrote:
>>>
>>>> +                        bb.warn("Package %s rdepends on itself. Ignoring
>>>> this dependency" % pkg)
>>>>
>>>
>>> Depending on yourself seems wrong no matter what packaging backend you're
>>> using, even if it isn't fatal.  Maybe this should be added to the general
>>> sanity checks in insane.bbclass?
>>
>> I agree that this situation could happen in other package management
>> backends, i don't now if at insane class level we could access the
>> dependency tree of the recipes/packages, i like the idea for more
>> general mechanism.
>
> I forget to mention will be good if also handle circular dependencies
> between recipe/packages. A time ago i added this support on postinst
> scripts in package_{deb,ipk} [1].
>
> [1]
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/lib/oe?id=b2c9e7347acdfd0efe1c3dabb853d609233b61b6
>
>
>
>>
>>     alimon
>>
>>
>>>
>>> Ross
>>>
>>
>>
>>
>



-- 
Ricardo Ribalda


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 20:33 ` Burton, Ross
  2016-03-09 20:47   ` Aníbal Limón
@ 2016-03-09 21:23   ` Mark Hatle
  2016-03-09 21:27     ` Mark Hatle
  1 sibling, 1 reply; 9+ messages in thread
From: Mark Hatle @ 2016-03-09 21:23 UTC (permalink / raw)
  To: openembedded-core

On 3/9/16 2:33 PM, Burton, Ross wrote:
> 
> On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com
> <mailto:ricardo.ribalda@gmail.com>> wrote:
> 
>     +                        bb.warn("Package %s rdepends on itself. Ignoring
>     this dependency" % pkg)
> 
> 
> Depending on yourself seems wrong no matter what packaging backend you're using,
> even if it isn't fatal.  Maybe this should be added to the general sanity checks
> in insane.bbclass?
> 
> Ross
> 
> 

I disagree.. it's quite common for an automatic dependency to trigger a
dependency on one's self.  I.e.:

python provides /usr/bin/python

python includes a script that uses /usr/bin/python

depends system now has a provide and dependency for /usr/bin/python in the same
package.  This is 'fine'.

Since opkg/deb can't handle file based dependencies, it would be reasonable for
a dependency on /usr/bin/python to be translated to 'python'.

And now you have the python package depending on the python package.


If the package manager interface does not support this, then it should be the
package manager .bbclass that should filter out these items.

This is what we've had to do in the rpm backend... I think it's reasonable for
the deb and opkg backends as well.

--Mark


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 21:23   ` Mark Hatle
@ 2016-03-09 21:27     ` Mark Hatle
  2016-03-09 21:30       ` Ricardo Ribalda Delgado
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Hatle @ 2016-03-09 21:27 UTC (permalink / raw)
  To: openembedded-core

On 3/9/16 3:23 PM, Mark Hatle wrote:
> On 3/9/16 2:33 PM, Burton, Ross wrote:
>>
>> On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com
>> <mailto:ricardo.ribalda@gmail.com>> wrote:
>>
>>     +                        bb.warn("Package %s rdepends on itself. Ignoring
>>     this dependency" % pkg)
>>
>>
>> Depending on yourself seems wrong no matter what packaging backend you're using,
>> even if it isn't fatal.  Maybe this should be added to the general sanity checks
>> in insane.bbclass?
>>
>> Ross
>>
>>
> 
> I disagree.. it's quite common for an automatic dependency to trigger a
> dependency on one's self.  I.e.:
> 
> python provides /usr/bin/python
> 
> python includes a script that uses /usr/bin/python
> 
> depends system now has a provide and dependency for /usr/bin/python in the same
> package.  This is 'fine'.
> 
> Since opkg/deb can't handle file based dependencies, it would be reasonable for
> a dependency on /usr/bin/python to be translated to 'python'.
> 
> And now you have the python package depending on the python package.
> 
> 
> If the package manager interface does not support this, then it should be the
> package manager .bbclass that should filter out these items.
> 
> This is what we've had to do in the rpm backend... I think it's reasonable for
> the deb and opkg backends as well.

Just wanted to clarify the above.  RPM -does- support self-referencing
dependencies.  Circular dependencies are different, in that A -> B -> C -> A..
those are detected and there is some basic logic to break those.

The RPM backend has rule checks where the RPM rules differ from the OE/deb/opkg
and translates to the correct RPM style rules.  This is what I think deb/opkg
should be doing.. checking RPM/OE style rules and translating.

--Mark

> --Mark
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 21:27     ` Mark Hatle
@ 2016-03-09 21:30       ` Ricardo Ribalda Delgado
  2016-03-09 21:47         ` Mark Hatle
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Ribalda Delgado @ 2016-03-09 21:30 UTC (permalink / raw)
  To: Mark Hatle; +Cc: openembedded-core

Hi Mark

On Wed, Mar 9, 2016 at 10:27 PM, Mark Hatle <mark.hatle@windriver.com> wrote:
>
> Just wanted to clarify the above.  RPM -does- support self-referencing
> dependencies.  Circular dependencies are different, in that A -> B -> C -> A..
> those are detected and there is some basic logic to break those.

So if I got it right you are in favour of breaking A->A dependency in
package_deb.class like is done in this patch?

Thanks and best regards!


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] package-deb: Ignore circular dependencies
  2016-03-09 21:30       ` Ricardo Ribalda Delgado
@ 2016-03-09 21:47         ` Mark Hatle
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Hatle @ 2016-03-09 21:47 UTC (permalink / raw)
  To: Ricardo Ribalda Delgado; +Cc: openembedded-core

On 3/9/16 3:30 PM, Ricardo Ribalda Delgado wrote:
> Hi Mark
> 
> On Wed, Mar 9, 2016 at 10:27 PM, Mark Hatle <mark.hatle@windriver.com> wrote:
>>
>> Just wanted to clarify the above.  RPM -does- support self-referencing
>> dependencies.  Circular dependencies are different, in that A -> B -> C -> A..
>> those are detected and there is some basic logic to break those.
> 
> So if I got it right you are in favour of breaking A->A dependency in
> package_deb.class like is done in this patch?

Yes, but I don't think a warning is necessary.

--Mark

> Thanks and best regards!
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-03-09 21:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09 18:19 [PATCH] package-deb: Ignore circular dependencies Ricardo Ribalda Delgado
2016-03-09 20:33 ` Burton, Ross
2016-03-09 20:47   ` Aníbal Limón
2016-03-09 20:54     ` Aníbal Limón
2016-03-09 21:00       ` Ricardo Ribalda Delgado
2016-03-09 21:23   ` Mark Hatle
2016-03-09 21:27     ` Mark Hatle
2016-03-09 21:30       ` Ricardo Ribalda Delgado
2016-03-09 21:47         ` Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox