c++visual-studio-2019incredibuild

Incredibuild: Compiler failed to generate PCH file


Some members of my team, as well as our build server, are getting a compiler error and failed build when using Incredibuild to build our largest Visual Studio solution. We get the following (sanitized) error:

Target ClCompile: stdafx.cpp

IncrediBuild: Error compiling stdafx.obj: Compiler failed to generate PCH file (no errors reported)

Build FAILED.

Building the affected projects individually first before building the entire solution seems to resolve the issue, but that only works for the developers, it does nothing to solve the issue on the build server. At first, we thought it was an issue with the build order, but that no longer seems to be the case; in one instance we're seeing this with a project that has no other dependencies within the solution, and the other projects that depend on this project have that dependency correctly configured. One of the reasons we thought it might be a build order issue is that it seems to somewhat random, and experience has shown us that poorly defined build dependencies can lead to this type of random build failure. Another reason to think it's not a build order issue is that we haven't made any changes to project files, property files, or the solution files since this started. We did have a fairly significant set of updates applied recently, but that was after the first recorded instance of this issue.

What is the root cause of this issue, and how do we go about preventing it?


Solution

  • Apparently it is caused by some recent Windows Updates. There is a support bulletin about it on Incredibuild's support page with links to download an "emergency patch version" (9.6.10) that fixes the issue: https://incredibuild.force.com/s/.

    I experienced the same problem - the build would succeed on some computers but fail with the "failed to generated PCH file" error on others. Installing this updated version seems to have fixed the issue.