Unreal Build Tool won't notice changes to header files, even if changed on Perforce

Hello! We’ve been running into an issue that seemly pops up at random occasionally.

Someone will submit a change to a header file to our Perforce server. When someone else syncs the new header file, Unreal doesn’t see this header file as changed. Therefore there will be build errors, as Unreal is trying to use the cached version of the header file, which doesn’t have the changes. When actually opening the header file in a text editor, the changes are in fact there. It just seems like Unreal’s build tool doesn’t mark the file as dirty when it goes to rebuild it.

We haven’t found a way to reproduce this issue consistently. However we are able to temporarily fix the issue by adding a newline to the affected header file. Unreal will then notice the change, and rebuild that header file.

One lead we have is that any file that ends up in this state, seems to be files that have multiple structs in one header file. We’ve tried splitting them up into separate header files whenever this occurs.

This issue affects multiple people, so it isn’t just one person running into this issue. We can’t tell if it’s potentially an Unreal issue, or a perforce issue. If anyone has dealt with this issue before, or might have an idea on what’s causing it, lemme know. Thanks!

Unreal Engine 5.5.4
P4V 2025.1 April 7.

i’ve found that that’s usually a windows thing when storing and/or notifying changes to the accessed and modified times on files.
i assume you have unreal closed when doing the upadet.

This can also comes from P4 workspace. See P4 doc: Perforce Support Portal. Check that the modtime is not checked. This is my P4 workspace settings:

1 Like