Visual Studio fails to perform incremental builds

I'm currently using Visual Studio 2005 to compile our Visual C++ application that was converted from Visual C++ 6.0.

I'm finding however that my project no longer incrementally builds. If I change 1 source file (not a header) my entire project has to rebuilt! My project takes almost 2 hours to rebuild. This was not an issue in Visual C++ 6.0 and other developers on our project do not appear to have this problem.

My question is, what other files besides source/header files does Visual Studio use to determine that my entire project has to be rebuilt It appears that there is some other dependency. Can visual studio show me the reason why everything is rebuilding

We are using a Windows Clearcase environment and I had the following files checked out:

myproj.vsscc

myproj.vcproj.vsscc

myproj.vcproj

myproj.sln

I performed two builds back-to-back. The first should have recompiled everything (which it did). The second I performed a 'touch' of a single .cxx file and the entire application was rebuilt. Please explain the unneccessary compilation.




Answer this question

Visual Studio fails to perform incremental builds

  • MWatts

    I was only able to resolve the problem by creating a new clean clearcase view. I have not seen the problem in my new view.

    The other things I tried were:

    1) Performing clean builds. This did not work.

    2) Deleting compilation files manually. I tried to cleanout most of the view-private files that visual studio creates. I must have missed some as this did not resolve my issue.

    My question is where is the dependency graph stored Is it stored in a file or created on-the-fly

    The action that seems to have precipitated the continual rebuilds was the following: I modified our solution by deleting old, unused build configurations. I performed a build with my new solution. I then un-checkedout my changes to the solution (reverting back to the solution that contained the old configurations). From here on, a full build was performed each time. I do not have the time to move the hundreds of files out of clearcase to test unforunately if clearcase or a clearcase/Visual Studio interaction is the problem.

    I wonder if this is related to a long-standing behaviour I've seen with Visual Studio (Visual C++ 6.0 included) where if an un-checkout is performed, Visual Studio is unaware that this has occured (I presume since the timestamp of the file is now older than the compiled .obj file) and fails to pickup the reverted changes.



  • David d48701

    Hi Craig,

    This seems like a bug in our dependency graph resolution. Have you been able to isolate the difference between your setup and others on your team Does the problem occur without clearcase If possible, can you send us a representative sample (borisj@microsoft.com) that reproduces the problem

    Thanks,



  • minibus

    If managed to get a project to reproduce the issue, please log it at http://connect.microsoft.com/Main/content/content.aspx ContentID=2220

    Thanks in advance for taking the time to log the issue!

    Thanks,
    Ayman Shoukry
    VC++ Team


  • Evan Mulawski

    Delete the .ilk file and rebuild.

  • barkingdog

    I think Visual Studio, like most build systems, compares the .obj to the .cpp (and other source) files, and only rebuilds if the source files are newer. When you uncheckout, your source file gets even older, which doesn't trigger the rebuild.

    I've hit this a few times, and the clean build has taken care of it. If that is leaving some junk around, you should be able to do a DEL * /s in your view folder to clean out all the view-private files.

    If you're using a snapshot view, clearcase can set the timestamp on the files to either the VOB time or the current time when your view is updated. Setting it to "current time" should help cut down on these time-travel issues. As far as I know, you've got to do this at view creation time; I don't see an option to change this on an existing view.

    -Frank


  • Visual Studio fails to perform incremental builds