Skip to content

Conversation

@jonahgraham
Copy link
Contributor

@jonahgraham jonahgraham commented Oct 29, 2025

With the most recent GTK4s the API version is now 6.0 for webkit/jsc and a lot of deprecated items have been
removed
.

This commit brings some of the key implementations to the new webkit API when using GTK4.

To make it easier to ensure I don't regress anything I had working, I marked all known tests that need attention for GTK4 with @Tag("gtk4-todo"). This allows running the test suite with exclude tag of gtk4-todo and have a fast and clean run.

This includes a g_critical call when webkitgtk.c cannot dynamically load a called method. When a method cannot be loaded it fairly silently fails (normally returns 0). With the g_critical it makes it easier to spot the problems.

This includes a change to the looping while waiting for a response from the async script to make timeout more accurate to the default 10s.

TODOs:

  • I plan to split this PR up into a few component parts
  • Cookies
  • Arrays of items (gtk4_convertToJava missing jsc_value_is_object case)
  • a bunch of OpenWindowListener cases (see @Tag("gtk4-todo") tests)
  • probably more
  • check which version of API we can use as a reasonable minimum, in particular do we need to deal with API version 5 (version 4 was the version of the API that aligned with GTK3)
  • Remove -DexcludedGroups=gtk4-todo from GHA workflow

Fixes #2667

@jonahgraham jonahgraham added the gtk4 GTK4 issues label Oct 29, 2025
@jonahgraham jonahgraham marked this pull request as ready for review October 29, 2025 01:40
@jonahgraham
Copy link
Contributor Author

(not really ready for review - marked as such so that it runs gtk3 tests on Jenkins and gtk4 on GHA)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

Test Results

0 files   -   115  0 suites   - 115   0s ⏱️ - 11m 41s
0 tests  - 4 613  0 ✅  - 4 597  0 💤  - 16  0 ❌ ±0 
0 runs   -   312  0 ✅  -   309  0 💤  -  3  0 ❌ ±0 

Results for commit 3794cd7. ± Comparison against base commit 88ba4be.

♻️ This comment has been updated with latest results.

@jonahgraham jonahgraham marked this pull request as draft October 29, 2025 13:06
@jonahgraham
Copy link
Contributor Author

GTK4's webkit tests don't seem to work at all on GHA, I get errors like below from this log. This is after adding apt install of libwebkitgtk-6.0-4

  • bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted
  • ** (SWT:7036): ERROR **: 13:55:54.007: readPIDFromPeer: Unexpected short read from PID socket
  • Trace/breakpoint trap (core dumped)
  • Error: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?

@jonahgraham
Copy link
Contributor Author

While I can run the Browser tests on my machine with xvfb-run, it only runs a few tests before I get Too many (XXX) leaked file descriptors = each test is leaking 30+ descriptors even though it is otherwise passing.

@jonahgraham
Copy link
Contributor Author

I have split off the ready to integrate parts into:

I am not sure what I am going to do with this PR as it has become rather messy.

With the most recent GTK4s the API version is now 6.0 for webkit/jsc
and a lot of [deprecated items have been
removed](https://webkitgtk.org/reference/webkitgtk/2.50.1/migrating-to-webkitgtk-6.0.html#stop-using-deprecated-apis).

This commit brings some of the key implementations to the new webkit
API when using GTK4.

To make it easier to ensure I don't regress anything I had working,
I marked all known tests that need attention for GTK4 with
`@Tag("gtk4-todo")`. This allows running the test suite with exclude
tag of `gtk4-todo` and have a fast and clean run.

This includes a g_critical call when webkitgtk.c cannot dynamically
load a called method. When a method cannot be loaded it fairly silently
fails (normally returns 0). With the g_critical it makes it easier to
spot the problems.

This includes a change to the looping while waiting for a response
from the async script to make timeout more accurate to the default
10s.

TODOs:

- [ ] I plan to split this PR up into a few component parts
- [ ] Cookies
- [ ] Arrays of items (gtk4_convertToJava missing jsc_value_is_object case)
- [ ] a bunch of OpenWindowListener cases (see `@Tag("gtk4-todo")` tests)
- [ ] probably more
- [ ] check which version of API we can use as a reasonable minimum, in
      particular do we need to deal with API version 5 (version 4 was
      the version of the API that aligned with GTK3)
- [ ] Remove `-DexcludedGroups=gtk4-todo` from GHA workflow

Fixes eclipse-platform#2667
WebKit for GTK4 uses bwrap and on Ubuntu 24.04 default settings are
not working so turn off apparmor. We are already running in a
protected environment, so we don't really need this extra level.
Xvfb runs seem to leak a lot, which I will look into and address, but
this is blocking other things.
@akurtakov akurtakov force-pushed the webkit-api-version-6 branch from b0143e7 to 3794cd7 Compare October 30, 2025 07:34
@akurtakov
Copy link
Member

All 4 PRs are merged. This one is already providing good results. If it has to start a new so be it.

@jonahgraham
Copy link
Contributor Author

All 4 PRs are merged.

Thank you.

This one is already providing good results. If it has to start a new so be it.

I am abandoning this PR, new work in the remaining areas are covered by this new umbrella issue #2714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gtk4 GTK4 issues

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[GTK4] Webkit crash on close

2 participants