Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 930422 - `emerge -uD world` installs unnecessary packages (bdeps)
Summary: `emerge -uD world` installs unnecessary packages (bdeps)
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Dependencies (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-22 13:23 UTC by Cedric Sodhi
Modified: 2024-04-22 14:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge -uDpqt --with-bdeps=y world (emerge-uDpqt-y-world.txt,1.87 KB, text/plain)
2024-04-22 13:45 UTC, Cedric Sodhi
Details
emerge -uDpqt --with-bdeps=n world (emerge-uDpqt-n-world.txt,112 bytes, text/plain)
2024-04-22 13:45 UTC, Cedric Sodhi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Sodhi 2024-04-22 13:23:04 UTC
This has led to a bit of debate on IRC, so I would like to start by proposing my two base assumptions:

1. I understand that `emerge -uD world` means

> "Update (-u) all installed (-D world) packages."

2. Implicitly, a package manager should respect

> "Only compile/install things which are needed."

If we take these two assumptions, then `emerge -uD --with-bdeps=y world` does the wrong thing, whenever there are bdeps of installed packages which are absent from the system (possible reasons include: a package has been installed as binpkg, the bdeps have been depcleaned for diskspace reasons, etc.).

`emerge -uD --with-bdeps=y` will not only update currently installed bdeps (as the command implies), but also newly install all bdeps which are currently not installed, even if their dependees are not being compiled. That can lead to whole toolchains being compiled needlessly (in my example the buildtime chain of firefox with nodejs and clang).
Comment 1 Cedric Sodhi 2024-04-22 13:45:24 UTC
Created attachment 891311 [details]
emerge -uDpqt --with-bdeps=y world

As a concrete example of this, take www-client/firefox-125.0.1 with all its bdeps missing (reason: installed from a binpkg), installed.

Attached is the output of `emerge -uD --with-bdeps=y`, the clang toolchain is pulled in without need.

Also attached is the "attempted workaround" `emerge -uD --with-deps=n` (skips the update of dev-python/hatchling).
Comment 2 Cedric Sodhi 2024-04-22 13:45:58 UTC
Created attachment 891312 [details]
emerge -uDpqt --with-bdeps=n world
Comment 3 Mike Gilbert gentoo-dev 2024-04-22 14:23:56 UTC
> 1. I understand that `emerge -uD world` means
> "Update (-u) all installed (-D world) packages."

Incorrect. A more precise definition.

Update (-u) all members of the @world set, along with any direct or indirect dependencies (-D).

Updating dependencies of the @world set does not mean all installed packages. There may be packages installed which are not included in @world and which would be removed by emerge --depclean. Also, there may be packages in @world which are not currently installed.

The --with-bdeps flag controls which dependency classes are included by -D. That's it.

> 2. Implicitly, a package manager should respect
> "Only compile/install things which are needed."

This assumption doesn't really mean anything without defining "needed". The --with-bdeps flag alters the definition of "needed" in this context.