Skip to content

Commit

Permalink
[webkitpy] Detection of GTK4 is broken
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=261503

Reviewed by Adrian Perez de Castro.

The name of the current binary for the gtk4 library is different,
update the method to actually find all library binaries.

 * Tools/Scripts/webkitpy/port/gtk.py:
 (GtkPort._is_gtk4_build):
 * Tools/Scripts/webkitpy/port/gtk_unittest.py:
 (GtkPortTest.test_gtk4_expectations_binary_only):
 (GtkPortTest.test_gtk_expectations_both_binaries):

Canonical link: https://commits.webkit.org/267946@main
  • Loading branch information
csaavedra committed Sep 13, 2023
1 parent bd0e961 commit bc011e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Tools/Scripts/webkitpy/port/gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ def run_minibrowser(self, args):
def _is_gtk4_build(self):
try:
libdir = self._build_path('lib')
candidates = self._filesystem.glob(os.path.join(libdir, 'libwebkit2gtk-*.so'))
candidates = self._filesystem.glob(os.path.join(libdir, 'libwebkit*gtk-*.so'))
if not candidates:
return False
if len(candidates) > 1:
_log.warning("Multiple WebKit2GTK libraries found. Skipping GTK4 detection.")
return False
return os.path.basename(candidates[0]) == 'libwebkit2gtk-5.0.so'
return os.path.basename(candidates[0]) == 'libwebkitgtk-6.0.so'

except (webkitpy.common.system.executive.ScriptError, IOError, OSError):
return False
Expand Down
4 changes: 2 additions & 2 deletions Tools/Scripts/webkitpy/port/gtk_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_default_upload_configuration(self):
def test_gtk4_expectations_binary_only(self):
port = self.make_port()
port._filesystem = MockFileSystem({
"/mock-build/lib/libwebkit2gtk-5.0.so": ""
"/mock-build/lib/libwebkitgtk-6.0.so": ""
})
with OutputCapture() as _:
self.assertEqual(port.expectations_files(),
Expand All @@ -129,7 +129,7 @@ def test_gtk_expectations_both_binaries(self):
port = self.make_port()
port._filesystem = MockFileSystem({
"/mock-build/lib/libwebkit2gtk-4.0.so": "",
"/mock-build/lib/libwebkit2gtk-5.0.so": ""
"/mock-build/lib/libwebkitgtk-6.0.so": ""
})

with OutputCapture() as captured:
Expand Down

0 comments on commit bc011e5

Please sign in to comment.