Unable to package UE5 project on Linux. RunUAT.sh.

Hello!

I was trying to package a project at first from UEditor, but I kept getting these errors:

Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so, deleting, waiting 10s and retrying.

Size mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 22 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 678616

Date mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:35:58 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:34:31

There were a bunch of them due the fact that Unreal tried to rerun this stage:

deleting, waiting 10s and retrying.

The last error says:

Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
(see /home/user/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

Here is Log.txt from the suggestion (under spoiler):

Summary
Date mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:35:58 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:34:31
Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so, deleting, waiting 10s and retrying.
SafeDeleteFile /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
Size mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 22 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 678616
Date mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:35:58 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:34:31
Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so, deleting, waiting 10s and retrying.
SafeDeleteFile /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
Size mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 22 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 678616
Date mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:35:58 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:34:31
Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so, deleting, waiting 10s and retrying.
SafeDeleteFile /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
Size mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 22 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 678616
Date mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:35:58 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:34:31
Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so, deleting, waiting 10s and retrying.
SafeDeleteFile /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
Size mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 22 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 678616
Date mismatch /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:35:58 to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so = 04/02/2024 15:34:31
Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
==============================================================================
Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
(see /home/user/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

AutomationException: Failed to copy /home/user/Documents/unreal_projects/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so to /home/user/Documents/unreal_projects/MyProject/Saved/StagedBuilds/Linux/MyProject/Plugins/GeographicLib/Lib/libGeographicLib.so
   at AutomationTool.CommandUtils.CopyFileIncremental(FileReference Source, FileReference Dest, Boolean bAllowDifferingTimestamps, List`1 IniKeyDenyList, List`1 IniSectionDenyList) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/CommandUtils.cs:line 1429
   at AutomationScripts.Project.CopyOrWriteManifestFilesToStageDir(Boolean bPerformCopy, DeploymentContext SC, Dictionary`2 Mapping, String ManifestName) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/CopyBuildToStagingDirectory.Automation.cs:line 2093
   at AutomationScripts.Project.CopyUsingStagingManifest(ProjectParams Params, DeploymentContext SC) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/CopyBuildToStagingDirectory.Automation.cs:line 2149
   at AutomationScripts.Project.ApplyStagingManifest(ProjectParams Params, DeploymentContext SC) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/CopyBuildToStagingDirectory.Automation.cs:line 4632
   at AutomationScripts.Project.CopyBuildToStagingDirectory(ProjectParams Params) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/CopyBuildToStagingDirectory.Automation.cs:line 5082
   at BuildCookRun.DoBuildCookRun(ProjectParams Params) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 236
   at BuildCookRun.ExecuteBuild() in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/Scripts/BuildCookRun.Automation.cs:line 43
   at AutomationTool.BuildCommand.Execute() in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs:line 345
   at AutomationTool.BuildCommand.ExecuteAsync() in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs:line 354
   at AutomationTool.Automation.ExecuteAsync(List`1 CommandsToExecute, Dictionary`2 Commands) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 265
   at AutomationTool.Automation.ProcessAsync(ParsedCommandLine AutomationToolCommandLine, StartupTraceListener StartupListener, HashSet`1 ScriptModuleAssemblies) in /home/user/UnrealEngine/Engine/Source/Programs/AutomationTool/AutomationUtils/Automation.cs:line 164
==============================================================================
AutomationTool executed for 0h 2m 41s
AutomationTool exiting with ExitCode=1 (Error_Unknown)

After that I tried to package the project with UAT tool with a following command:

$UNREALROOTPATH/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -project="${PWD}/MyProject/MyProject.uproject" -nocompileeditor -nop4 -cook -stage -archive -package -clientconfig=Shipping -pak -prereqs -targetplatform=Linux -build -utf8output -archivedirectory="${PWD}/MyProject/Deployment/dir/"

But the errors were the same.

What could be the solution and what am I doing wrong?

p.s. GeographicLib I am using here is from here: https://geographiclib.sourceforge.io/
I compiled it with UE toolchain’s clang. There were one provided by Epics in the path:
‘Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v22_clang-16.0.6-centos7/x86_64-unknown-linux-gnu/bin/clang’