Over-building: _TouchLastBuildWithSkipAnalyzers runs after the build, but its output is considered as an input to the build by FUTDC #9611
Labels
Feature-Up-to-date
Build up-to-date check that avoids shelling out to MSBuild unless necessary.
Triage-Investigate
Reviewed and investigation needed by dev team
Visual Studio Version
17.12.2
Summary
The
_TouchLastBuildWithSkipAnalyzers
target runs afterCoreCompile
(i.e. after producing the output dll), however its output (a file called<projectfile>.BuildWithSkipAnalyzers
) is considered an input to the build by the fast up-to-date check. This causes non-deterministic over-building in the case when the timestamp of the*.BuildWithSkipAnalyzers
file ends up being newer than that of the dll produced byCoreCompile
, i.e. the time elapsed between writing the dll and writing the sentinel file is more than the resolution of file timestamps.Steps to Reproduce
Non-deterministic, depends on timing. In a particular observed case, project X has not changed at all and only some trivial, implementation-only code changes happened in project Y since the last build (project Y has a project reference to X.) However, FUTDC has determined that project X needs to be re-built, because in the last build, the sentinel file was written with a timestamp newer than the dll.
Expected Behavior
Project X is not re-built.
Actual Behavior
1>FastUpToDate: Comparing timestamps of inputs and outputs: (X)
1>FastUpToDate: Input UpToDateCheckInput item '...\X.csproj.BuildWithSkipAnalyzers' is newer (2024-11-25 10:21:17.927) than earliest output '...\X.dll' (2024-11-25 10:21:17.913), not up-to-date. (X)
User Impact
Increased build time due to over-building.
The text was updated successfully, but these errors were encountered: