cmakebuildninjacolcon

How can I make colcon output a plain CMake project's output with the ninja generator?


Ninja redirects the stderr output to stdout. When used with colcon and its colcon-cmake extension, the error log is therefore not displayed when a ninja package build is failing.

How can I see the build error messages?


Solution

  • There is no direct solution to the problem (see Colcon does not show failed build output if using Ninja generator).

    This GitHub issue mentions a workaround, though: Add --event-handlers console_cohesion+ to the colcon build call, either systematically, or only on a build failure, depending on how clean you want your build output to be. It reveals the stdout output (and thus the errors issued by ninja).