Console output broken in version 3.3.x under native ninja
Bresalier, Rob (Nokia - US/Murray Hill)
Wed Nov 10 15:40:37 GMT 2021
This worked fine with Cygwin 3.2.0 but is broken starting with Cygwin 3.3.0, hence I think it is a Cygwin bug and not a ninja bug.
When running Cygwin applications under Windows native 'ninja.exe' build tool (not the Cygwin packaged one) then the stdout is not emitted to the console starting with Cygwin 3.3.0. It worked fine with Cygwin 3.2.0 and stdout is emitted to the console. If using Cygwin ninja with 3.3.0 it also works. The problem is with Windows native ninja and Cygwin programs with Cygwin version 3.3.0 and later.
Using Cygwin ninja is not an option for us as a solution. We need to use the Windows native ninja for reasons that I won't go into here.
To reproduce the issue:
1) Download windows native ninja from here: https://github.com/ninja-build/ninja/releases
a. Use ninja-win.zip that has the ninja.exe executable
b. DO NOT USE the Cygwin version of ninja
2) Below is a sample build.ninja file that demonstrates the problem. This sample build.ninja simply causes bash -help to run. Create this build.ninja text file in some directory.
3) cd to the directory where you have the build.ninja, and then run the native ninja.exe, you won't see the bash --help output with Cygwin 3.3.0 and later.
a. I suggesting using -v option with ninja.exe: "path/to/native/ninja.exe -v"
4) If you try it with Cygwin 3.2.0 it works fine you will see the bash --help output.
5) If you run c:/cygwin64/bin/bash --help outside of ninja it works fine.
6) This happens if you run the native ninja.exe from either a command window or from the Cygwin/minty/bash
Here is the sample build.ninja to be used to reproduce the problem:
--------start build.ninja --------------
command = $COMMAND
description = $DESC
build MC5U_BMDCO6_versions.txt: CUSTOM_COMMAND
COMMAND = c:/cygwin64/bin/bash --help
DESC = Running bash --help
restat = 1
--------end build.ninja --------------
Thanks for having a look.
More information about the Cygwin