Skip to content

X0024 hakari-generate

Rule: The workspace-hack package's dependencies are the ones hakari computes.

Code X0024 (stable, never reused)
Id hakari-generate
Category hakari
Source hakari (linked as a library)
Fix exact: spl check --fix applies it
Needs the resolved dependency graph (full cargo metadata)

Level per tier

Tier Level Reason
small off
small-workspace off
medium off
big warn a workspace-hack builds each shared dependency once; warn, as not every workspace wants one
ai off
embedded off
ui off
egui off
units-strict off
units-paranoid off

Why

In a big workspace each member enables other features of shared dependencies, so building one crate rebuilds them with another feature set. A workspace-hack package (managed by hakari) depends on every shared dependency with the union of the features, and every member depends on it: each dependency is built once. The workspace-hack goes stale whenever a dependency or feature changes; this lint compares it with what hakari computes now, like cargo hakari generate --diff.

How to fix

spl check --fix rewrites the generated section of the workspace-hack's Cargo.toml (as cargo hakari generate does). A workspace without one starts with cargo hakari init workspace-hack.

Configure

[lints.hakari-generate]
level = "deny"
reason = "why this project wants it at this level"

Allow one finding in the code with // spirit-level: allow(hakari-generate) <reason> (waivers); the code works there too, as in [lints.X0024].