[Bug report] BuildGraph fails to add build products to manifest when module is marked ClientOnly and building for Server target

We’re using BuildGraph to compile our plugin for various targets, including dedicated server. We’ve observed that when building for the server target in 5.8, BuildGraph incorrectly expects ClientOnly modules in the plugin to have emitted a Module.ModuleName.cpp.o file for the manifest, even though it won’t be built because the module is client-only.

This is what BuildGraph invokes the compilation as on our system:

C:\UES\b34bjau2jf2_6f\Engine\Binaries\ThirdParty\DotNet\10.0\win-x64\dotnet.exe "C:\UES\b34bjau2jf2_6f\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" UnrealServer Linux Development -Manifest=C:\UES\b34bjau2jf2_6f\Engine\Intermediate\Build\Manifest.xml -Project="C:\UES\27-looyhftwrgj/.uet/tmp/H/H.uproject" -plugin="C:\UES\27-looyhftwrgj/.uet/tmp/H/Plugins/P/OnlineSubsystemRedpointEOS.uplugin" -DisableAdaptiveUnity -AllCores -log="C:\UES\b34bjau2jf2_6f\Engine\Programs\AutomationTool\Saved\Logs\UBA-UnrealServer-Linux-Development.txt"

And this is the error we get from BuildGraph:

BUILD FAILED: AddBuildProductsFromManifest: C:\UES\27-looyhftwrgj\.uet\tmp\H\Plugins\P\Intermediate\Build\Linux\x64\UnrealServer\Development\REVC\Module.REVC.cpp.o was in manifest "C:\UES\b34bjau2jf2_6f\Engine\Intermediate\Build\Manifest.xml" but could not be found.

Our workaround for now is to change the module type from ClientOnly back to Runtime, but this is less than ideal because we don’t want the module to load for dedicated servers.

[Attachment Removed]

Steps to Reproduce

  • Create a plugin
  • Mark one of it’s modules as “ClientOnly” type
  • Build the plugin for the Server target using BuildGraph
  • Observe the error:

BUILD FAILED: AddBuildProductsFromManifest: C:\UES\27-looyhftwrgj\.uet\tmp\H\Plugins\P\Intermediate\Build\Linux\x64\UnrealServer\Development\REVC\Module.REVC.cpp.o was in manifest "C:\UES\b34bjau2jf2_6f\Engine\Intermediate\Build\Manifest.xml" but could not be found.

[Attachment Removed]

Hi,

UBT is not strict with the module rules so this type of situation can sometimes happen. My guess would be that the REVC module is referenced by another module of the plugin. You can use the analyze mode to have UBT generate the module dependency information to find the reference chain that leads to REVC. Add -mode=analyze to the UBT command line for the UnrealServer target and the output will list the name of the generated dependency files.

The easiest will be to kick UAT and stop it before it’s done so the host project is left behind. You will then be able to use the same UBT command on it:

C:\UES\b34bjau2jf2_6f\Engine\Binaries\ThirdParty\DotNet\10.0\win-x64\dotnet.exe "C:\UES\b34bjau2jf2_6f\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" UnrealServer Linux Development -Manifest=C:\UES\b34bjau2jf2_6f\Engine\Intermediate\Build\Manifest.xml -Project="C:\UES\27-looyhftwrgj/.uet/tmp/H/H.uproject" -plugin="C:\UES\27-looyhftwrgj/.uet/tmp/H/Plugins/P/OnlineSubsystemRedpointEOS.uplugin" -DisableAdaptiveUnity -AllCores -log="C:\UES\b34bjau2jf2_6f\Engine\Programs\AutomationTool\Saved\Logs\UBA-UnrealServer-Linux-Development.txt" -mode=analyze

Regards,

Martin

[Attachment Removed]

Turns out this module being marked as ClientOnly was actually just a mistake (not only was it referenced by other modules, but it also included code that should be present for dedicated servers). Good to know how to track down dependencies in the future with -mode=analyze though.

[Attachment Removed]