Description
Is your feature request related to a problem? Please describe.
The GenerateDepsFile always writes a new deps.json file, even if the content is the same. This leads to rebuilds all down the target chain. We shouldn't write a deps.json unless the content would be materially different.
sdk/src/Tasks/Microsoft.NET.Build.Tasks/GenerateDepsFile.cs
Lines 253 to 258 in 5457ad3
sdk/src/Tasks/Microsoft.NET.Build.Tasks/GenerateRuntimeConfigurationFiles.cs
Lines 393 to 396 in 5457ad3
The recommended fast approach to this is to use XxHash64 to hash the existing file and the proposed content and compare. If they are the same, do not touch the existing file on disk in these two locations.
For future us: this and NuGet/Home#14355 were the cause of virtually all rebuilds in the internal repo binlog that Rainer and I investigated.