Bug 209850 - [Flatpak SDK] Migration to version 0.2
Summary: [Flatpak SDK] Migration to version 0.2
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-01 02:55 PDT by Philippe Normand
Modified: 2020-04-01 06:28 PDT (History)
3 users (show)

See Also:


Attachments
Patch (13.59 KB, patch)
2020-04-01 03:03 PDT, Philippe Normand
clopez: review+
clopez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2020-04-01 02:55:12 PDT
.
Comment 1 Philippe Normand 2020-04-01 03:03:26 PDT
Created attachment 395154 [details]
Patch
Comment 2 Philippe Normand 2020-04-01 03:38:46 PDT
$ webkit-flatpak --command=bash
[📦 org.webkit.Webkit WebKit]$ rr --version
rr version 5.3.0
[📦 org.webkit.Webkit WebKit]$ pkg-config --cflags --libs manette-0.2
-I/usr/include/libmanette -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lmanette-0.2 -lglib-2.0 
[📦 org.webkit.Webkit WebKit]$ pkg-config --cflags --libs openxr
-lopenxr_loader -lpthread 
[📦 org.webkit.Webkit WebKit]$
Comment 3 Carlos Alberto Lopez Perez 2020-04-01 04:07:29 PDT
Comment on attachment 395154 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=395154&action=review

> Tools/flatpak/flatpakutils.py:103
> +    @classmethod
> +    def colored_message(cls, color, str_format, *args):
> +        if args:
> +            msg = str_format % args
> +        else:
> +            msg = str_format
> +
> +        cls.message("\n%s%s%s", color, msg, Colors.ENDC)
> +
> +    @classmethod
> +    def error_message(cls, str_format, *args):
> +        cls.colored_message(Colors.FAIL, str_format, *args)
> +
> +    @classmethod
> +    def warning_message(cls, str_format, *args):
> +        cls.colored_message(Colors.WARNING, str_format, *args)

Our bots run with environment variable TERM=dumb to disable colored output, since this ANSI colors looks bad on a text log.
Can you check if the terminal supports colors and only output ANSI color characters in that case?
Here is a suggested code for that: http://sprunge.us/wSNHtz

And a test:

$ wget http://sprunge.us/wSNHtz
$ python wSNHtz
True

$ TERM=dumb python wSNHtz
False
Comment 4 Philippe Normand 2020-04-01 05:11:59 PDT
Good point Carlos, I'll add code to check the TERM env var. Thanks for the review!
Comment 5 Philippe Normand 2020-04-01 06:15:31 PDT
(In reply to Philippe Normand from comment #4)
> Good point Carlos, I'll add code to check the TERM env var. Thanks for the
> review!

I mean, the code you mentioned :)
Comment 6 Philippe Normand 2020-04-01 06:28:01 PDT
Committed r259341: <https://trac.webkit.org/changeset/259341>
Comment 7 Radar WebKit Bug Importer 2020-04-01 06:28:13 PDT
<rdar://problem/61154885>