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.

Build ShaderCompilerWorker when building Editor target in `ue4 build`

See original GitHub issue

On Windows, I was trying to work out why my Editor was hanging at 39% when launching a project using a clean git checkout and a successful ue4 build Development Editor.

I noticed the following in the logs right before it hung:

'XGEControlWorker.exe' is not recognized as an internal or external command, operable program or batch file.

This was UE4 trying to use Incredibuild to compiler Shaders during startup.

It turns out XGEControlWorker.exe is a post-build copy of ShaderCompileWorker.exe. Poking around, I discovered that on OS X and Linux, the setup instructions/scripts build ShaderCompileWorker explicitly before building UE4Editor.

On Linux, it also suggests building CrashReportClient, UnrealLightmass, and UnrealPak.

On OS X, Build.sh and XcodeBuild.sh take a parameter -buildscw in ($4 or $5) to build ShaderCompilerWorker before passing the command line over to UnrealBuildTool.exe.

On Windows, the VC Project Files generate Build.bat calls and add ShaderCompilerWorker as an extra target when building the Editor, based on a default-true config option bEditorDependsOnShaderCompileWorker.

You can see where it adds ShaderCompilerWorker it also adds LiveCodingConsole if enabled (defaults to true in Win64 non-Shipping non-Programs).

To fix the editor, I had to manually compile ShaderCompilerWorker.exe:

D:\Unreal\UnrealEngine\Engine\Build\BatchFiles\Build.bat ShaderCompileWorker Win64 Development

and everything worked fine after that.

In the end, what I’m hoping for is some piece of magic in ue4 build when it’s given or defaults to an Editor target which will also build the appropriate extra targets for the platform.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
adamrehncommented, Mar 12, 2020

(Just FYI, I’ve added the requested functionality to ue4 build in commit 259d03c, but I’m still genuinely curious to know how often this situation arises, since it invalidates my existing assumptions around how developers typically use source builds of the Unreal Engine.)

0reactions
adamrehncommented, Mar 13, 2020

Fair enough, thanks for the insight into the use cases where this is handy. The change is now live in ue4cli version 0.0.42.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: non-portable path to file when building Unreal Editor for ...
When building the Unreal Editor for Linux on Windows the ShaderCompilerWorker as well as other modules fail to compile: 1>------ Build ...
Read more >
Precompiled Build Process - Gamedev Guide - ikrima.dev
Create InstalledBuild.txt and place in UnrealEngine\Engine\Build ... Uncheck ShaderCompilerWorker dependency from BBR ...
Read more >
ue4 build-target - Adam Rehn Docs
ue4 build -target <TARGET> [CONFIGURATION] [EXTRA UBT ARGS] ... for building Engine tools and programs when working with a source build of the...
Read more >
Seven Tricks to Speed Up Shader Compilation in Unreal ...
#4) Add more Shader Compile Workers. When Unreal Engine is running through the motions of compiling your shaders, the editor itself isn't actually...
Read more >
Build.cs & Target.cs - Unreal Engine Community Wiki
using UnrealBuildTool;. UnrealBuildTool is a custom tool that manages the process of building Unreal Engine source code across a variety of ...
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