Use DOTNET_STARTUP_HOOKS and Harmony to hotpatch UBT and UAT, and add support for Kubernetes-based UBA #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently UET intercepts progress information by pretending to be XGE via OpenGE, which allows us to write better progress information to the terminal. Since Unreal Engine 5.4 though, Epic provides the Unreal Build Accelerator which is a replacement to XGE (and OpenGE). Not only do we want to be able to leverage UBA from UET (and distribute builds), but we need to plan for a future where XGE support is removed from the Unreal tooling since UBA exists and is recommended by Epic.
Because we can no longer pretend to be
xgConsole
and execute the graph ourselves, we instead need to hotpatch UBT so we can get at the internals ofActionGraph
andImmediateActionQueue
, and forward all of the data we care about back to the main UET process.DOTNET_STARTUP_HOOKS
and using Harmony 2 will work.ImmediateActionQueue
constructor to retrieve total task information.ImmediateActionQueue.SetActionState
to determine when an action's status has changed.ImmediateActionQueue.TryStartOneActionInternal
with a transpiler patch to determine when actions start and when actions error.ImmediateActionQueue.RunTillDone
so we know when the queue is complete.ImmediateActionQueue
to work so we can get progress.Redpoint.Uet.Patching.Loader
project, which will replaceRedpoint.Uet.OpenGE
.Redpoint.Uet.Patching.Loader.csproj
to bundle the output ofRedpoint.Uet.Patching.Runtime
and it's dependencies into an embedded resource.Redpoint.Uet.Patching.Loader
to extract the bundle at runtime.Redpoint.Uet.Patching.Loader
to setDOTNET_STARTUP_HOOKS
to point at the extractedRedpoint.Uet.Patching.Loader.dll
file.Redpoint.Uet.Patching.Runtime
andRedpoint.Uet.Patching.Loader
for passing job progress.Redpoint.Uet.Patching.Runtime
to pass the information collected from hotpatches back to the loader over gRPC, and then emit logging information similar toLogInterceptingDispatcher
.We should then also replace the
Redpoint.Uet.BuildPipeline
patching code with Harmony, and avoid recompiling DLLs. This should make engine builds start much faster, and allow us to turn on UEFS-unmount-after-build to ensure cleaner build environments (currently we keep engines mounted because the .NET rebuild is too slow).AutomationTool
, patch inBUILD_GRAPH_PROJECT_ROOT
support.AutomationTool
, patch inBUILD_GRAPH_ALLOW_MUTATION
support.AutomationTool
, patch script file loading so that scripts can be referenced outside the engine directory.AutomationTool
, patchbRemote
to exclude BuildGraph targets that we know won't work with it.AutomationTool
, patch outrobocopy
-based file copies since it's unreliable.EpicGames.BuildGraph
, patchSwitch
handling so that it isn't broken with unexpected fallthroughs happening (this is fixed on modern engines, but broken for 5.0).UnrealBuildTool
, patchSingleInstanceMutex
so thatuebp_UATMutexNoWait
can be used to skip it.EpicGames.Build
, patchWritableEngineDirectory
so that includes the process ID in theUnrealEngine
folder name.UnrealBuildTool
, patchUEDeployAndroid
to fix directory name handling when paths include.uet
for Gradle execution.