QtMsBuild -> Qt::BuildLock

Viewed 342

We have a fairly large solution (>200 projects) and recently switched to VS2019. We are using Qt 5.14 with Qt Visual Studio Tools 2.7.1.18 and QtMsBuild. After we started using VS 2019 we get the following warning multiple times when we build the solution:

"...\AppData\Local\QtMsBuild\qt_globals.targets(131,5): warning : Qt::BuildLock[{E42AFBC7-0C5E-441F-B1DB-AE4C9E75F86E}]: Waiting..."

The GUID is the GUID from one of the projects in the solution. Sometimes the build process even hangs up on the "Waiting..." but in most cases the warning does not seem to have an obvious effect other than that it is displayed.

My question is: Where does this warning come from? Why does it show? And how can we get rid of it?

1 Answers

I recently had a problem pop up seemingly out of nowhere. It's described in this issue: Visual C++ Builds Failing due to Log File Access Collision

Based on my investigation, Visual Studio appears to be redundantly building project dependencies instead of just referencing them, and when multiple projects with the same dependency build simultaneously, they will both hit a log file (or some other file) simultaneously, causing one to fail due to access restriction.

It seems that the QtMsBuild developers solved this by adding a CriticalSection task to the QtPrepare target preventing concurrent access. The downside is that this gets reported as a warning.

Related