AssetRegistry.bin is not deterministically cooked.

NativeLibraries is turned off because .ushaderbytecode has a non-deterministic issue in [Link Removed]. And there is a similar issue with UE5 in [Link Removed]. 


\Engine\Source\Editor\UnrealEd\Private\Commandlets\AssetRegistryGenerator.cpp (Line:1254)
void FAssetRegistryGenerator::AddAssetToFileOrderRecursive(const FName& InPackageName, TArray<FName>& OutFileOrder, TSet<FName>& OutEncounteredNames, const TSet<FName>& InPackageNameSet, const TSet<FName>& InTopLevelAssets)
    if (!OutEncounteredNames.Contains(InPackageName))
        TArray<FName> Dependencies; AssetRegistry.GetDependencies(InPackageName, Dependencies, UE::AssetRegistry::EDependencyCategory::Package, UE::AssetRegistry::EDependencyQuery::Hard);

// add_start
        Dependencies.Sort([](const FName& A, const FName& B) { return A.Compare(B) < 0; });
// add_end
\Engine\Source\Editor\UnrealEd\Private\Commandlets\AssetRegistryGenerator.cpp (Line:1497)

FString CookerFileOrderString; FString CookerFileOrderString;
    TArray<FName> TopLevelMapPackageNames;
    TArray<FName> TopLevelPackageNames;
// add_start 
    PackageNameSet.Sort([](const FName& A, const FName& B) { return A.Compare(B) < 0; });
// add_end
    for (FName PackageName : PackageNameSet)
Steps to Reproduce
  1. Open ThirdPersonExample project in UE4Editor.
  2. Set the value of "UsePakFile=Flase" and "SharedMaterialNativeLibraries=False" in Project Settings.
  3. Packaging the project to [Project]/Pak1 directory.
  4. Packaging the project to [Project]/Pak2 directory.
  5. Comparing these directories, a difference occurs in AssetRegistry.bin.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-145162 in the post.

Login to Vote

ComponentUE - Foundation - Core - Cooker
Affects Versions4.27
Target Fix5.1
CreatedMar 8, 2022
ResolvedMar 9, 2022
UpdatedMar 17, 2022
View Jira Issue