Skip to content

[GTK][Tools] re-location issues when running javascript-core tests #47252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clopez
Copy link
Contributor

@clopez clopez commented Jun 26, 2025

7d5ca92

[GTK][Tools] re-location issues when running javascript-core tests
https://bugs.webkit.org/show_bug.cgi?id=295044

Reviewed by NOBODY (OOPS!).

Some bots are moving away from the Flatpak SDK, which means tests
are no longer run in a common /app/webkit directory. As a result,
some bots are now building WebKit in one directory and running the
tests on another (using the build from the first one)

This has revealed issues where binaries fail to find shared libraries
because the rpath embedded on the binaries is not longer valid.

This patch updates the relevant test scripts to set the
LD_LIBRARY_PATH variable dinamically at run-time.

* Tools/Scripts/run-javascriptcore-tests:
(setupEnvironment):
* Tools/Scripts/run-jsc-stress-tests:
* Tools/Scripts/webkitdirs.pm:
(setupUnixWebKitEnvironment):

7d5ca92

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

https://bugs.webkit.org/show_bug.cgi?id=295044

Reviewed by NOBODY (OOPS!).

Some bots are moving away from the Flatpak SDK, which means tests
are no longer run in a common /app/webkit directory. As a result,
some bots are now building WebKit in one directory and running the
tests on another (using the build from the first one)

This has revealed issues where binaries fail to find shared libraries
because the rpath embedded on the binaries is not longer valid.

This patch updates the relevant test scripts to set the
LD_LIBRARY_PATH variable dinamically at run-time.

* Tools/Scripts/run-javascriptcore-tests:
(setupEnvironment):
* Tools/Scripts/run-jsc-stress-tests:
* Tools/Scripts/webkitdirs.pm:
(setupUnixWebKitEnvironment):
@clopez clopez self-assigned this Jun 26, 2025
@clopez clopez added the WebKitGTK Bugs related to the Gtk API layer. label Jun 26, 2025
@aoikonomopoulos
Copy link
Contributor

This makes sense to me. I want to argue for using patchelf instead, but I setting LD_LIBRARY_PATH is simple enough and avoids a new dependency for local test runs.

@clopez
Copy link
Contributor Author

clopez commented Jun 27, 2025

I want to argue for using patchelf instead, but I setting LD_LIBRARY_PATH is simple enough and avoids a new dependency for local test runs.

Using patchelf does not solve the problem completely.
Because the problem is not only on the bots, but also what happens if a developer renames their working directory and tries to run tests without rebuilding. So we would be having to run patchelf any time a test starts, which is not very practical.

On the other hand setting LD_LIBRARY_PATH from the test runner is easy, and is also how we deal with this issue on the layout-test runner. Also we set there dynamically another bunch of environment variables (like WEBKIT_EXEC_PATH so MiniBrowser finds the WebKitWebProcess).

@aoikonomopoulos
Copy link
Contributor

I want to argue for using patchelf instead, but I setting LD_LIBRARY_PATH is simple enough and avoids a new dependency for local test runs.

Using patchelf does not solve the problem completely. Because the problem is not only on the bots, but also what happens if a developer renames their working directory and tries to run tests without rebuilding. So we would be having to run patchelf any time a test starts, which is not very practical.

On the other hand setting LD_LIBRARY_PATH from the test runner is easy, and is also how we deal with this issue on the layout-test runner. Also we set there dynamically another bunch of environment variables (like WEBKIT_EXEC_PATH so MiniBrowser finds the WebKitWebProcess).

I actually had the developer in mind, who may want to run gdb on the binary. But I agree that running patchelf every time is not ideal either. Point taken re: other variables being needed too! I was only thinking of JSC 😅

Copy link
Contributor

@nikolaszimmermann nikolaszimmermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rs=me

sub setupEnvironment()
{
my $productDir = productDir();
if ($^O eq "linux") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aww the perl-ism 😂

@nikolaszimmermann
Copy link
Contributor

Typo: dynamically in the commit message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKitGTK Bugs related to the Gtk API layer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants