FS#9177 - Dependency cycles in core

Attached to Project: Arch Linux
Opened by Jaroslaw Swierczynski (swiergot) - Saturday, 12 January 2008, 21:10 GMT
Last edited by Allan McRae (Allan) - Sunday, 15 March 2009, 03:57 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Dan McGee (toofishes)
Architecture All
Severity High
Priority Normal
Reported Version 3.0.6
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Clearly dependencies are calculated incorrectly. First the following appeared:

resolving dependencies...
warning: dependency cycle detected:
warning: bash will be installed before its glibc dependency
warning: dependency cycle detected:
warning: readline will be installed before its glibc dependency
warning: dependency cycle detected:
warning: ncurses will be installed before its glibc dependency
warning: dependency cycle detected:
warning: coreutils will be installed before its pam dependency
warning: dependency cycle detected:
warning: shadow will be installed before its pam dependency

Here is a list of packages and commands they miss during their installation:

glibc - init, cat, grep, awk, rm, uname
filesystem - grep
kernel26 - vercmp

Now, I'm not sure but several minutes earlier when I installed chroot for the first time, using pacman 3.0, I think I did not see those errors. But at that time I installed only the base group (later also base-devel) so I'm not sure if the second time was pacman's fault or maybe it was because of the additional group. I'm about to try again with pacman 3.1 and only the base group. I'll let you know.
This task depends upon

Closed by  Allan McRae (Allan)
Sunday, 15 March 2009, 03:57 GMT
Reason for closing:  Fixed
Comment by Dan McGee (toofishes) - Saturday, 12 January 2008, 21:13 GMT
Be very careful with these tools- the command line arguments to pacman have changed. You may want to look in the scripts.

We really need to update this package.
Comment by Jaroslaw Swierczynski (swiergot) - Saturday, 12 January 2008, 21:24 GMT
Yeah, so far I spotted two bugs in mkarchroot and makechrootpkg but I can see they are fixed in git. But the way pacman is called seems to be ok (except paths to cache and database).

I just installed only the base group and here is what I got:

warning: dependency cycle detected:
warning: bash will be installed before its glibc dependency
warning: dependency cycle detected:
warning: readline will be installed before its glibc dependency
warning: dependency cycle detected:
warning: ncurses will be installed before its glibc dependency
warning: dependency cycle detected:
warning: db will be installed before its coreutils dependency

Missing commands were the same as before plus:

gcc-libs - /bin/true
Comment by Xavier (shining) - Saturday, 12 January 2008, 22:10 GMT
Hmm, the cycle problems is not pacman's fault. It's the fault of the packages. These cycles probably exist for a long time.
The only difference is that pacman 3.1 now explicitly warn about them.

And for the additional cycles caused by the scriptlet, this is simply unsolvable.
Consider the glibc case. As you said, glibc scritplet needs the following tools:
init, cat, grep, awk, rm, uname

And all these tools need glibc to be run, don't they?

I now remember there is a subtle difference in 3.1, here is the git commit log:
popen does NOT require /bin/sh in a subchroot

I appears that when chrooted, the /bin/sh used by popen is that of the parent
process. This is true until the process forks once chrooted, which we do not
want to do.

As such, this actually makes things nicer. We don't need a /bin/sh in a chroot
to run install scriptlets, and don't need to check for it in the root directory

So with pacman 3.0, until there was a working bin/sh inside the chroot, the scritplets were simply not run! Now, they are all run, but the first ones probably won't have all the tools they need, as you noticed.
Which is why you might want to do 2 passes, as it was recommended on arch wiki :
http://wiki.archlinux.org/index.php/Talk:Install_Arch_from_within_another_distro
Comment by Jaroslaw Swierczynski (swiergot) - Saturday, 12 January 2008, 22:52 GMT
Thanks for the explanation. However I'm not convinced about that install-twice solution. The devs might consider dropping glibc dependency from bash, coreutils etc. and add bash, coreutils as dependencies to glibc, and so on. Here is what I did:

- removed glibc dep from bash, coreutils, initscripts, gawk, grep, sysvinit,
- added awk, coreutils, filesystem, grep, initscripts, sysvinit dep to glibc,
- added grep dep to filesystem,
- added pacman dep to kernel26,
- added coreutils dep to gcc-libs.

mkarchroot (base base-devel sudo) ran without a single error. IMHO it makes more sense as this way the dependencies answer *real* needs. After all, dependencies are meant to help, not to cause troubles, they are means, not aims.

BTW, how does this affect Arch installation?
Comment by Xavier (shining) - Saturday, 12 January 2008, 23:08 GMT
That's a point of view. I just have the opposite one, which is well explained here :
http://archlinux.org/pipermail/arch-general/2007-November/016158.html

However, none of us is a dev, so our opinions don't matter that much :)
Comment by Aaron Griffin (phrakture) - Wednesday, 16 January 2008, 18:45 GMT
I'm having a hard time parsing this bug report. It claims there are errors in makechrootpkg and mkarchroot, but the entire discussion centers around dependency cycles.

What's the real purpose of this report? And what is the next step in resolving it?
Comment by Jaroslaw Swierczynski (swiergot) - Wednesday, 16 January 2008, 19:02 GMT
Well it came up while executing mkarchroot but it's a general problem of dependencies (it could very well be during Arch installation but I haven't checked it). The purpose of this report is to show that dependencies are incorrectly defined (ie. package A's install script uses tools from package B but A does not depend on A, and the glibc dependency causes troubles as well) which results in wrongly calculated package installation order.
Comment by Jaroslaw Swierczynski (swiergot) - Wednesday, 16 January 2008, 19:03 GMT
s/A does not depend on A/A does not depend on B/
Comment by Aaron Griffin (phrakture) - Wednesday, 16 January 2008, 19:06 GMT
  • Field changed: Attached to Project (Pacman → Arch Linux)
  • Field changed: Summary (Many errors during mkarchroot with pacman 3.1 → Dependency cycles in core)
Renamed and moved to make this report more correct.
Comment by Ionut Biru (wonder) - Saturday, 07 June 2008, 15:49 GMT
the cicle isn't fix. i'm using ftp install.

warning: dependency cycle detected:
warning: bash will be installed before its glibc dependency
warning: dependency cycle detected:
warning: readline will be installed before its glibc dependency
warning: dependency cycle detected:
warning: ncurses will be installed before its glibc dependency
warning: dependency cycle detected:
warning: db will be installed before its coreutils dependency
Comment by Simo Leone (neotuli) - Friday, 20 June 2008, 08:35 GMT
This needs to be resolved at the package level, and is harmless with relation to actual functionality during package installation, since it just generates some warning output.
Comment by Glenn Matthys (RedShift) - Friday, 05 December 2008, 21:33 GMT
What's the status of this issue?

Loading...