0
\$\begingroup\$

Problem

Errors in macro syntax causes the module's build to hang for 2+ hours (possibly, indefinitely) with no indication of a build error.

Steps to Reproduce

  1. Create a template game project in the editor.
  2. Introduce the following macro into some C++ code:
UE_LOG(LogTemp, WrongVerbosityTypeHere, TEXT("Some Text Here"));
  1. Trigger a module-only build e.g. right-click project > Build.

  2. Look for the following in the build output:

1>Using Visual Studio 2019 14.28.29335 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 4 actions with 32 processes...
  1. The message should stay the same for 2+ hours. So wait for that long or until you feel something is wrong...

  2. Remove or correct the macro usage with something like the following:

UE_LOG(LogTemp, Log, TEXT("Some Text Here"));
  1. Trigger module-only build.

  2. Build completes in seconds.

Development Environment

  • Windows 10 (Version 10.0.19042 Build 19042)
  • Visual Studio Community 2019 (Version 16.8.3)
  • Unread Editor 4.26 (Version 4.26.0-0+++UE4+Release-4.26)

Questions

  1. Is this a known bug?
  2. If not, is there a configuration in UBT via Visual Studio or in the terminal to report errors quickly?

Cross Postings

Unreal Engine Forums

\$\endgroup\$
2
  • \$\begingroup\$ Are you actually using WrongVerbosityTypeHere because, as far as I know, that's not an option in the LogTemp. They are Fatal; Error; Warning; Display; Log; Verbose; VeryVerbose. Do you get a different result if you change this option? \$\endgroup\$ – Stephen Jan 4 at 9:50
  • 1
    \$\begingroup\$ @Stephen WrongVerbosityTypeHere is a placeholder verbosity that indicates you should replace it with anything you want, that's not a part of the list you mentioned. This question is not asking, "Why did this fail?", it's asking whether UBT has a configuration/flag to fast-fail on bad macro syntax/references. Currently, builds just hang when you add erroneous macro to the code, which is very misleading. \$\endgroup\$ – hulkmeister Jan 4 at 16:26
-1
\$\begingroup\$

A C macro is literally just text substitution, about half a step up from basic search-and-replace. The UE_LOG macro is defined somewhere, providing a bit of code that the values you provide are substituted into, which then gets inserted into your code in the place of the UE_LOG invocation you wrote out.

If putting an invalid value into the macro causes the build to hang, it's probably not an error with the macro, but with the compilation. The best course of action would be to file a bug report.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.