You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Nixpkgs we call Ninja with TERM=dumb ninja to get build progress on separate lines in our build logs. This generally works fine and was recommended as the solution in e.g. #2102.
However, there is one notable drawback: this propagates down to the child build processes in ways that can be undesirable. For example, we don’t get colourized output from rustc/cargo when they are run inside a Ninja build as a result of this, even though colours are much easier for us to handle than lines getting overwritten. A more impactful issue is that TERM=dumb makes Node.js skip several terminal‐related tests that otherwise pass fine for us.
I would be happy to send a pull request to add this functionality if a colour of bikeshed can be agreed on (CLI flag, NINJA_* environment variable, etc.).
The text was updated successfully, but these errors were encountered:
Can you try the equivalent of ninja | cat in your build environment? This disables smart terminal support without changing the environment, or requiring extra Ninja options. The TERM variable will be unchanged, but the downstream processes will not see a smart terminal either, which seems to be more consistent.
That would probably be an improvement, but unfortunately I think it wouldn’t be a very satisfactory solution for us. For instance, build tools like cargo and rustc will see a non‐TTY and not give colour output.
Of course, we could add manual overrides and patches for all the build tools and tests we might run inside Ninja builds, but ideally we’d just be able to get them to see the same environment they do when run under another tool like Make, and simply opt out of the fancy Ninja output that disrupts our use case. I suppose the platonic ideal solution would be to have a TERM setting that represents the ability to handle colours but not rewriting lines, but obviously it’s not very practical to get the entire world to support that.
I see, I assume your are collecting logs through a tool such as script to explicitly mark the output descriptor passed to Ninja as interactive, even though it writes to a file, to keep the colors in the resulting logs. In this case, yes, a Ninja-specific option / setting would be needed.
In Nixpkgs we call Ninja with
TERM=dumb ninja
to get build progress on separate lines in our build logs. This generally works fine and was recommended as the solution in e.g. #2102.However, there is one notable drawback: this propagates down to the child build processes in ways that can be undesirable. For example, we don’t get colourized output from
rustc
/cargo
when they are run inside a Ninja build as a result of this, even though colours are much easier for us to handle than lines getting overwritten. A more impactful issue is thatTERM=dumb
makes Node.js skip several terminal‐related tests that otherwise pass fine for us.I would be happy to send a pull request to add this functionality if a colour of bikeshed can be agreed on (CLI flag,
NINJA_*
environment variable, etc.).The text was updated successfully, but these errors were encountered: