Build ShaderCompilerWorker when building Editor target in `ue4 build`
See original GitHub issueOn 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:
 - Created 4 years ago
 - Comments:6 (6 by maintainers)
 

Top Related StackOverflow Question
(Just FYI, I’ve added the requested functionality to
ue4 buildin 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.)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.