You are not logged in.

#1 2020-12-04 18:56:55

Archemore
Member
Registered: 2020-11-12
Posts: 13

[SOLVED] Question about redundancy in base meta-package dependencies

Hi,

I was familiarizing myself with some of the official repository structure, and noticed that the base meta-package has both filesystem and glibc as dependencies, so it calls both for installation when base is installed. However, glibc also has a dependency on filesystem. So why not just have base install glibc, which should then trigger filesystem to be installed as a dependency? I know the end result is the same, but was curious as to the reasoning to do it one way over the other. I'm sure there are probably other examples of this for other packages. But in this case is there perhaps some concern that one day a glibc will be written that no longer explicitly depends on filesystem, but the filesystem package ought to be installed on every system regardless?

Last edited by Archemore (2020-12-05 03:20:18)

Offline

#2 2020-12-04 19:45:44

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 593

Re: [SOLVED] Question about redundancy in base meta-package dependencies

One of the packager guidelines is to avoid relying in transitive deps.
https://wiki.archlinux.org/index.php/Ar … pendencies

As an example:

foo depends on bar & baz
bar depends on baz

One should™ not remove baz as dep of foo just because bar depends on it.
What if it stops depending on it?
What if it starts using blap instead of baz?

So, even if it's redundant, every package should™ state every single one of it's dependencies, with the expection of base-devel for AUR packages it seems, but that is another topic.

...

But base is just a metapackage defining sane minimum defaults for what is ArchLinux.
It's not written in stone and it's not like your system will die if you replace coreutils with busybox, or systemd with openrc.
(Of course, as long as YOU do it, not somescript™, but that is another topic)

Last edited by GaKu999 (2020-12-04 19:49:38)


My reposSome snippets

Heisenberg might have been here.

Offline

#3 2020-12-04 22:08:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,106
Website

Re: [SOLVED] Question about redundancy in base meta-package dependencies

The above is spot on.  But I wanted to follow up on the difference between a genuine transitive dependency and a falsly assumed one.  If you package something that needs foo and bar, and foo also needs bar, can you get away with only listing foo as a dependency?  NO, not if your package really requires bar.  What happens if a future revision of foo no longer requires bar, does your package break?  If so, then your package depends directly on bar: this isn't actually a transitive dependecy, it's a direct dependency and must be listed.  If your package continued to work without bar, then it only ever really depended on foo, and bar was indeed previously a transitive dependency, but it is no longer any kind of dependency.

In your example, the base group requires filesystem.  Full stop.  The fact that it also requires glibc which in turn also requires filesystem is beside the point.  If there were some drop in replacement for glibc that didn't require filesystem (not really possible in this example), the base group would still need filesystem itself.

Or another way of saying this: if A dependens on B and C, and B depends on C and D, then all of the following are true:

1. D is a transitive (and only transitive) dependency of A and thus should not be listed in A's depends list.
2. B is a direct dependency of A and thus must be listed in A's depends list.
3. C is both a transitive and direct depednency of A and thus must be listed in A's depends list.  Failing to list it would be making a faulty assumption that it will always be installed just because it is (also) a transitive dependency.

Last edited by Trilby (2020-12-04 22:13:49)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2020-12-04 23:34:54

Archemore
Member
Registered: 2020-11-12
Posts: 13

Re: [SOLVED] Question about redundancy in base meta-package dependencies

Thanks for the very informative responses! These make everything clear.

Offline

#5 2020-12-04 23:43:35

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 3,541

Re: [SOLVED] Question about redundancy in base meta-package dependencies

If your question is answered, please remember to mark your thread [SOLVED] (edit the title of your first post).

Offline

Board footer

Powered by FluxBB