Skip to contentSkip to conversation

package-deb: Ignore circular dependencies

PATCH In review Ricardo Ribalda Delgado 4 participants 9 messages Mar 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package-deb: Ignore circular dependencies

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
---
 meta/classes/package_deb.bbclass | 3 +++
 1 file changed, 3 insertions(+)
meta/classes/package_deb.bbclass +3 -0
index 6ecea0e1824e..2eee083cc130 100644
@@ -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 "")
Signature · 1 line
2.7.0
#1 lore raw

On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <[email protected]

Quoted 5 lines

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

#2 lore raw
Quoted 10 lines · Ross

On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <[email protected]

Quoted 5 lines

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

Quoted 3 lines

Ross

#3 lore raw
Quoted 10 lines · Aníbal Limón
Quoted 7 lines · Ross

On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <[email protected]

Quoted 5 lines

wrote:

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

Quoted 8 lines
Quoted 3 lines

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

Quoted 10 lines

alimon

Quoted 3 lines

Ross

#4 lore raw

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!

Quoted 42 lines · Aníbal Limón
Quoted 10 lines · Aníbal Limón
Quoted 7 lines · Ross

On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <[email protected]

Quoted 5 lines

wrote:

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

Quoted 8 lines
Quoted 3 lines

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

Quoted 10 lines

alimon

Quoted 3 lines

Ross

Signature · 1 line
Ricardo Ribalda
#5 lore raw
In reply to Burton, Ross
Quoted 8 lines · Ross

On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <[email protected] <mailto:[email protected]>> wrote:

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

Quoted 7 lines

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

#6 lore raw
Quoted 30 lines · Mark Hatle
Quoted 8 lines · Ross

On 9 March 2016 at 18:19, Ricardo Ribalda Delgado <[email protected] <mailto:[email protected]>> wrote:

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

Quoted 7 lines

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'.

Quoted 8 lines

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

Quoted 2 lines

--Mark

#7 lore raw

Hi Mark

Quoted 4 lines · Mark Hatle

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!

#8 lore raw
Quoted 10 lines · Ricardo Ribalda Delgado

Hi Mark

Quoted 4 lines · Mark Hatle

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

Quoted 2 lines

Thanks and best regards!