pkgcheck icon indicating copy to clipboard operation
pkgcheck copied to clipboard

Detect USE dependencies that are not satisfied with profile-defined sets of USE flags

Open mgorny opened this issue 7 years ago • 1 comments

Now that we have nice checks for whether REQUIRED_USE is satisfied with the default sets of USE flags enabled by a profile, I think it would be reasonable to extend this to checking USE dependencies.

What I mean, is basically for each ebuild E, for each profile P:

  1. collapse the USE conditionals in dependencies based on the flags enabled by the profile (i.e. consider only those branches that are enabled by default),
  2. collapse the || in dependencies by enabling all branches that match existing packages (i.e. check all possible variants),
  3. for each dependency with a USE conditional, check if the newest visible (maybe stable+~arch separately?) ebuild matching the dependency spec has the flags required by the USE conditional enabled.

For example, if app-misc/foo has:

RDEPEND="foo? ( dev-libs/bar[bar] )"

then if the profile enables app-misc/foo[foo] by default, and at the same time the profile does not enable dev-libs/bar[bar] by default, pkgcheck should report an issue. In other words, if the user attempting to install app-misc/foo would hit an unsolved dependency which required package.use manipulation by default.

The one goal I'd like to achieve is to check that if profiles change PYTHON_TARGETS/PYTHON_SINGLE_TARGET on a package, then they also adjust its dependencies appropriately.

mgorny avatar Apr 09 '17 20:04 mgorny

Alternatively I'd argue the PM could/should be able to determine and enable required USE flags without requiring entries to be added to package.use and report conflicts when issues arise.

That doesn't preclude a check like this from being helpful, but it would lessen its impact.

radhermit avatar Jul 11 '19 04:07 radhermit