flatpak-builder icon indicating copy to clipboard operation
flatpak-builder copied to clipboard

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

Open brunvonlope opened this issue 1 year ago • 5 comments

Checklist

  • [X] I agree to follow the Code of Conduct that this project adheres to.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

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

brunvonlope avatar Jun 18 '24 01:06 brunvonlope

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.

TingPing avatar Jun 18 '24 13:06 TingPing

@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 🙁

brunvonlope avatar Jun 18 '24 14:06 brunvonlope

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

TingPing avatar Jun 18 '24 14:06 TingPing

Thanks, it worked.

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

brunvonlope avatar Jun 18 '24 15:06 brunvonlope

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

TingPing avatar Jun 18 '24 16:06 TingPing