ProjectBorealis / UEGitPlugin

Unreal Engine Git Source Control Plugin (refactored)
MIT License
518 stars 106 forks source link

Cannot compile plugin on 5.3 #128

Closed hueyyeng closed 1 year ago

hueyyeng commented 1 year ago

I'm facing issue where I cannot build the plugin on 5.3.

Here's the error output log:

PS C:\Program Files\Epic Games\UE_5.3\Engine\Build\BatchFiles> .\RunUAT.bat BuildPlugin -plugin="D:\Projects\Perforce\DeleteLater\Plugins\UEGitPlugin\GitSourceControl.uplugin" -package="D:\test"
Running AutomationTool...
Using bundled DotNet SDK version: 6.0.302
Starting AutomationTool...
Parsing command line: BuildPlugin -plugin=D:\Projects\Perforce\DeleteLater\Plugins\UEGitPlugin\GitSourceControl.uplugin -package=D:\test
Initializing script modules...
Total script module initialization time: 0.11 s.
Executing commands...
Copying 113 file(s) using max 64 thread(s)
Reading plugin from D:\test\HostProject\Plugins\GitSourceControl\GitSourceControl.uplugin...
Building plugin for host platforms: Win64
Running: C:\Program Files\Epic Games\UE_5.3\Engine\Binaries\ThirdParty\DotNet\6.0.302\windows\dotnet.exe "C:\Program Files\Epic Games\UE_5.3\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" UnrealEditor Win64 Development -Project="D:\test\HostProject\HostProject.uproject" -plugin="D:\test\HostProject\Plugins\GitSourceControl\GitSourceControl.uplugin" -noubtmakefiles -manifest="D:\test\HostProject\Saved\Manifest-UnrealEditor-Win64-Development.xml" -nohotreload -log="C:\Users\hueyyeng\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.3\UBT-UnrealEditor-Win64-Development.txt"
Log file: C:\Users\hueyyeng\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.3\UBT-UnrealEditor-Win64-Development.txt
Parsing headers for UnrealEditor
  Running Internal UnrealHeaderTool D:\test\HostProject\HostProject.uproject D:\test\HostProject\Intermediate\Build\Win64\UnrealEditor\Development\UnrealEditor.uhtmanifest -WarningsAsErrors -installed
Total of 0 written
Reflection code generated for UnrealEditor in 1.0182352 seconds
Writing manifest to D:\test\HostProject\Saved\Manifest-UnrealEditor-Win64-Development.xml
Building UnrealEditor...
Using Visual Studio 2022 14.37.32822 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Determining max actions to execute in parallel (16 physical cores, 24 logical cores)
  Executing up to 16 processes, one per physical core
------ Building 6 action(s) started ------
[1/6] Resource Default.rc2
[2/6] Compile [x64] SharedPCH.UnrealEd.Cpp20.cpp
[3/6] Compile [x64] Module.GitSourceControl.cpp
D:\test\HostProject\Plugins\GitSourceControl\Source\GitSourceControl\Private\GitSourceControlState.h(143): error C3248: 'ISourceControlState::GetBaseRevForMerge': function declared as 'final' cannot be overridden by 'FGitSourceControlState::GetBaseRevForMerge'
C:\Program Files\Epic Games\UE_5.3\Engine\Source\Developer\SourceControl\Public\ISourceControlState.h(84): note: see declaration of 'ISourceControlState::GetBaseRevForMerge'
D:\test\HostProject\Plugins\GitSourceControl\Source\GitSourceControl\Private\GitSourceControlOperations.cpp(308): warning C4996: 'FMessageDialog::Open': Use the overload of Open that takes the Title by-value. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
D:\test\HostProject\Plugins\GitSourceControl\Source\GitSourceControl\Private\SGitSourceControlSettings.h(10): fatal error C1083: Cannot open include file: 'Launch/Resources/Version.h': No such file or directory
Total time in Parallel executor: 18.20 seconds
Total execution time: 22.36 seconds
Took 22.44s to run dotnet.exe, ExitCode=6
UnrealBuildTool failed. See log for more details. (C:\Users\hueyyeng\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.3\UBT-UnrealEditor-Win64-Development.txt)
AutomationTool executed for 0h 0m 22s
AutomationTool exiting with ExitCode=6 (6)
BUILD FAILED

My understanding with UE 5.3, there is some deprecated function like GetBaseRevForMerge (https://docs.unrealengine.com/5.3/en-US/API/Developer/SourceControl/ISourceControlState/GetBaseRevForMerge/). I'm not familiar with C++ and building Unreal plugin but I'll see if I can try to modify the source and get it to build.

So far the current release branch works fine with UE 5.2 and hopefully this great plugin can be made compatible with 5.3.

marister commented 1 year ago

I am getting the same results 😢 This plugin is the only thing stopping from upgrading engine version to 5.3 Hopefully you guys are able to fix it soon! Thanks for the hard work

hueyyeng commented 1 year ago

Update: I managed to get it build for 5.3 after making the required changes which can be found here: https://github.com/hueyyeng/UEGitPlugin/tree/ue53

@marister Can you try checking out to my forked branch and see if it works for you? I tested just the bare minimum and it works fine for me (locking, submit). Also not sure if just copy paste the modules and DLL files will works Win64.zip

image

@mastercoms Do you want me to create a PR to fix this? I'm not a C++ programmer so I'm not sure if the changes in my forked repo is the correct way. What I can recall is replacing the deprecated function to satisfy C++ 20 and adding if else condition when importing the Launch/Resources/Version.h as that raises Fatal Error c1083 error. I'm unsure on how to approach the fix to satisfy UE 5.2 and 5.3.

marister commented 1 year ago

going to wait a bit for a response. I feel uncomfortable testing it before understanding if GetBaseRevForMerge is actually something that can just be deleted

regarding Launch/Resources/Version.h I think you can try to just switch to Runtime/Launch/Resources/Version.h

mastercoms commented 1 year ago

Hi, I won't be able to review the changes for a bit, unfortunately quite swamped, but on initial glance they look fine

eXifreXi commented 1 year ago

FYI:

UE_DEPRECATED(5.3, "Use GetResolveInfo() and FindHistoryRevision() instead") virtual TSharedPtr<class ISourceControlRevision, ESPMode::ThreadSafe> GetBaseRevForMerge() const final { return FindHistoryRevision(GetResolveInfo().BaseRevision); }

I think the plugin already uses FindHistoryRevision, but it doesn't override GetResolveInfo. Not sure if we should do that.

GennrichJ commented 1 year ago

Using version 3.14 in an Unreal 5.3 project I'm still getting the following compilation error:

Error C4855 implicit capture of 'this' via '[=]' is deprecated in '/std:c++20' UEGitPlugin\Source\GitSourceControl\Private\GitSourceControlRunner.cpp 60