Title: [262782] trunk/Tools
Revision
262782
Author
[email protected]
Date
2020-06-09 01:33:56 -0700 (Tue, 09 Jun 2020)

Log Message

[Flatpak][GStreamer] enhance GST_ environment variable passing
https://bugs.webkit.org/show_bug.cgi?id=212905

Patch by Víctor Manuel Jáquez Leal <[email protected]> on 2020-06-09
Reviewed by Philippe Normand.

Handle the passing of several GST environment variables,
particularly GST_DEBUG, which, when using * symbol, python adds
quotes, but they break the parsing in GStreamer.

Also the variables are handled by gst-env.py when using
GST_BUILD_PATH, so they are filtered out when it's exported,
avoiding duplication. But it GST_BUILD_PATH is not defined, the
variables are passed to flatpak.

* flatpak/flatpakutils.py:
(WebkitFlatpak.setup_gstbuild):
(WebkitFlatpak.run_in_sandbox):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (262781 => 262782)


--- trunk/Tools/ChangeLog	2020-06-09 08:23:28 UTC (rev 262781)
+++ trunk/Tools/ChangeLog	2020-06-09 08:33:56 UTC (rev 262782)
@@ -1,3 +1,23 @@
+2020-06-09  Víctor Manuel Jáquez Leal  <[email protected]>
+
+        [Flatpak][GStreamer] enhance GST_ environment variable passing
+        https://bugs.webkit.org/show_bug.cgi?id=212905
+
+        Reviewed by Philippe Normand.
+
+        Handle the passing of several GST environment variables,
+        particularly GST_DEBUG, which, when using * symbol, python adds
+        quotes, but they break the parsing in GStreamer.
+
+        Also the variables are handled by gst-env.py when using
+        GST_BUILD_PATH, so they are filtered out when it's exported,
+        avoiding duplication. But it GST_BUILD_PATH is not defined, the
+        variables are passed to flatpak.
+
+        * flatpak/flatpakutils.py:
+        (WebkitFlatpak.setup_gstbuild):
+        (WebkitFlatpak.run_in_sandbox):
+
 2020-06-09  Sihui Liu  <[email protected]>
 
         TextManipulationController range of paragraph may be wrong after r262601

Modified: trunk/Tools/flatpak/flatpakutils.py (262781 => 262782)


--- trunk/Tools/flatpak/flatpakutils.py	2020-06-09 08:23:28 UTC (rev 262781)
+++ trunk/Tools/flatpak/flatpakutils.py	2020-06-09 08:33:56 UTC (rev 262782)
@@ -594,6 +594,7 @@
         command = [os.path.join(gst_dir, 'gst-env.py'), '--builddir', gst_builddir, '--srcdir', gst_dir, "--only-environment"]
         gst_env = run_sanitized(command, gather_output=True)
         whitelist = ("LD_LIBRARY_PATH", "PATH", "PKG_CONFIG_PATH")
+        nopathlist = ("GST_DEBUG", "GST_VERSION", "GST_ENV")
         env = []
         for line in [line for line in gst_env.splitlines() if not line.startswith("export")]:
             tokens = line.split("=")
@@ -600,7 +601,10 @@
             var_name, contents = tokens[0], "=".join(tokens[1:])
             if not var_name.startswith("GST_") and var_name not in whitelist:
                 continue
-            new_contents = ':'.join([self.host_path_to_sandbox_path(p) for p in contents.split(":")])
+            if var_name not in nopathlist:
+                new_contents = ':'.join([self.host_path_to_sandbox_path(p) for p in contents.split(":")])
+            else:
+                new_contents = contents.replace("'", "")
             env.append("--env=%s=%s" % (var_name, new_contents))
         return env
 
@@ -700,7 +704,6 @@
             "G",
             "CCACHE",
             "GIGACAGE",
-            "GST",
             "GTK",
             "ICECC",
             "JSC",
@@ -745,7 +748,7 @@
         env_vars.update(extra_env_vars)
         for envvar, value in env_vars.items():
             var_tokens = envvar.split("_")
-            if var_tokens[0] in env_var_prefixes_to_keep or envvar in env_vars_to_keep or envvar_in_suffixes_to_keep(envvar):
+            if var_tokens[0] in env_var_prefixes_to_keep or envvar in env_vars_to_keep or envvar_in_suffixes_to_keep(envvar) or (not os.environ.get('GST_BUILD_PATH') and var_tokens[0] == "GST"):
                 sandbox_environment[envvar] = value
 
         share_network_option = "--share=network"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to