UBT drops UHT input-cache settings when reusing a saved target makefile

Summary

On a Windows UE 5.8.4 source build, UBT honors the project setting bEnableUHTInputCache=true when it creates a fresh editor target makefile. When UBT reuses the saved makefile, the next UHT run receives both input-cache flags as false.

What Type of Bug are you experiencing?

Foundation (C++ Tools, Profiling, & Pipeline)

Steps to Reproduce

  1. In the project’s Saved/UnrealBuildTool/BuildConfiguration.xml, enable the UHT input cache.
<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
  <UEBuildConfiguration>
    <bEnableUHTInputCache>true</bEnableUHTInputCache>
  </UEBuildConfiguration>
</Configuration>
  1. Build a C++ editor target with a fresh target makefile. Check that TargetSettings.EnableInputCacheRead and TargetSettings.EnableInputCacheWrite are both true in the generated .uhtmanifest. The UHT log reports input-cache statistics.
  2. Edit only a doc comment on an existing reflected declaration, such as a UFUNCTION. Rebuild the same target with the same arguments and verify UBT reuses the existing makefile.
  3. Inspect the new manifest and the UHT log.

Expected Result

Both cache flags stay true on the second run because the project build configuration is unchanged.

Observed Result

Both cache flags become false on the second run, and the UHT log omits the input-cache statistics. Regenerating the target makefile restores both flags for that build.

Affects Versions

5.8

Platform(s)

Windows

Additional Notes

TargetMakefile serializes and reloads UHTTargetSettings. In Engine/Source/Programs/Shared/EpicGames.Core/UHTTypes.cs, the binary reader and writer for UHTTargetSettings omit EnableInputCacheRead and EnableInputCacheWrite, leaving both at their defaults after deserialization. I found the omission in the release and dev-5.9 branch sources. The runtime behavior was reproduced on 5.8.4.

This also explains why enabling the input cache can stop working as a workaround for the separate NetCore package-hash issue.

A fix is proposed in Unreal Engine PR #15480 for the release branch.