Dependency handling regression in 5.8 when linking third-party static libraries

In 5.8, changes to third-party static libraries do not always trigger a rebuild of libraries that depend on them.

This seems to be due to commit 24dccd7470bb (changelist 45674266). ActionGraph.IsImportLibraryDependency(LinkedAction, FileItem) always returns true whenever the prerequisite is a library file and the link action has any prerequisite action producing an import library. Because that is the normal case for every module in an editor build, UBT skips the timestamp check for all .lib prerequisites. A third-party static library that is rebuilt out-of-band never triggers a relink.

FTR, I also posted here: Dependency handling regression in 5.8 when linking third-party static libraries - General / Issues and Bug Reporting (Unreal Engine) - Epic Developer Community Forums

[Attachment Removed]

Steps to Reproduce
Steps to Reproduce

  1. Build UnrealEditor
  2. Touch Engine/Source/ThirdParty/zlib/1.3/lib/Win64/Release/zlibstatic.lib
  3. Build again

Expected Result

The second build should relink a number of modules including UnrealEditor-Core.dll.

Observed Result

The build doesn’t do any significant work.

[Attachment Removed]

Hello!

I ran some tests and you found the source of the problem. FirstOrDefault is not the same as Contains and will always return a non-null item that way it’s written.

I’ll work with the engine team to get this addressed in a future release. You can use the old version of the code for now.

Thanks for the report!

Martin

[Attachment Removed]