How to deploy source code build of engine

So I can build a version of the Editor from github and distribute it to other members of the team. Since I checkin in the binaries for Perforce, nobody else needs to build the engine, just me, and everything is fine with regular projects.

However, if I create a Code Project from the UE4 Editor, suddenly people are being forced to rebuild the Editor/Engine and Programs. It looks like the .sln that is generated includes the UE4 programs when a code project is created from a source build. The first error I get, when trying to create a Code project, is that the UE4 Build tool isn’t writeable… but why is it trying to the build tool anyway? Its already built and checked in.

How can I create a distribution of UE4 Editor for internal use that doesn’t require people to build the Editor/Engine for a Code Project?

Many thanks!

Hey -

I managed to find a post from a couple months ago from one of our custom licensed users who spoke with one of our developers about this very process. Let me know if the information in the following post helps get your engine/project compiling properly for your team:

Cheers

Hi ,

Thanks for the link, unfortunately I’m hitting some issues with the latest git code. Is the idea that I add Rocket.txt, InstalledBuild.txt and modify Baseengine.ini BEFORE building the engine?

If I modify them after, the Visual Studio solution for the engine is still building the Unreal Build Tool.

If I modify them before I build, I get an exception in the UnrealBuildTool:

Z:\gitvirgin>GenerateProjectFiles.bat
Setting up Unreal Engine 4 project files...
UnrealBuildTool Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at UnrealBuildTool.ProjectFileGenerator.ConfigureProjectFileGeneration(String[] Arguments, Boolean& IncludeAllPlatforms) in Z:\gitvirgin\Engine\Source\Programs\UnrealBuildTool\System\ProjectFileGenerator.cs:line 805
   at UnrealBuildTool.VCProjectFileGenerator.ConfigureProjectFileGeneration(String[] Arguments, Boolean& IncludeAllPlatforms) in Z:\gitvirgin\Engine\Source\Programs\UnrealBuildTool\System\VCProjectFileGenerator.cs:line 202
   at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(String[] Arguments, Boolean& bSuccess) in Z:\gitvirgin\Engine\Source\Programs\UnrealBuildTool\System\ProjectFileGenerator.cs:line 309
   at UnrealBuildTool.UnrealBuildTool.GenerateProjectFiles(ProjectFileGenerator Generator, String[] Arguments) in Z:\gitvirgin\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1468
   at UnrealBuildTool.UnrealBuildTool.DoPostStartupStuffThatCanAccessConfigs(String[] Arguments) in Z:\gitvirgin\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1266

I’m guessing I’m doing something out of order? Cheers!

Can you list the exact steps you’ve taken in creating the binary engine so far and where you’re getting these errors? Also, after creating the new .txt files and making edits to the .ini file, I would also try to run GenerateProjectFiles.bat for the engine prior to building.

Hi ,

I tried from a fresh setup:

> Setup.bat
> Run Setup.bat
Wait for Setup.bat to fail at 99%, then 
> GenerateProjectFiles,bat, 
> load UE4.sln, modify DependencyManifest.cs to user https instead of http, build GitDependencies, close UE4.sln.
> Run Setup.bat
> Add Rocket.txt, InstalledBuild.txt and modify the Config/BaseEngine.ini as decribed.
> OpenUE4.sln, build fails

At first, I get errors like this in Visual Studio when building (Development Win64)

2>EXEC : error : No modules found to build. All requested binaries were already built.
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command "..\..\Build\BatchFiles\Build.bat ShaderCompileWorker Win64 Development -waitmutex" exited with code 5. 

removing the “InstalledPlatforms” lines from the Config file gives me different errors when I build:

11>UnrealBuildTool Exception : error : GetBuildPlatform: No BuildPlatform found for Win64
11>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3075: The command "..\..\Build\BatchFiles\Build.bat BootstrapPackagedGame Win64 Development -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
21>------ Build started: Project: UE4EditorServices, Configuration: Development_Program x64 ------

If I try to regenerate the project files I get this error:

