Pre/Post Build step cuases build to fail in 4.14

My .uproject file contains some custom build steps, as described here:

I just recently upgraded the engine to 4.14 and having this build step causes this error:

2>EXEC : error : UnrealHeaderTool failed for target 'LadonEditor' (platform: Win64, module info: C:\Projects\Ladon\Intermediate\Build\Win64\LadonEditor\Development\LadonEditor.uhtmanifest, exit code: CrashOrAssert (3)).

If I remove the build step, the error goes away. Also, it doesn’t seem to matter what the build step is – even if I change it to just something like “echo hello world”, it still causes the build to fail.

Can you please post how/what you declared your custom build step in your uproject file?

Just this is enough to make it fail. Oddly enough, I do see the “hello world” printed in the output window. So I would think the error is somewhere else, but if I remove the “PreBuildSteps” block, it builds.

{
    "FileVersion": 3,
    "EngineAssociation": "4.14",
    "Category": "",
    "Description": "",
    "Modules":
    [
        {
            "Name": "Ladon",
            "Type": "Runtime",
            "LoadingPhase": "Default"
        }
    ]
    "PreBuildSteps":
    {
        "Win64":
        [
            "echo hello world"
        ]
    }
}

Is there a way to get more information from the “UnrealHeaderTool?” I tried to find this tool from the command line so I could run it directly, but couldn’t. I found what appears to be the tool’s directory:

C:\Program Files\Epic Games\UE_4.14\Engine\Intermediate\Build\Win64\UnrealHeaderTool\Development

But there is no executable there, just some LIBs.

EDIT: I found it, it’s in the “Engine\Binaries\Win64” directory. I’ll try getting it to run from the command line.

I found it.
There needs to be a comma on line 13 of my example code – between the “Modules” block and the “PreBuildSteps” block.

The JSON linked above is invalid: it is missing a , between the Modules and PreBuildSteps key declarations. Could that be it?

EDIT: I just saw that you also came to the same conclusion in the answer below

I’ll have a look into adding a more descriptive error message when the uproject JSON is invalid, instead of having CrashOrAssert which doesn’t tell you an aweful lot.

That would be really helpful. I imagine it’s pretty low priority, since most people don’t edit the .uproject file very often. Thanks though.

Hey Gheist, one more question (probably doesn’t warrant a whole new thread): Is there a way to make the build fail if these pre/post steps return an error? It seems to just continue along happily even if the ERRORLEVEL gets set to non-zero by one of the steps.

It should handle it, I’ll investigate this

Setting EXIT /B 1 when an ERRORLEVEL is encountered works.