cackle-rs / cackle

A code ACL checker for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate listings of problems

repi opened this issue · comments

Noticed that on our big project the same "problem" gets listed multiple times, which is confusing. Example:

image

we are using:

[common]
version = 1
import_std = ["fs", "net", "process", "env", "terminate"]
build_flags = []

is this an artifact of how the tool works, or is it missing some de-duplication in its analysis or display?

There is code that deduplicates problems, however it only kicks in if the problems are exactly the same, including all usages. Where two binaries in your dependency graph both depend on the same crate, you can end up with the same problem reported twice, but with usages that aren't exactly the same. The usages depend on code reachability, so if different functions are reachable in the two crates, then the usages will be different.

Probably to make the duplicates completely go away, I'll need to actually merge the problems together, which is made slightly tricky because internally I need to keep the original problems. The threads that reported each problem are waiting for all problems they reported to be resolved before they allow that bit of compilation to complete.