Is running without nocompileeditor required to build plugins

I have a game module P that depends on a plugin module PlugTest.

When I run the following BuildCookRun command:

RunUAT.bat BuildCookRun -project=P -nocompile -build -cook -clientconfig=Development -clientplatform=win64 -nop4 -stage -nocompileeditor

I get the following error:

Warning: Incompatible or missing module: PlugTest

If I amend the BuildCookRun command to run without the -nocompileedtior flag, then the PlugTest dll is built, and the project compiles and cooks successfully.

My hunch is that the editor target causes all plugins to be built, but if there is no editor target, then plugins are not built. However, I cannot find any documentation to confirm this. The documentation for the plugins say:

These Plugins will automatically be compiled by UBT when compiling your game project.

I note that the plugin itself is listed in the games .uproject file:

"Plugins": [
    {
      "Name": "PlugTest",
      "Enabled": true
    }
  ]

As well as in the module dependecies:

PrivateDependencyModuleNames.AddRange(new string[] { "PlugTest" });

Is -nocompileeditor` incompatible with a clean BuildCookRun command on a project with plugins?

1 Like

Has there been any traction on understanding this issue? I’ve also run into the exact same issue with a different plugin, and would like to get to root cause without having to tear through the UBT/UAT code. Documentation for these command line options is poor and most of the online help doesn’t go into the individual commands, but usually comes in the form of tribal knowledge of command line arguments that seemed to work with no understanding of why.

I’ve just run into this same issue. If I do a package of a MyProjectGame target on a clean checkout with nocompileeditor then the plugins are missing. If I build the MyProjectEditor target then do a package with nocompileeditor it works.

I think what is happening is that BuildCookRun needs to run the MyProjectEditor target as part of the UnrealEditor-Cmd calls to cook - so the plugin error occurs when the game-specific dynamic libraries (including plugins) that are built by the MyProjectEditor target are not present during the UnrealEditor-Cmd. That build step is what is suppressed by nocompileeditor

Is -nocompileeditor` incompatible with a clean BuildCookRun command on a project with plugins?

The answer is yes, it is incompatible. BuildCookRun needs to call UnrealEditor-Cmd to cook which uses project-specific dynamic libraries that are only built by the editor target (YourProjectEditor). These dynamic libraries are not built by the other targets (YourProjectClient, YourProject, YourProjectServer). Those other targets use static libraries / monolithic builds, which is what is created and linked during the actual game build step (different from the editor build step).