Yes, using snapshots for incremental cooking is an intended use and we are testing it on projects within Epic in 5.8. We have not yet hardened it however, especially not in 5.7, so you may encounter errors with it.
The baseline cook done by the CI system does not need to be an incremental cook; it can be a full recook. It does need the config variable that activates storage of cook dependencies to be set, but this variable is set by default in 5.7. (This required config value is Editor.ini:[CookSettings]:bLegacyIterative=false; you can find its default value set to false in Engine\Config\BaseEditor.ini). The baseline cook must also be cooked with bUseIoStore=true and bUseZenStore=true in Game.ini:[/Script/UnrealEd.ProjectPackagingSettings]. If the cooker is correctly configured to activate the storage of cook dependencies, you will see this log message in the cookcommandlet’s log:
LogCook: Display: INCREMENTAL COOK DEPENDENCIES: Enabled. Incremental Cook Dependencies are enabled in Editor.ini:[CookSettings]:LegacyIterative=false.Otherwise you will see INCREMENTAL COOK DEPENDENCIES: Disabled… and there will be more information about why it was disabled.
Note that the sequence of commands requires oplog-snapshot in addition to oplog-export and oplog-import:
- (Build machine) UnrealEditor <Project> -run=cook -targetplatform=<Platform>
- -forcerecook=true to force a recook is optional, depending on whether you want a full recook
- (BuildMachine) Engine\Binaries\Win64 zen.exe oplog-snapshot --project <ProjectId> --oplog <PlatformName>
- This copies the non-uasset local files referenced by the oplog to be copied into zenserver so they are available in the export
- (BuildMachine) Engine\Binaries\Win64 zen.exe oplog-export --project <ProjectId> --oplog <PlatformName> …
- You will also need to specify -zen or -file for where to export
- (UserMachine) Engine\Binaries\Win64 zen.exe oplog-import --project <ProjectId> --oplog <PlatformName> …
- You will also need to specify -zen or -file that matches where the export was stored
Some of the issues we have fixed with this workflow in 5.8 include indeterminism in the config settings that always trigger a full recook. e.g. spurious differences in CoreRedirects between the build machine and the user machine, due to different sets of plugins enabled. I don’t think any of those will be relevant to the average project, but it is possible you will hit them. In that case you will get spurious recooks the first time you cook on top of a snapshot created by the build machine and you will need to use our incremental cooking false recook tools to diagnose them.
Other than false recooks, I don’t know of any caveats with using this workflow in 5.8; there may still be some in 5.7 that I am forgetting about. Let me know if you run into any issues.
[Attachment Removed]