Skip to main content

deps_engine/
lib.rs

1// `setup::register_ecosystems` constructs every feature-enabled ecosystem's registry client
2// and formatter behind a boxed `Ecosystem` trait object; proving the resulting `Send` bound
3// across 14 crates' own `get_latest_matching`-style implementations has, in the crate this
4// module was moved from, occasionally exceeded rustc's default recursion limit, downgrading a
5// previously-silent trait-solver retry into `recursion_depth_exceeding_limit` under `-D
6// warnings` (rust-lang/rust#159228). Same class of fix as deps-cargo (#745), deps-nuget
7// (#696), deps-swift (#673), deps-composer, and deps-lsp (issue #1058, this module's origin).
8#![recursion_limit = "256"]
9
10//! The workspace's composition root.
11//!
12//! Wires every feature-enabled `deps-<ecosystem>` crate's [`deps_core::ecosystem::Ecosystem`]
13//! implementation into a [`deps_core::EcosystemRegistry`].
14//!
15//! This crate exists only because Cargo forbids a cycle: `deps-core` cannot depend on any
16//! `deps-<ecosystem>` crate, since all 14 already depend on `deps-core`. Every driving adapter
17//! (`deps-lsp`, and future `deps-cli`/`deps-mcp`) depends on `deps-engine` instead of
18//! reimplementing ecosystem registration itself — see `specs/062-cli-check-mode/
19//! architecture-decision.md` for the full design rationale (issue #1058).
20//!
21//! Three modules:
22//!
23//! - [`setup`] — the composition root itself: `EcosystemRuntime`, `register_ecosystems`, and
24//!   the ~110 concrete ecosystem types re-exported for convenience, moved verbatim from
25//!   `deps-lsp/src/lib.rs`.
26//! - [`classify`] — the pure dependency-classification layer (in-use-version/lockfile
27//!   resolution, OSV scan-target and fix-target-verification decisions, registry fetch
28//!   fan-out, and outcome-merging helpers), moved from `deps-lsp`'s `document/` module
29//!   (issue #1059) so a future `deps-cli` reaches identical verdicts without reimplementing
30//!   any of it.
31//! - [`progress`] — a driving-adapter-agnostic progress-reporting port fetch tasks report
32//!   through, also moved from `deps-lsp` as part of #1059.
33
34pub mod classify;
35pub mod progress;
36pub mod setup;
37
38/// Minimal, network-free test doubles for [`deps_core::ecosystem::Ecosystem`].
39///
40/// See the module's own doc for what it exposes and why. Mirrors `deps-core`'s own
41/// `test_util` module's `#[cfg(any(test, feature = "test-util"))]` gate.
42#[cfg(any(test, feature = "test-util"))]
43pub mod test_util;