[webkit-changes] [WebKit/WebKit] 79f5df: [GTK][WPE] Fix relocation issues running the MiniB...

Carlos Alberto Lopez Perez noreply at github.com
Thu Nov 17 10:13:10 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 79f5dfafe126501c435ea8a87fe4dc725b62e1df
      https://github.com/WebKit/WebKit/commit/79f5dfafe126501c435ea8a87fe4dc725b62e1df
  Author: Carlos Alberto Lopez Perez <clopez at igalia.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M Tools/Scripts/webkitpy/port/glib.py
    M Tools/Scripts/webkitpy/port/gtk.py
    M Tools/Scripts/webkitpy/port/gtk_unittest.py
    M Tools/Scripts/webkitpy/port/wpe.py
    M Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp
    M Tools/WebKitTestRunner/InjectedBundle/wpe/ActivateFontsWPE.cpp

  Log Message:
  -----------
  [GTK][WPE] Fix relocation issues running the MiniBrowser or the layout tests when the path on disk changes
https://bugs.webkit.org/show_bug.cgi?id=247985

Reviewed by Žan Doberšek.

When WebKit is built the path of the repository (where you have the checkout)
is stored in the binaries in different ways:

 - The path to the WebKit libraries is stored as an rpath on the ELF binaries
 - The CMake system also defines some constant strings to the build like WEBKIT_EXEC_PATH
   and WEBKIT_INJECTED_BUNDLE_PATH that end going into the binaries as default values.

This default values can be overriden at run-time via environment variables,
but the current tooling was not doing that.

This means that if you build WebKit in a directory and then move the directory
to a different path (without rebuilding) you are going to find errors and crashes.

This is not an issue with the flatpak build, because the flatpak build maps the
buildirectory to /app so the path doesn't really change even if you move the dir.

But this is an issue for builds not using flatpak.
Specifically I found this on a bot that I'm working on, where the builder builds
on a different path than the tester (and the tester downloads the build product).

Fix the problem by passing at runtime the required paths via environment variables.

* Tools/Scripts/webkitpy/port/glib.py:
(GLibPort._prepend_to_env_value):
(GLibPort.setup_environ_for_server):
(GLibPort.setup_environ_for_minibrowser):
* Tools/Scripts/webkitpy/port/gtk.py:
(GtkPort.run_minibrowser):
* Tools/Scripts/webkitpy/port/wpe.py:
(WPEPort.setup_environ_for_minibrowser):
(WPEPort.run_minibrowser):
(WPEPort.browser_env): Deleted.
* Tools/WebKitTestRunner/InjectedBundle/gtk/ActivateFontsGtk.cpp:
(WTR::initializeFontConfigSetting):
* Tools/WebKitTestRunner/InjectedBundle/wpe/ActivateFontsWPE.cpp:
(WTR::activateFonts):
* Tools/Scripts/webkitpy/port/gtk_unittest.py

Canonical link: https://commits.webkit.org/256795@main




More information about the webkit-changes mailing list