Building and Distributing engine source

My team is trying to switch over to using a compiled source build of UE4 so that we can start making our own customization to the engine.

I’m trying to set up a continuous integration build (using Jenkins) and have been having trouble getting the build to behave as expected.

My current attempts have been based on the answer from IdentiyCrisisUK in this question from a few months ago:

My build process calls

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

This produces a build in \LocalBuilds\Rocket\Windows\ which I and copy to a shared location.

On another computer, I can download and unzip this just fine, however I attempt to register and set this build as the current version using UnrealVersionSelector, but no Win64 version was created. I can use the Win32 version to register the build, but when I try to call -switchversion I get an error that no build platform was found

Running …/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“…/Dev/Shootergame.uproject” -game -rocket -progress
Discovering modules, targets and source code for project…
UnrealBuildTool Exception: ERROR: GetBuildPlatform: No BuildPlatform found for Win64

If I ignore trying to switch the version and just open my build of UE4 and then attempt to load my .uproject I’m prompted that a bunch of modules are missing or built with a different engine version (e.g. UE4Editor-ShooterGame.dll). If I choose to rebuild them I just get an error “ShooterGame could not be compiled. Try rebuilding from source manually.”, with no information as to why the compile failed.

Hello Downs,

While I’ve never run into this issue so I’m not sure what’s causing it, I do have a user created tutorial that may be able to help you. Unfortunately we don’t have an officially documented way to make rocket builds as of yet but this has worked for another member of my team so it may be able to help: .com/Kalmalyzer/UE4RocketBuild

We are grabbing our source from Perforce instead of Github. Under “Building”, I assume I can just throw the contents of the repository on top of where I sync P4, and skip the Setup.bat step?

I’ve not tried following this tutorial using Perforce so I can’t be sure, but that sounds like it would work the same way.

Still no luck, but we think it’s related to C++ projects. On another machine, we started from a clean slate and did the following:

  1. Got latest engine source from our Perforce depot (which is currently a mirror the CL of the official release of 4.12)
  2. Used the command line above to create a rocket build of the engine.
  3. Ran UE4Editor.exe from LocalBuilds\Rocket\Windows\Engine\Binaries\Win64
  4. Selected New Project tab
  5. Selected C++ tab
  6. Basic Code, Desktop/Console, Maximum Quality, No Starter Content
  7. Hit Create Project

This gives us:

An error occurred while trying to generate project files.
Running C:/Projects/Malibu/Engines/34015/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“C:/Users/CraigDowns/Documents/Unreal Projects/MyProject/MyProject.uproject” -game -rocket -progress
Discovering modules, targets and source code for project…
UnrealBuildTool Exception: ERROR: GetBuildPlatform: No BuildPlatform found for Win64

While working on something unrelated but using Visual Studio, I’ve once seen a similar problem and traced it down to the fact that my code directory had NTFS compression on. It’s a long shot, but check whether your source directory is compressed?

Has dbuchoff’s response been of any help to you, Craig?

We finally got this to work. Before, I had removed the samples and templates (by modifying RocketBuild.automation.cs and commenting out the contents of CurrentTemplates and CurrentFeaturePacks) in order to get everything to compile.

As a test, we grabbed the FeaturePacks, QAGame, Samples, and Templates folders from the Unreal P4, added them to our local branch, undid my changes to RocketBuild.automation.cs, and ran the rocket build again. This ended up working, but of course the build took a lot longer and made the end result a bit larger.

We are still having one issue with our continuous integration build of the engine though. We have a set up running as a process on a build machine.Under normal circumstances, the process will fail when building UnrealSwarm.sln, complaining about a configuration issue with Visual Studio. We’ve run numerous tests in a small job that just calls the command to build UnrealSwarm and discovered two things

  1. If we are logged into the build machine through VPN (as opposed to having no user logged in to Windows) then the build works just fine. As soon as we log out, the build fails.

  2. If we build UnrealSwarm.sln using MSBuild, instead of devenv.com, then it builds fine regardless of whether we are logged in.

Our best plan at this point is to modify the rocket build to call MSBuild instead of devenv, build in manually, then have the build machine to use that going forward to generate future builds. It certainly isn’t ideal, but neither is having to always be logged into a build machine.

C:\JENKINS\workspace\Malibu\test>“C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Devenv.com” “C:/JENKINS/workspace/Malibu/Build_Engine_Rocket/Malibu/Dev\Engine\Source\Programs\UnrealSwarm\UnrealSwarm.sln” /build “Development”. See logfile for details: ‘Devenv-2016.08.06-22.28.20.txt’

Microsoft Visual Studio 2015 Version 14.0.25420.1.
Copyright (C) Microsoft Corp. All rights reserved.

Microsoft Visual Studio has detected a configuration issue. To correct this, please restart as Administrator. For more information please visit: http://go.microsoft.com/fwlink/?LinkId=659046
C:\JENKINS\workspace\Malibu\test>exit 1 
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE

Hello Downs,

From what I’m reading in your last 2 comments, this seems to be resolved. As a result, I’m going to your next to last comment as the answer and this as fixed. If this is incorrect, let me know and we can continue looking into this.

The original error of No Build Platform has been worked around, but we still can’t reliably build engine source due to devenv.com failing when building UnrealSwarm.

Any advice on that subject would be appreciated. Is there any risk in modifying the build to use MSBuild instead of devenv? From the logs it looks like everything built before UnrealSwarm is built using MSBuild, but I’m assuming there is a reason for the sudden switch to devenv partway through the process.

For future reference to anyone who might view this thread, attempts to replace the calls to devenv with MSBuild did not work. The configuration settings needed for UnrealSwarm.sln do not work for the uproject files in that sln, or for subsequent .sln files that need to be built.

Using the new build graph in 4.13 instead of the old rocket build fixed this issue.

I’m glad to hear that it finally worked out.

Craig, do you know where I can find the different options to pass into BuildGraph. I used the options they specified in their brief blurb about it ( I’m building for Mac ) and it was trying to build for Android as well. There was some compiler error in Android that I thought would be fixed by updating my CodeWorks. But now the build pipeline can’t find my Android SDK. Fortunately, I don’t really need Android right now, but I couldn’t figure out what options to pass in to disable Android builds

There is an option, HostPlatformOnly that should take care of this, but to be honest I had trouble with it.

I ended up editing the InstalledEngineBuild.xml directly. Near the top there are a bunch of lines that look like

<Option Name="WithAndroid" Restrict="true|false" DefaultValue="false" Description="Include the Android target platform"/>

I set the DefaultValue to false for any platforms I didn’t want to build. I believe you can do the same thing through the command line with something like -WithAndroid=false, but I haven’t tried it that way so I’m not sure of the exact syntax.