Title: [263397] trunk/Tools
Revision
263397
Author
ab...@igalia.com
Date
2020-06-23 08:48:20 -0700 (Tue, 23 Jun 2020)

Log Message

[flatpak] Ensure en_US.UTF-8 locale
https://bugs.webkit.org/show_bug.cgi?id=212459

Reviewed by Philippe Normand.

When developing WebKit we want as few system differences as possible
to make tests reproducible.

en_US.UTF-8 is indeed the only locale installed in our development
flatpak, but our scripts were not correctly clearing most locale
environment variables, which resulted in warnings when running some
tools (notably perl) when the user OS has a different locale.

This patch ensures all locale environment variables are cleared and
LANG is set to en_US.UTF-8. It also removes now redundant code from
flatpakutils.py.

* flatpak/flatpakutils.py:
(WebkitFlatpak.run_in_sandbox):
* flatpak/webkit-bwrap:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (263396 => 263397)


--- trunk/Tools/ChangeLog	2020-06-23 15:14:11 UTC (rev 263396)
+++ trunk/Tools/ChangeLog	2020-06-23 15:48:20 UTC (rev 263397)
@@ -1,3 +1,26 @@
+2020-06-23  Alicia Boya GarcĂ­a  <ab...@igalia.com>
+
+        [flatpak] Ensure en_US.UTF-8 locale
+        https://bugs.webkit.org/show_bug.cgi?id=212459
+
+        Reviewed by Philippe Normand.
+
+        When developing WebKit we want as few system differences as possible
+        to make tests reproducible.
+
+        en_US.UTF-8 is indeed the only locale installed in our development
+        flatpak, but our scripts were not correctly clearing most locale
+        environment variables, which resulted in warnings when running some
+        tools (notably perl) when the user OS has a different locale.
+
+        This patch ensures all locale environment variables are cleared and
+        LANG is set to en_US.UTF-8. It also removes now redundant code from
+        flatpakutils.py.
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.run_in_sandbox):
+        * flatpak/webkit-bwrap:
+
 2020-06-23  Simon Fraser  <simon.fra...@apple.com>
 
         [ Catalina Debug WK2 ] fast/events/platform-wheelevent-in-scrolling-div.html is a flaky failure

Modified: trunk/Tools/flatpak/flatpakutils.py (263396 => 263397)


--- trunk/Tools/flatpak/flatpakutils.py	2020-06-23 15:14:11 UTC (rev 263396)
+++ trunk/Tools/flatpak/flatpakutils.py	2020-06-23 15:48:20 UTC (rev 263397)
@@ -711,7 +711,6 @@
 
             sandbox_environment.update({
                 "TZ": "PST8PDT",
-                "LANG": "en_US.UTF-8",
             })
 
         env_var_prefixes_to_keep = [
@@ -743,7 +742,6 @@
             "CXXFLAGS",
             "DISPLAY",
             "_javascript_CoreUseJIT",
-            "LANG",
             "LDFLAGS",
             "MAX_CPU_LOAD",
             "Malloc",

Modified: trunk/Tools/flatpak/webkit-bwrap (263396 => 263397)


--- trunk/Tools/flatpak/webkit-bwrap	2020-06-23 15:14:11 UTC (rev 263396)
+++ trunk/Tools/flatpak/webkit-bwrap	2020-06-23 15:48:20 UTC (rev 263397)
@@ -58,6 +58,11 @@
     for dst, src in try_bind_mounts.items():
         bwrap_args.extend(["--bind-try", src, dst])
 
+    for env in os.environ.keys():
+        if env.startswith("LC_") or env == "LANGUAGE":
+            bwrap_args.extend(["--unsetenv", env])
+    bwrap_args.extend(["--setenv", "LANG", "en_US.UTF-8"])
+
     command_line = ' '.join(shlex.quote(a) for a in bwrap_args + args)
     # os.system return code behaves like os.wait. A 16 bit number with the
     # signal in the lower byte and, if the signal is zero, the exit code in
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to