tools/bazel prints color ANSI codes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Build
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      tools/bazel prints color ANSI codes unconditionally.
      This should only be done if the output is a color-capable terminal.
      Bazel and gtest internally detects and adapts to this.

      $ bazel run //src/mongo/dbtests:dbtest -- MockDBClientConnTest --runs=2 >out.txt 2>&1
      $ vim out.txt
      ^[[0;32mINFO:^[[0m running wrapper hook... 
      INFO: auto_header build generated: 614.4 ms ...
      

      We shouldn't be seeing this noise in text files.

      Detecting output terminal capabilities from a shell script might not be so easy.
      An easy way forward is probably to just remove the color codes from the script.

            Assignee:
            Unassigned
            Reporter:
            Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: