Skip to content

Resolver silently skips constraint checks on already-resolved transitive edges #147

Description

@JPDuchesne

In Resolver#resolve, the edge walk dedups with next if resolved.key?(id) (and queue << edge_decl unless resolved.key?(...)) — see lib/dev/deps/resolver.rb.

When two packages both depend on C with different constraints (a diamond), whoever reaches C first pins it, and the second edge is dropped without verifying that the pinned version satisfies its constraint. reject_conflicts only inspects the input declarations, never transitive edges.

Today this is unreachable in practice — ficsit is the only integration reporting resolved edges, and its trees are shallow — but it is a correctness gap that grows with every integration that gains transitivity support.

Fix direction: accumulate constraints per PackageId during the walk and raise loudly when a pinned version violates a later edge's constraint. A satisfying-version re-solve or full backtracking is a separate, bigger step.

Related (future): cross-integration edges for subproject / dev-as-an-ecosystem resolution — DependencyEdge currently carries only a name, and the walk stamps the declaring dep's integration onto every edge.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    transitivityTransitive dependency resolution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions