FS#66276 - [systemd] [p11-kit] circular dependency

Attached to Project: Arch Linux
Opened by Daan De Meyer (DaanDeMeyer) - Thursday, 16 April 2020, 14:54 GMT
Last edited by freswa (frederik) - Monday, 01 June 2020, 22:19 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Dave Reisner (falconindy)
Christian Hesse (eworm)
Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

There's a dependency cycle between systemd and p11-kit: systemd -> libelf -> curl -> ca-certificates -> ca-certificates-mozilla -> ca-certificates-utils -> p11-kit -> systemd

When running pacstrap, sometimes I get the warning message:

warning: dependency cycle detected:
warning: p11-kit will be installed before its systemd dependency

This then leads to errors in the installation of p11-kit since it tries to execute systemctl operations which fail because systemctl is not available yet at the time p11-kit is installed.

Steps to reproduce:
- sudo pacstrap <any-empty-directory> systemd
This task depends upon

Closed by  freswa (frederik)
Monday, 01 June 2020, 22:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in p11-kit
Comment by Christian Hesse (eworm) - Thursday, 16 April 2020, 19:59 GMT
Guess this is a duplicate of  FS#65769 ...
Are you installing from out-of-date mirror?
Comment by Jan Alexander Steffens (heftig) - Thursday, 16 April 2020, 20:22 GMT
I do get a cycle pacstrapping base from orion:

warning: dependency cycle detected:
warning: libelf will be installed before its curl dependency
Comment by Jan Alexander Steffens (heftig) - Thursday, 16 April 2020, 20:28 GMT
Maybe we should move the dep on ca-certificates from curl to base?
Comment by Daan De Meyer (DaanDeMeyer) - Thursday, 16 April 2020, 20:40 GMT
At first I thought it was an out of date mirror but you can just follow the dependency cycle on https://www.archlinux.org/packages starting from systemd so it seems the cycle is still there. I had a quick look around and the libelf dependency on curl seems a bit obnoxious since it seems only libdebuginfod.so (which is part of libelf) depends on libcurl, not libelf itself. Maybe libelf can be split up into separate libraries? Then libelf itself wouldn't have to depend on curl anymore and the cycle should be broken.
Comment by Daan De Meyer (DaanDeMeyer) - Friday, 24 April 2020, 06:21 GMT
Ping. Any update on this? Anything I can do to help get this fixed?
Comment by Christian Hesse (eworm) - Friday, 24 April 2020, 06:55 GMT
(added Barthalion to assignees for elfutils)

I think we have two options here:

* move the dependency on ca-certificates from curl to base
* make libelf's dependency on curl optional

I think splitting off libdebuginfod is not worth the trouble.
Comment by Eli Schwartz (eschwartz) - Friday, 24 April 2020, 12:31 GMT
Splitting off libdebuginfod to a separate package would simply move the issue around a bit, and reintroduce the problem once https://github.com/systemd/systemd/issues/14711 is implemented, thus making systemd-coredump (which currently depends on libdw and libelf) also depend on libdebuginfod.
Comment by Jan Alexander Steffens (heftig) - Friday, 24 April 2020, 12:39 GMT
[08:58:22] <eworm> heftig: barthalion: Any opinion how to solve the dependency cycle in  FS#66276 ?
[09:02:11] <heftig|M> I would like base to depend on ca-certificates. Having it installed just through curl is a bit weak
[09:09:41] <barthalion> +1
[09:15:39] <eworm> Anybody wants his hands dirty or do you want me to do the change?
[09:18:58] <eworm> Well anthraxx owns base...

anthraxx: added you to this bug
Comment by Daan De Meyer (DaanDeMeyer) - Saturday, 25 April 2020, 09:17 GMT
It seems adding anthrax to this bug failed (or at least the UI isn't updated with this information on my end).
Comment by Eli Schwartz (eschwartz) - Sunday, 26 April 2020, 03:27 GMT
I don't even understand why this bug exists. Why does p11-kit, a package in the bootstrap cycle, depend on systemd in its install script? As a result of this, we have this bug,  FS#65769  (systemd now links to p11-kit?), and the venerable  FS#59897  which added the problematic systemd dependency to p11-kit in the first place, which is 3 bugs because we are running systemctl commands in the post-install of this package.

This is not a new problem. gnupg solves the same problem by not using systemctl and instead using mkdir -p && ln -sf; that's all systemctl does anyway. heftig, you're even the one who added this to the gnupg package... this should be reused in p11-kit too.

Then we can drop the dependency on systemd to resolve the circular dependency:

systemd: still depends on libp11-kit, which doesn't have a bootstrap problem

p11-kit: the dependency is nothing -> systemd -> libelf -> curl -> ca-certificates{,-mozilla,-utils} -> p11-kit -> systemd-libs -> nothing

We don't need to reinvent base or perform additional package splitting or what-have-you.

In fact, we can even merge p11-kit back together, and make systemd just depend on p11-kit, which in turn depends on systemd-libs.
Comment by Daan De Meyer (DaanDeMeyer) - Saturday, 02 May 2020, 08:33 GMT
Ping. eschwartz's solution seems solid. If I can help in any way with getting it deployed, let me know.

Loading...