Z:\git>GenerateProjectFiles.bat
Setting up Unreal Engine 4 project files...
UnrealBuildTool Exception: ERROR: A game project path was not specified, which is required when generating project files using an installed build or passing -game on the command line

GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files.

Cheers, Andy

At what point did you try running GenerateProjectFiles again? This should be done after the first step 7 (Add Rocket.txt…) to ensure the engine recognizes the changes made. Also, when building the engine in Visual Studio for the first time, be sure to build in Development Editor first, then build in other configurations as needed. Can you let me know if receive the same build error if you change the Solution Configuration to Development Editor and build again?

Hi ,

Yes after Step 7. I still get the same errors after building in the Development Editor (though of course I can’t do that after the error). Looking through the code I can also see that the engine looks for Engine/Build/SourceDistribution.txt, is that something else I need to deleted?

Is it possible to post a step-by-step guide you guys have already tested?

Thanks!

Andy

As mentioned in the other post, we do really recommend using the automation tool to make a full ‘Rocket’ build for a reusable engine build. If it wasn’t clear you can do that by opening a command prompt in Engine/Build/BatchFiles and running:

RunUAT.bat GUBP -Node=GatherRocket -TargetPlatforms=Win32+Win64+... -NoDDC -CleanLocal

You may also need to add -NoSign if the machine building it is not capable of signing the build products. Once the command completes successfully you should find the build within the LocalBuilds folder of the UE4 root directory.

I see you’re working with the 4.12 preview, where we’ve changed the file used to indicate a pre-compiled engine build to InstalledBuild.txt to get rid of the Rocket terminology and make this a more generic use. Adding the InstalledBuild.txt file and the BaseEngine.ini entries is done after the engine has been built by GUBP and will prevent these from being built again so if you’re trying to set this up manually then they should definitely be done after building everything. Using the old Rocket.txt file was probably why it was still attempting to rebuild UnrealBuildTool. Hope that gets things working, let us know if not.

Thanks Mat, having a single command line will be a lot easier. I ran this:

Engine\Build\BatchFiles\RunUAT.bat GUBP -Node=GatherRocket -TargetPlatforms=Win64 -NoDDC -CleanLocal -NoSign

But got this error towards the end of the build:

GUBP.ExecuteNode: AutomationTool.AutomationException: Cannot find project 'FP_FirstPerson' in branch
   at AutomationTool.BranchInfo.FindGameChecked(String GameName) in D:\P4\UE4\Dev\Epic\4.12\Engine\Source\Programs\AutomationTool\AutomationUtils\ProjectUtils.cs:line 807
   at Rocket.FilterRocketNode.DoBuild(GUBP bp) in d:\P4\UE4\Dev\Epic\4.12\Engine\Source\Programs\AutomationTool\Scripts\RocketBuild.Automation.cs:line 954
   at AutomationTool.LegacyNode.DoBuild() in d:\P4\UE4\Dev\Epic\4.12\Engine\Source\Programs\AutomationTool\GUBP\Nodes\LegacyNode.cs:line 81
   at GUBP.ExecuteNode(BuildNode NodeToDo, Boolean bFake) in d:\P4\UE4\Dev\Epic\4.12\Engine\Source\Programs\AutomationTool\GUBP\GUBP.cs:line 1506
Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)
Domain_ProcessExit
AutomationToolLauncher exiting with ExitCode=1
copying UAT log files...
BUILD FAILED

There’s an FP_FirstPerson project in my Templates directory, so I think everything’s Setup correctly. maybe something else I need to do?

Ah, I’ve come across this before: Packaging UE4 for distributing internally - Pipeline & Plugins - Epic Developer Community Forums

Relevant part is that you need to add:

Samples/
Templates/

to UE4Games.uprojectdirs then the automation tool will be able to find the sample projects. They’re not in there by default so that they don’t show up in your visual studio projects.

Awesome, thanks . I’m sorted now. Cheers!

Hi,
what’s the step 7 inside,just an empty text? > Add Rocket.txt, InstalledBuild.txt and modify the Config/BaseEngine.ini as decribed