flatpak / flatpak-builder

Tool to build flatpaks from source
GNU Lesser General Public License v2.1
141 stars 93 forks source link

`clang` (and probably everything) under flatpak-builder have no colored output #605

Open brunvonlope opened 5 months ago

brunvonlope commented 5 months ago

Checklist

flatpak-builder version

1.2.3

Flatpak version

1.14.4

How to reproduce

  1. Set export CLICOLOR_FORCE=1 (that option natively supported by 'ninja' allows the compiler to display colorful warnings)
  2. Try to build some app or module that uses ninja as build system with flatpak-builder (e.g.: GIMP)
  3. Observes lack of colors

Expected Behavior

Colorful output (which is the result if the same ninja command is run directly on Debian or MSYS2 shells)

Actual Behavior

flatpak-builder is draining the color from the software that supports it

Additional Information

No response

TingPing commented 5 months ago

Set export CLICOLOR_FORCE=1

You'd surely have to set it inside the sandbox, not outside. I'd expect it to work then. clang also has flags to explicitly set color IIRC.

All of these tools try to automatically detect color output, so we'll need to figure out how to satisfy that.

brunvonlope commented 5 months ago

@TingPing Hi, thanks for the tip. Have set on GIMP manifest:

"build-options": {
  "env": {
    "CLICOLOR_FORCE": "1"
  }
}

But the output still don't have color 🙁

TingPing commented 5 months ago

Hmm could you try explicitly passing -fcolor-diagnostics to clang?

brunvonlope commented 5 months ago

Thanks, it worked.

(I needed to use the CLICOLOR_FORCE variable and clang option combo)

TingPing commented 5 months ago

I'll reopen this because it should be possible for it to work by default.