question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Build non-project-specific tools with ue4 build

See original GitHub issue

Right now, ue4 build prepends the project name to the provided target.

We have special-case code to build ShaderCompilerWorker (from #14) but no way to do such compilation in general.

In my immediate use-case, I was trying to compile UnrealFrontend.

PS > ue4 build Development UnrealFrontend
Using user-specified engine root: D:\Project
Creating makefile for ProjectUnrealFrontend (no existing makefile)
ERROR: Couldn't find target rules file for target 'ProjectUnrealFrontend' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
       Location: D:\Project\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
       Target rules found:
Traceback (most recent call last):
...
Exception: child process ['D:\\Project\\Engine\\Build\\BatchFiles\\Build.bat', 'ProjectUnrealFrontend', 'Win64', 'Development', '-project=D:\\Project\\project\\Project.uproject'] failed with exit code 5

Taking the command-line that was generated and removing the project name from the target name was sufficient to make this work, e.g.,

D:\\Project\\Engine\\Build\\BatchFiles\\Build.bat UnrealFrontend Win64 Development -project=D:\\Project\\project\\Project.uproject

That would have worked without -project too, I was just looking for the minimal patch. I’m honestly not sure if every Target in a project needs to start with (or equal) the project name, or if that’s just convention for the game-variant and editor builds.

Possible UX:

ue4 build Development -istool UnrealFrontend

I’m not sure what the right command-line option would be in this case.

Another option is -noproject (which would also exclude -project from UBT like we do for ShaderCompileWorker now) but that would block targets in the project that do not include the name of the project as a prefix, I think.

It might also be possible to get UE4BuildTool to list the possible targets, and then automatically recognise when a target needs the Project prefix added, in which case -noproject is a better option.

Edit: I was looking at TargetDescriptor.cs, and the way this tool currently takes ‘Game’, ‘Editor’, ‘Client’, ‘Server’ is actually something we could pass verbatim to -TargetType=, and then the flag for this feature request would be -explicittarget to indicate to pass the given name to -Target, i.e.

# These two build the same thing, from ProjectEditor.Target.cs, which specifies `Type = TargetType.Editor`.
# -TargetType requires a -project
PS> D:\Project\Engine\Build\BatchFiles\Build.bat -TargetType=Editor Win64 Development -project=D:\\Project\\project\\Project.uproject
PS> D:\Project\Engine\Build\BatchFiles\Build.bat -Target=ProjectEditor Win64 Development -project=D:\\Project\\project\\Project.uproject
# This builds shadercompileworker. -project is unnecessary for this particular instance, but you can't tell that without parsing the rules assembly for NativeTargets.
PS> D:\Project\Engine\Build\BatchFiles\Build.bat -Target=ShaderCompileWorker Win64 Development -project=D:\\Project\\project\\Project.uproject

-Target and -TargetType were introduced in UE4.20 though, replacing the existing code which generally concatenated the project name and the target name. So they might not be feasible for ue4cli, depending on how far back it needs to support UE4.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
adamrehncommented, Jan 29, 2021

Well, that’s just plain flying in the face of established conventions. I wonder if that project breaks any of the Unreal Engine’s own tooling with that naming scheme. Is UAT even able to package that project correctly if the -noclient -server flags are specified?

2reactions
TBBlecommented, Jan 13, 2021

So I’ve just hit another corner-case related to this request. The UE Shooter Game example includes the following:

  • ShooterGame.uproject
  • Source/ShooterClient.Target.cs
  • Source/ShooterGame.Target.cs
  • Source/ShooterGameEditor.Target.cs
  • Source/ShooterServer.Target.cs

Using ue4 build, only “Editor” works, as the others are trying to prepend ShooterGame, but the files are just Shooter. >_< Unlike the original request, these would need the -Project flag.

ue4 build-target ShooterServer Development -project=C:\Path\To\ShooterGame.uproject

works, as you’d expect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Configuration - Unreal Engine Documentation
Configure how the engine is built. ... The DMUCS distinguishing property value to request for compile hosts. bXGENoWatchdogThread.
Read more >
Building Worlds with Landmass | Unreal Engine - YouTube
The Landmass plugin is a new, Blueprint-driven way to procedurally and non-destructively edit a landscape in Unreal Engine. This feature ...
Read more >
Unreal Engine Performance Guide - GPUOpen
More details will be given on stat GPU and ProfileGPU in the Built-In Profiling Tools section. Test builds of a stand-alone executable require...
Read more >
Oculus Developer Hub Feature Request: MacOS Oculus...
Hello all, As I have been developing for the Oculus Quest on MacOS with Unreal Engine, I have been unable to access the...
Read more >
What Is Unreal Engine 5 - Perforce Software
Animations. Innovation requires iteration. Unreal Engine 5 expands their animation toolset with tools like Control Ride. Now you can create and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found