Describe the bug
The QtUpdateCompilerOptions build target is adding anywhere from two to four entire minutes to every build.
Using vcperf produces an ETL file which shows MSBuild open, using only a moderate amount of CPU, for the entire duration of the lag spike, after which actual compiling begins and completes near-instantly. Vcperf is incapable of displaying the cause of the lag; I was lucky to find the appropriate logging option in Visual Studio (after enabling basically every logging-related environment variable and UI option that Microsoft ever added to VS over the last ten years).
I believe the VS logging option that allowed me to narrow this down to Qt VS Tools was: Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity, set to value Diagnostic.
My current project/solution is not public. I would rather not have to provide the whole thing at this time, if that can be avoided.
Expected behavior
It shouldn't take four entire minutes just for Qt VS Tools to tamper with command line options before Visual Studio can even start compiling anything. What in the blazes are you doing?
Desktop (please complete the following information):
- Qt VS Tool Version 3.5.0
- Visual Studio version VS2026
Additional context
Excerpts from build output produced after making a single-line change to my code, with the aforementioned MSBuild diagnostic setting enabled:
8>01:21:04.105 1>Target "QtUpdateCompilerOptions: (TargetId:2471)" in file "C:\Users\Cobb\AppData\Local\QtMsBuild\qt_build.targets" from project "D:\UserContent\Cobb\Documents\Development\Modding\Skyrim\DovahKit\build\DovahKit\DovahKit\DovahKit.vcxproj" (target "FixupCLCompileOptions" depends on it):
8>01:24:36.583 1>Done building target "QtUpdateCompilerOptions" in project "DovahKit.vcxproj".: (TargetId:2471)
and in here, DovahKit.vcxproj is the affected project; two of its dependency projects are included for comparison's sake:
D:\UserContent\Cobb\Documents\Development\Modding\Skyrim\DovahKit\build\DovahKit\Lua\Lua.vcxproj 4 calls
8> 4 ms GetTargetPath 1 calls
8> 1 ms GetNativeManifest 1 calls
8> 48 ms GetProjectInfoForReference 1 calls
8> 5 ms GetCopyToOutputDirectoryItems 1 calls
8> 85 ms D:\UserContent\Cobb\Documents\Development\Modding\Skyrim\DovahKit\build\DovahKit\VulkanMemoryAllocator\VulkanMemoryAllocator.vcxproj 4 calls
8> 5 ms GetTargetPath 1 calls
8> 0 ms GetNativeManifest 1 calls
8> 75 ms GetProjectInfoForReference 1 calls
8> 5 ms GetCopyToOutputDirectoryItems 1 calls
8> 287728 ms D:\UserContent\Cobb\Documents\Development\Modding\Skyrim\DovahKit\build\DovahKit\DovahKit\DovahKit.vcxproj 3 calls
8> 287725 ms Build 1 calls
8> 3 ms QtVarsRead 2 calls
8>
8>Target Performance Summary:
8> 0 ms QtQmlSetModified 1 calls
8> 0 ms ComputeManifestGeneratedLinkerInputs 1 calls
8> 0 ms ComputeRCGeneratedLinkInputs 1 calls
8> 0 ms ComputeRCOutputs 1 calls
8> 0 ms BeforeLink 1 calls
8> 0 ms BuildLinkTraverse 1 calls
8> 0 ms BuildCompile 1 calls
8> 0 ms _BuildCompileAction 1 calls
8> 0 ms AfterBuildCompileEvent 1 calls
8> 0 ms _ResourceCompile 1 calls
8> 0 ms AfterResourceCompile 1 calls
8> 0 ms SelectResourceCompile 1 calls
8> 0 ms MakeDirsForResourceCompile 1 calls
8> 0 ms BeforeResourceCompile 1 calls
8> 0 ms ComputeLinkInputsFromProject 1 calls
8> 0 ms _ClCompile 1 calls
8> 0 ms ForciblyDisableModules 1 calls
8> 0 ms QtQml 1 calls
8> 0 ms QtQmlCreateItems 1 calls
8> 0 ms QtQmlCache 1 calls
8> 0 ms QtQmlCacheItem 1 calls
8> 0 ms QtQmlCacheLoader 1 calls
8> 0 ms QtRccFilter 1 calls
8> 0 ms QtRccFilterSetModified 1 calls
8> 0 ms QtRccPrepare 3 calls
8> 0 ms QtRccInit 1 calls
8> 0 ms QtTranslation 1 calls
8> 0 ms QtGetDefaultClCompile 1 calls
8> 0 ms AddLibrariesToProjectsInfoForReference 7 calls
8> 0 ms AfterClCompile 1 calls
8> 0 ms ResolvedLinkLib 8 calls
8> 0 ms ComputeResolveLinkObj 1 calls
8> 0 ms QtRccPass2 1 calls
8> 0 ms IncrementalClean 1 calls
8> 0 ms AfterBuild 1 calls
8> 0 ms BuildLink 1 calls
8> 0 ms _BuildLinkAction 1 calls
8> 0 ms PostBuildEvent 1 calls
8> 0 ms PrepareForRun 1 calls
8> 0 ms CopyFilesToOutputDirectory 1 calls
8> 0 ms _CheckForCompileOutputs 1 calls
8> 0 ms _CopySourceItemsToOutputDirectory 1 calls
8> 0 ms _Deploy 1 calls
8> 0 ms _Appverifier 1 calls
8> 0 ms CreateSatelliteAssemblies 1 calls
8> 0 ms _GenerateSatelliteAssemblyInputs 1 calls
8> 0 ms QtRccPass2_GetObjs 1 calls
8> 0 ms MakeDirsForFxc 1 calls
8> 0 ms _BscMake 1 calls
8> 0 ms MakeDirsForBscMake 1 calls
8> 0 ms ComputeCLCompileGeneratedSbrFiles 1 calls
8> 0 ms _XdcMake 1 calls
8> 0 ms ResolvedXDCMake 1 calls
8> 0 ms _Manifest 1 calls
8> 0 ms _ALink 1 calls
8> 0 ms _Link 1 calls
8> 0 ms QtNatvis 1 calls
8> 0 ms PreLinkEvent 1 calls
8> 0 ms PrepareResourceNames 1 calls
8> 0 ms CreateCustomManifestResourceNames 1 calls
8> 0 ms QtRccPass2_Link 1 calls
8> 0 ms SatelliteDllsProjectOutputGroup 1 calls
8> 0 ms AddDeployRecipeFileToProjectsInfoForReference 7 calls
8> 0 ms Build 1 calls
8> 0 ms SelectCustomBuild 1 calls
8> 0 ms PrepareProjectReferences 8 calls
8> 0 ms _RemoveNameMetadataFromProjectReferenceItems 1 calls
8> 0 ms BeforeClCompile 1 calls
8> 0 ms AddExternalIncludDirectoriesToPaths 8 calls
8> 0 ms GetTargetPath 7 calls
8> 0 ms BuildGenerateSources 1 calls
8> 0 ms _BuildGenerateSourcesAction 1 calls
8> 0 ms AfterBuildGenerateSourcesEvent 1 calls
8> 0 ms AfterBuildGenerateSources 1 calls
8> 0 ms _Midl 1 calls
8> 0 ms AfterMidl 1 calls
8> 0 ms MakeDirsForMidl 1 calls
8> 0 ms _Xsd 1 calls
8> 0 ms CopyFileToFolders 1 calls
8> 0 ms ComputeCustomBuildOutput 1 calls
8> 0 ms AddPublicBMIsToProjectsInfoForReference 7 calls
8> 0 ms _SelectedFiles 1 calls
8> 0 ms PreBuildEvent 1 calls
8> 0 ms BeforeBuildGenerateSources 1 calls
8> 0 ms BuildGenerateSourcesTraverse 1 calls
8> 0 ms ResolveReferences 8 calls
8> 0 ms AfterResolveReferences 8 calls
8> 0 ms ExpandSDKReferences 8 calls
8> 0 ms ResolveSDKReferences 8 calls
8> 0 ms GetFrameworkPaths 8 calls
8> 0 ms FindReferenceAssembliesForReferences 1 calls
8> 0 ms DisableProjectReferenceRecursionForClInputs 7 calls
8> 0 ms BuildCompileTraverse 1 calls
8> 0 ms GetPublicIncludeDirectories 7 calls
8> 0 ms _AddOutputPathToGlobalPropertiesToRemove 8 calls
8> 0 ms BeforeResolveReferences 8 calls
8> 0 ms ATGEnsureShaders 1 calls
8> 0 ms AddPublicIncludeDirectoriesToProjectsInfoForReference 7 calls
8> 0 ms IgnoreJavaScriptOutputAssembly 8 calls
8> 1 ms _PrepareForBuild 1 calls
8> 1 ms SplitResourcesByCulture 1 calls
8> 1 ms ComputeManifestInputsTargets 1 calls
8> 1 ms QtRccOverrideCpp 3 calls
8> 1 ms ResolveAssemblyReferences 8 calls
8> 1 ms ComputeMIDLGeneratedCompileInputs 8 calls
8> 1 ms QtMocUpdate 1 calls
8> 1 ms AfterLink 1 calls
8> 1 ms GetProjectInfoForReference 7 calls
8> 1 ms QtQmlStaticGenerateImportFile 1 calls
8> 1 ms ComputeReferenceLinkInputs 1 calls
8> 1 ms QtQmlCachePrepare 3 calls
8> 1 ms QtVars 1 calls
8> 1 ms _PopulateCommonStateForGetCopyToOutputDirectoryItems 8 calls
8> 1 ms ComputeCLGeneratedLinkInputs 1 calls
8> 1 ms FinalizeBuildStatus 1 calls
8> 1 ms MakeDirsForXdcMake 1 calls
8> 1 ms ComputeLegacyManifestEmbedding 1 calls
8> 2 ms SetCABuildNativeEnvironmentVariables 8 calls
8> 2 ms _CleanGetCurrentAndPriorFileWrites 1 calls
8> 2 ms GetResolvedLinkLibs 7 calls
8> 2 ms ComputeReferenceCLInput 1 calls
8> 2 ms QtRccSetDependencies 3 calls
8> 2 ms GetResolvedWinMD 8 calls
8> 3 ms GetCopyToOutputDirectoryXamlAppDefs 8 calls
8> 3 ms _SplitProjectReferencesByFileExistence 8 calls
8> 3 ms GetReferenceAssemblyPaths 8 calls
8> 3 ms DoLinkOutputFilesMatch 1 calls
8> 3 ms _PrepareForReferenceResolution 8 calls
8> 3 ms QtUpdateLinkOptions 1 calls
8> 3 ms ComputeLinkSwitches 1 calls
8> 3 ms QtVarsRead 1 calls
8> 3 ms BuiltProjectOutputGroup 1 calls
8> 3 ms QtVarsLoad 1 calls
8> 3 ms GetTargetPathWithTargetPlatformMoniker 7 calls
8> 3 ms GetNativeManifest 7 calls
8> 4 ms _CheckWindowsSDKInstalled 8 calls
8> 4 ms QtRccSetModified 3 calls
8> 4 ms ComputeCLCompileGeneratedXDCFiles 1 calls
8> 4 ms InitializeBuildStatus 1 calls
8> 4 ms _GetCopyToOutputDirectoryItemsFromThisProject 8 calls
8> 5 ms QtUicInit 1 calls
8> 5 ms MakeDirsForLink 1 calls
8> 5 ms SetTelemetryEnvironmentVariables 1 calls
8> 6 ms SelectClCompile 1 calls
8> 6 ms CustomBuild 1 calls
8> 7 ms ResourceCompile 1 calls
8> 7 ms RegisterOutput 1 calls
8> 8 ms LogAllBuildInfo 1 calls
8> 11 ms _GetProjectReferenceTargetFrameworkProperties 8 calls
8> 11 ms AssignProjectConfiguration 8 calls
8> 13 ms QtMocInit 1 calls
8> 13 ms AssignTargetPaths 8 calls
8> 14 ms MakeDirsForCl 3 calls
8> 14 ms ComputeCLInputPDBName 8 calls
8> 14 ms CreateRecipeFile 1 calls
8> 19 ms QtRcc 3 calls
8> 20 ms _CheckForInvalidConfigurationAndPlatform 8 calls
8> 21 ms SetModuleDependencies 3 calls
8> 21 ms SetCppLanguageStandardCapabilities 8 calls
8> 22 ms ContentFilesProjectOutputGroup 1 calls
8> 23 ms QtUicPrepare 167 calls
8> 28 ms QtUicSetModified 167 calls
8> 28 ms QtVarsPrepare 1 calls
8> 32 ms ComputeStdModulesCompileInputs 8 calls
8> 39 ms ComputeCLOutputs 1 calls
8> 43 ms SetBuildDefaultEnvironmentVariables 8 calls
8> 46 ms WarnCompileDuplicatedFilename 8 calls
8> 48 ms QtPrepare 1 calls
8> 49 ms QtMocPrepare 332 calls
8> 60 ms QtMocSetModified 332 calls
8> 70 ms PrepareForBuild 8 calls
8> 82 ms GetReferencedVCProjectsInfo 8 calls
8> 86 ms TlogCleanup 1 calls
8> 122 ms QtQmlStaticGatherQmlPaths 1 calls
8> 144 ms QtHash 1 calls
8> 227 ms QtWork 1 calls
8> 230 ms QtAddCompilerSources 1 calls
8> 280 ms QtWorkPrepare 502 calls
8> 356 ms ResolveProjectReferences 8 calls
8> 387 ms QtUic 167 calls
8> 447 ms QtMocOverrideCpp 332 calls
8> 617 ms FixupCLCompileOptions 8 calls
8> 686 ms QtDeploy 1 calls
8> 2655 ms QtMoc 332 calls
8> 7678 ms Link 1 calls
8> 9218 ms _GetCopyToOutputDirectoryItemsFromTransitiveProjectReferences 8 calls
8> 9234 ms GetCopyToOutputDirectoryItems 8 calls
8> 51548 ms ClCompile 1 calls
8> 212478 ms QtUpdateCompilerOptions 1 calls
8>
8>Build succeeded.
The source code for the QtUpdateCompilerOptions build target is here. It's configured to produce log output if QtOptionsBuildLog (apparently corresponding to the "Show in Build Log" option in Qt settings) is turned on. The resulting log output, from a later build, was:
8>11:09:24.311 1>Target "QtUpdateCompilerOptions: (TargetId:2471)" in file "C:\Users\Cobb\AppData\Local\QtMsBuild\qt_build.targets" from project "D:\UserContent\Cobb\Documents\Development\Modding\Skyrim\DovahKit\build\DovahKit\DovahKit\DovahKit.vcxproj" (target "FixupCLCompileOptions" depends on it):
8> Qt - Additional Compiler Options (TaskId:3146)
8> [dovahscript\wrappers\form\dialogue_branch.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:3147)
8> [dovahscript\wrappers\form\navmesh.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:3148)
8> [dovahscript\wrappers\form\navmesh\collection_base_forms.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:3149)
8> [dovahscript\wrappers\form\navmesh\collection_door_links.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:3150)
8> [dovahscript\wrappers\form\navmesh\collection_triangles.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:3151)
...Similar lines are produced for every single cpp file in the project, including files produced by Qt codegen, with the results literally exceeding this issue form's character limit...
8> [xaudio2\simple_fuz_sound.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4503)
8> [xaudio2\xwma_file_info.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4504)
8> [DefaultClCompile]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4505)
8> [x64\Debug\qt\rcc\qrc_all_compiled.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4506)
8> [x64\Debug\qt\rcc\qrc_resources.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4507)
8> [x64\Debug\qt\rcc\qrc_widget-assets.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4508)
8> [x64\Debug\qt\moc\moc_DKAudioWidgetSimple.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4509)
8> [x64\Debug\qt\moc\moc_simple_fuz_sound.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4510)
8> [x64\Debug\qt\moc\moc_DKTopicOrSubtypePickerModel.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4511)
8> [x64\Debug\qt\moc\moc_DKMagicEffectListModel.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4512)
8> [x64\Debug\qt\moc\moc_QuestTabScenes.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4513)
...snip: more MOC...
8> [x64\Debug\qt\moc\moc_shout_word.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4835)
8> [x64\Debug\qt\moc\moc_form_table.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4836)
8> [x64\Debug\qt\moc\moc_QLinedTreeView.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4837)
8> [x64\Debug\qt\moc\moc_object_window.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4838)
8> [x64\Debug\qt\moc\moc_core.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4839)
8> [x64\Debug\qt\moc\moc_main_window.cpp]: -Zc:rvalueCast -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus (TaskId:4840)
8>11:12:49.829 1>Done building target "QtUpdateCompilerOptions" in project "DovahKit.vcxproj".: (TargetId:2471)
The total number of CPP files that this build target is processing is 1694.
Describe the bug
The
QtUpdateCompilerOptionsbuild target is adding anywhere from two to four entire minutes to every build.Using vcperf produces an ETL file which shows MSBuild open, using only a moderate amount of CPU, for the entire duration of the lag spike, after which actual compiling begins and completes near-instantly. Vcperf is incapable of displaying the cause of the lag; I was lucky to find the appropriate logging option in Visual Studio (after enabling basically every logging-related environment variable and UI option that Microsoft ever added to VS over the last ten years).
I believe the VS logging option that allowed me to narrow this down to Qt VS Tools was: Options -> Projects and Solutions -> Build and Run -> MSBuild project build output verbosity, set to value Diagnostic.
My current project/solution is not public. I would rather not have to provide the whole thing at this time, if that can be avoided.
Expected behavior
It shouldn't take four entire minutes just for Qt VS Tools to tamper with command line options before Visual Studio can even start compiling anything. What in the blazes are you doing?
Desktop (please complete the following information):
Additional context
Excerpts from build output produced after making a single-line change to my code, with the aforementioned MSBuild diagnostic setting enabled:
and in here,
DovahKit.vcxprojis the affected project; two of its dependency projects are included for comparison's sake:The source code for the
QtUpdateCompilerOptionsbuild target is here. It's configured to produce log output ifQtOptionsBuildLog(apparently corresponding to the "Show in Build Log" option in Qt settings) is turned on. The resulting log output, from a later build, was:...Similar lines are produced for every single
cppfile in the project, including files produced by Qt codegen, with the results literally exceeding this issue form's character limit......snip: more MOC...
The total number of CPP files that this build target is processing is 1694.