Skip to main content

analyze_dependencies

Function analyze_dependencies 

Source
pub fn analyze_dependencies<S: BuildHasher>(
    deps: &[String],
    installed: &HashSet<String, S>,
    provided: &HashSet<String, S>,
) -> Vec<DependencyDelta>
Expand description

What: Analyze dependency specs against the host environment.

Inputs:

  • deps: Dependency specs as declared (may include version requirements or optdepends pkg: description annotations).
  • installed: Set of installed package names.
  • provided: Set of names provided by installed packages.

Output:

  • One DependencyDelta per spec (local packages are skipped).

Details:

  • Membership is checked via deps::is_package_installed_or_provided.
  • Version constraints are parsed with deps::parse_dep_spec and checked with deps::version_satisfies against the pacman -Q version — an improvement over Pacsea, which passed the full spec as the requirement (never failing the check).
  • Installed local packages are filtered out, matching Pacsea (they are not relevant for build-preflight analysis).
  • Host state (versions, foreign packages) is queried in two batched pacman invocations up front and degrades gracefully when pacman is unavailable.