1 # ADR 0001: Dependency Inheritance
2
3 - Status: Accepted
4 - Date: 2025-04-19
5
6 ## Context
7
8 The smbcloud-cli workspace contains multiple crates that share a large set of common dependencies.
9 Without a workspace-level dependency strategy, individual `Cargo.toml` files repeat the same
10 version declarations and features, which increases maintenance cost and creates version drift.
11
12 ## Decision
13
14 We use Cargo workspace dependency inheritance for shared dependencies.
15
16 The workspace defines common dependencies in `[workspace.dependencies]`, and member crates inherit
17 those dependencies instead of repeating version declarations locally.
18
19 We use `cargo autoinherit` to apply and maintain this inheritance pattern.
20
21 Reference:
22 - https://mainmatter.com/blog/2024/03/18/cargo-autoinherit
23
24 ## Consequences
25
26 Positive:
27 - Shared dependency versions are managed in one place.
28 - Workspace manifests are easier to keep consistent.
29 - Upgrades are simpler because most dependency changes happen at the workspace root.
30
31 Tradeoffs:
32 - Contributors need to understand workspace inheritance when editing crate manifests.
33 - Tooling and review need to account for inherited dependencies instead of crate-local versions.