M0005 path-outside-workspace¶
Rule: Path dependencies stay inside the workspace.
| Code | M0005 (stable, never reused) |
| Id | path-outside-workspace |
| Category | dependencies |
| Source | spirit_level |
| Fix | by hand |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | deny |
a path into a sibling checkout builds differently on every PC |
| small-workspace | deny |
a path into a sibling checkout builds differently on every PC |
| medium | deny |
a path into a sibling checkout builds differently on every PC |
| big | deny |
a path into a sibling checkout builds differently on every PC |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
A path = "../sibling" dependency builds against whatever that checkout holds on this PC: another branch, uncommitted work, or nothing at all on a fresh machine. The same commit then builds differently everywhere.
How to fix¶
Take the crate by git (a branch, fixed by Cargo.lock). To work on both repos at once, put a [patch] in a .cargo/config.toml that is kept out of git.
Configure¶
Allow one finding in the code with // spirit-level: allow(path-outside-workspace) <reason> (waivers); the code works there too, as in [lints.M0005].