-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
depfile generation always rewrites depfiles even for null builds #5172
Comments
Thanks for the report! To confirm though, did this show up high in profiles? I've personally found that running |
It's not so much about a profile issue from a perspective of the work that it does in and of itself, but the side effect that by updating the modification time of the files it can cause other work to happen that is unnecessary. As an example, we have a core io library called 'fdio' that has many dependents, it's depfile is rewritten many times during the build even though it's binary and the dependencies are never altered. |
Ah right yeah, that definitely makes sense! Especially for the mtime of these (which are public facing files) we should avoid touching them on noop builds |
Similar to how we treat lock files, read the contents, compare, and if they're the same don't actually write the file. Closes rust-lang#5172
Don't rewrite dep-info files if they don't change Similar to how we treat lock files, read the contents, compare, and if they're the same don't actually write the file. Closes #5172
If you re-run cargo build, and cargo does no work because no dependencies were altered, the depfiles are still re-written.
Example (trace of open calls with creat/wr during a null build):
The text was updated successfully, but these errors were encountered: