Unreal Engine build fails using SN-DBS with remote agent

Trying to get a clean test of building Unreal Engine 4.24 with SNDBS for comparison purposes. Normal parallel builds on my machine work fine, Incredibuild remote builds work fine, but SN-DBS, ONLY when I use a remote agent, gives me this 100% of the time:

(paths modified for privacy)

19>\UnrealEngine\Engine\Source\ThirdParty\Windows\VisualStudioDTE\VisualStudioDTE.h(24): fatal error C1083: Cannot open include file: ‘comdef.h’: No such file or directory
19>c1xx: note: This error occurred in injected text:
19> #injected_line 24 “\UnrealEngine\Engine\Source\ThirdParty\Windows\VisualStudioDTE\VisualStudioDTE.h”
19>#include <comdef.h>
19>dbsbuild : error : aborting build on error (2)
19>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(49,5): error MSB3073: The command “…..\Build\BatchFiles\Rebuild.bat LiveCodingConsole Win64 Development -WaitMutex -FromMsBuild” exited with code -1.
19>Done building project “LiveCodingConsole.vcxproj” – FAILED.

So anyway, if you look at the file that is causing the error, it is not straightforward at all, I suspect this oddly complex reference that eventually brings in comdef.h is simply too complex for the SN-DBS dependency checker to discover. Which raises the question, how does this work at all for anybody? I guess the last thing I might try is falling back to Visual Studio 17 and see if there is some hack that magically makes it work there but not with Visual Studio 2019 which I believe is not officially supported by SNDBS.

Line 24 in VisualStudioDTE.h: (Unsure if the GUID has privacy issues, so X-ing it out)
#import “libid:XXXXXXXX-e7dX-4ddX-85bX-XXXXXXXXXXXX” version(“8.0”) lcid(“0”) raw_interfaces_only named_guids

Tried Visual Studio 17, didn’t work, same error. I believe this issue is covered in section 7 of the SN-DBS docs, where it says SN-DBS does not fully implement C++ preprocessor rules for the purpose of determining header dependencies, so complex indirect includes cause problems and need to be manually addressed. Incredibuild does not have this problem, so I am throwing in the towel at this point and going with Incredibuild.

Can you update us to let us know if IncrediBuild plays nice with Unreal and resolves your problems in 4.24? Would be great to have it for our team!

Edit: Could you also provide your .ini file so we could try to debug your configuration and see if the include complexity could be improved?

Yes, we are using Incredibuild with good results although there is a significant annual cost attached. It works, though. Builds Unreal Engine 4.24.1 in about 23 minutes initiated from my machine. I have another thread on here, though, about how that time could be much faster if Epic would stop adding small projects to the build that do not parallelize well. The actual main part of the UE4 build involving thousands of files takes only 8 minutes with Incredibuild!

Unsure which INI file you are referring to.