Dependency info issue for modules loaded from files with mod modname;
#43696
Labels
C-bug
Category: This is a bug.
I-needs-decision
Issue: In need of a decision.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
How to reproduce:
and
lib.rs
looking like thiscargo build
cargo build
againIn theory, the second
cargo build
should start running the build and report the errorbut no build is started because Cargo thinks everything is up-to-date.
Cargo uses depinfo produced by
rustc
to check file freshness and for this example depinfo produced during the first build looks like this, so Cargo checks
lib.rs
andmodname.rs
for freshness, but it doesn't know anythingmodname/mod.rs
.This can be fixed by issuing additional depinfo -
modname/mod.rs
for eachmodname.rs
, andmodname.rs
for eachmodname/mod.rs
.The problem is that it will require build systems (including Cargo) spend roughly twice as much time on checking file freshness on rebuilds for all projects, even if none of them does the madness described in the reproduction paragraph.
So, it may be reasonable to close this as WONTFIX.
The issue itself may be esoteric, but I think it's interesting as a glimpse into the world of project structures inferred from filesystem, which is currently discussed in various module system reform proposals.
The text was updated successfully, but these errors were encountered: