-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
During the first build with a build script (or running cargo doc
) cargo does a full scan of the package to determine the file with the newest mtime. This full scan can be expensive and can cause some issues. For example, in #9545, there is no way to tell cargo to avoid scanning certain paths. This is also a lot of needless work, since for the purpose of determining if something needs to rebuild, during the first build it should know for certain that it needs to be built.
This is difficult to fix because the fingerprinting code is fairly tricky and subtle. One idea I had was to add a new FirstRun
variant to LocalFingerprint
that will be used if this is a build script that has never been run. The LocalFingerprint
should then get adjusted to the correct value here. However, I vaguely recall trying this and running into problems.
- Fixing this for
cargo doc
isn't feasible unlessrustdoc
adds the ability to emit a dep-info file somehow.- Tracked in Tracking Issue for
-Zrustdoc-depinfo
#15370.
- Tracked in Tracking Issue for