dotnet / project-system

The .NET Project System for Visual Studio
MIT License
971 stars 389 forks source link

msbuild keeps rebuilding projects possibly because of incorrect time diff results #5489

Closed jeffsaremi closed 5 years ago

jeffsaremi commented 5 years ago

Visual Studio Version:

$ dotnet --version 2.2.402 Ubuntu 16.04

Summary: When I enable diagnostics to find reasons why my solution keeps getting rebuilt, I see statements like Input file is newer than output file I have investigated a large number of them and they all seem bogus. ( i have replaced some names to protect the innocent)

Input file "/home/jesaremi/aris/projects/controller/output/packages/controller/Content/opt/controller/bin/SomeNameController.Common.dll" is newer than output file ".obj/SomeNameController.Base.dll".
Input file "app.config" is newer than output file "../../output/packages/controller/Content/opt/controller/bin/SomeNameBigDataCluster.Client.dll.config".
Input file "app.config" is newer than output file "../../output/packages/controller/Content/opt/controller/bin/SomeNameController.Base.dll.config".
Input file "/home/jesaremi/aris/projects/controller/output/packages/controller/Content/opt/controller/bin/SomeNameController.Base.dll" is newer than output file ".obj/SomeNameMetadataStorage.dll".
Input file "/home/jesaremi/aris/projects/controller/output/packages/controller/Content/opt/controller/bin/SomeNameKubernetes.Client.dll" is newer than output file ".obj/SomeNameDataPoolManagement.dll".
Input file "app.config" is newer than output file "../../output/packages/controller/Content/opt/controller/bin/SomeNameDataPoolManagement.dll.config".
Input file "/home/jesaremi/aris/projects/controller/output/packages/controller/Content/opt/controller/bin/SomeNameController.Base.dll" is newer than output file ".obj/SomeNameController.pdb".
[_SourceItemsToCopyToOutputDirectory: Input=/home/jesaremi/aris/projects/controller/src/SomeNameController/Templates/Definitions/sqloperator.json, Output=../../output/packages/controller/Content/opt/controller/bin/Templates/Definitions/sqloperator.json] Input file is newer than output file.
[_SourceItemsToCopyToOutputDirectory: Input=/home/jesaremi/aris/projects/controller/src/SomeNameController/Templates/Deployment/svc-ag-secondary-external.json.tmpl, Output=../../output/packages/controller/Content/opt/controller/bin/Templates/Deployment/svc-ag-secondary-external.json.tmpl] Input file is newer than output file.
[_SourceItemsToCopyToOutputDirectory: Input=/home/jesaremi/aris/projects/controller/src/SomeNameController/Templates/Configuration/Hadoop/core-site.xml, Output=../../output/packages/controller/Content/opt/controller/bin/Templates/Configuration/Hadoop/core-site.xml] Input file is newer than output file.
[_SourceItemsToCopyToOutputDirectory: Input=/home/jesaremi/aris/projects/controller/src/SomeNameController/Templates/Configuration/Hadoop/hdfs-site.xml, Output=../../output/packages/controller/Content/opt/controller/bin/Templates/Configuration/Hadoop/hdfs-site.xml] Input file is newer than output file.
[_SourceItemsToCopyToOutputDirectory: Input=/home/jesaremi/aris/projects/controller/src/SomeNameController/Templates/Configuration/Hadoop/mapred-site.xml, Output=../../output/packages/controller/Content/opt/controller/bin/Templates/Configuration/Hadoop/mapred-site.xml] Input file is newer than output file.

Examples of timestamp verification:


jesaremi@SPE-316M1R2-15:~/aris/projects/controller$ ls -l output/packages/controller/Content/opt/controller/bin/SomeNameInfluxDB.Client.dll.config
-rw-rw-r-- 1 jesaremi jesaremi 420 Aug 19 10:34 output/packages/controller/Content/opt/controller/bin/SomeNameInfluxDB.Client.dll.config
jesaremi@SPE-316M1R2-15:~/aris/projects/controller$ ls -l /home/jesaremi/aris/projects/controller/src/SomeNameController/Templates/Configuration/Hadoop/core-site.xml
-rwxrwxr-x 1 jesaremi jesaremi 5357 Sep  3 20:24 /home/jesaremi/aris/projects/controller/src/SomeNameController/Templates/Configuration/Hadoop/core-site.xml
jesaremi@SPE-316M1R2-15:~/aris/projects/controller$ ls -l ../../output/packages/controller/Content/opt/controller/bin/Templates/Configuration/Hadoop/core-site.xml
ls: cannot access '../../output/packages/controller/Content/opt/controller/bin/Templates/Configuration/Hadoop/core-site.xml': No such file or directory
jesaremi@SPE-316M1R2-15:~/aris/projects/controller$ ls -l output/packages/controller/Content/opt/controller/bin/Templates/Configuration/Hadoop/core-site.xml
-rwxrwxr-x 1 jesaremi jesaremi 5357 Sep  3 20:24 output/packages/controller/Content/opt/controller/bin/Templates/Configuration/Hadoop/core-site.xml

Steps to Reproduce:

  1. dotnet msbuild /t:build /p:Configuration=Release some_solution.sln

Expected Behavior: Do not rebuild!

Actual Behavior: It Rebuilds!

User Impact: Messed up projects/Hugely wasted developer time

jeffsaremi commented 5 years ago

I wanted to emphasize that I am not claiming that the rebuilds are because of this. May be unrelated.

davkean commented 5 years ago

Closing in lieu of this: https://github.com/microsoft/msbuild/issues/4735, we're not involved in command-line at all.