Skip to content

[WPE][GTK] Ensure that jhbuild or flatpak is only used if set explicitly via WEBKIT_JHBUILD=1 or WEBKIT_FLATPAK=1#60862

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
clopez:bug-310187
Mar 19, 2026
Merged

[WPE][GTK] Ensure that jhbuild or flatpak is only used if set explicitly via WEBKIT_JHBUILD=1 or WEBKIT_FLATPAK=1#60862
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
clopez:bug-310187

Conversation

@clopez
Copy link
Contributor

@clopez clopez commented Mar 18, 2026

23deb26

[WPE][GTK] Ensure that jhbuild or flatpak is only used if set explicitly via WEBKIT_JHBUILD=1 or WEBKIT_FLATPAK=1
https://bugs.webkit.org/show_bug.cgi?id=310187

Reviewed by Philippe Normand.

The current status of some scripts like the ones for updating the third-party libs,
were to default to using flatpak unless this was executed inside wkdev-sdk.

That is wrong, it will confuse new users.

This patch changes the logic so the tools behave like this:

 - if WEBKIT_JHBUILD=1 in environment then try to use jhbuild
 - if WEBKIT_FLATPAK=1 in environment then try to use flatpak
 - if WEBKIT_CONTAINER_SDK is not in the environment, then print a warning
   telling to download and use wkdev-sdk.

Using jhbuild or flatpak is something opt-in for advanced use cases, is not
something that should be used by default.

The checks on the environment variable WEBKIT_BUILD_USE_SYSTEM_LIBRARIES are
also removed, because wkdev-sdk now defines WEBKIT_CONTAINER_SDK=1 which is
more appropiate.

I intend to send another patch to wkdev-sdk to stop setting in the environment
WEBKIT_BUILD_USE_SYSTEM_LIBRARIES=1 after this lands.

* Tools/Scripts/clean-webkit:
(removeDerivedSources):
(getKeepDirs):
(main):
(usesFlatpak): Deleted.
* Tools/Scripts/run-gtk-tests:
* Tools/Scripts/run-wpe-tests:
* Tools/Scripts/update-webkitgtk-libs:
* Tools/Scripts/update-webkitwpe-libs:
* Tools/Scripts/webkitdirs.pm:
(maybeUseContainerSDKRootDir):
(wrapperPrefixIfNeeded):
(shouldUseFlatpak):
(shouldRemoveCMakeCache):
(updateGtkOrWpeLibs):
* Tools/Scripts/webkitpy/port/base.py:
(Port._should_use_jhbuild):
* Tools/Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_jhbuild_wrapper):
* Tools/Scripts/webkitpy/port/linux_container_sdk_utils.py:
(maybe_use_container_sdk_root_dir):
* Tools/Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.test_diff_image):
* Tools/Scripts/webkitpy/w3c/wpt_runner.py:
(main):
* Tools/flatpak/flatpakutils.py:
(should_use_flatpak):
(run_in_sandbox_if_available):
* Tools/glib/api_test_runner.py:
(check_environment):
* Tools/jhbuild/jhbuildutils.py:
(should_use_jhbuild):
(enter_jhbuild_environment_if_available):

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

ec09add

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
✅ 🧪 webkitpy ✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-debug-arm64 ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 jsc-armv7
✅ 🛠 tv ✅ 🧪 jsc-armv7-tests
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@clopez clopez requested review from a team, JonWBedard and gsnedders as code owners March 18, 2026 16:10
@clopez clopez self-assigned this Mar 18, 2026
@clopez clopez added the WPE WebKit WebKit WPE component label Mar 18, 2026
@clopez clopez requested a review from philn March 18, 2026 16:15
return 0;
}

if ((defined $ENV{'WEBKIT_JHBUILD'} && $ENV{'WEBKIT_JHBUILD'}) or (defined $ENV{'WEBKIT_BUILD_USE_SYSTEM_LIBRARIES'} && $ENV{'WEBKIT_BUILD_USE_SYSTEM_LIBRARIES'})) {
Copy link
Member

Choose a reason for hiding this comment

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

We don't use WEBKIT_BUILD_USE_SYSTEM_LIBRARIES anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, now WEBKIT_CONTAINER_SDK=1 is used to detect that we are inside wkdev-sdk. I think is a more appropriate env var name.
I intend to send another patch to wkdev-sdk to stop setting WEBKIT_BUILD_USE_SYSTEM_LIBRARIES=1 after this lands.

If anyone wants to build against system libraries without using wkdev-sdk then that would still be the default behavior when running build-webkit, no need to export anything, but they would get warnings when running api-tests about not using the right environment for testing.

@clopez clopez added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Mar 19, 2026
…tly via WEBKIT_JHBUILD=1 or WEBKIT_FLATPAK=1

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

Reviewed by Philippe Normand.

The current status of some scripts like the ones for updating the third-party libs,
were to default to using flatpak unless this was executed inside wkdev-sdk.

That is wrong, it will confuse new users.

This patch changes the logic so the tools behave like this:

 - if WEBKIT_JHBUILD=1 in environment then try to use jhbuild
 - if WEBKIT_FLATPAK=1 in environment then try to use flatpak
 - if WEBKIT_CONTAINER_SDK is not in the environment, then print a warning
   telling to download and use wkdev-sdk.

Using jhbuild or flatpak is something opt-in for advanced use cases, is not
something that should be used by default.

The checks on the environment variable WEBKIT_BUILD_USE_SYSTEM_LIBRARIES are
also removed, because wkdev-sdk now defines WEBKIT_CONTAINER_SDK=1 which is
more appropiate.

I intend to send another patch to wkdev-sdk to stop setting in the environment
WEBKIT_BUILD_USE_SYSTEM_LIBRARIES=1 after this lands.

* Tools/Scripts/clean-webkit:
(removeDerivedSources):
(getKeepDirs):
(main):
(usesFlatpak): Deleted.
* Tools/Scripts/run-gtk-tests:
* Tools/Scripts/run-wpe-tests:
* Tools/Scripts/update-webkitgtk-libs:
* Tools/Scripts/update-webkitwpe-libs:
* Tools/Scripts/webkitdirs.pm:
(maybeUseContainerSDKRootDir):
(wrapperPrefixIfNeeded):
(shouldUseFlatpak):
(shouldRemoveCMakeCache):
(updateGtkOrWpeLibs):
* Tools/Scripts/webkitpy/port/base.py:
(Port._should_use_jhbuild):
* Tools/Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_jhbuild_wrapper):
* Tools/Scripts/webkitpy/port/linux_container_sdk_utils.py:
(maybe_use_container_sdk_root_dir):
* Tools/Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.test_diff_image):
* Tools/Scripts/webkitpy/w3c/wpt_runner.py:
(main):
* Tools/flatpak/flatpakutils.py:
(should_use_flatpak):
(run_in_sandbox_if_available):
* Tools/glib/api_test_runner.py:
(check_environment):
* Tools/jhbuild/jhbuildutils.py:
(should_use_jhbuild):
(enter_jhbuild_environment_if_available):

Canonical link: https://commits.webkit.org/309557@main
@webkit-commit-queue
Copy link
Collaborator

Committed 309557@main (23deb26): https://commits.webkit.org/309557@main

Reviewed commits have been landed. Closing PR #60862 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 23deb26 into WebKit:main Mar 19, 2026
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Mar 19, 2026
@clopez clopez added GLib Suggested Backport - 2.50 Suggest this merge request be backported to webkitglib/2.50 branch GLib Suggested Backport - 2.52 Suggest this merge request be backported to the webkitglib/2.52 stable branch labels Mar 20, 2026
@clopez clopez deleted the bug-310187 branch March 20, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GLib Suggested Backport - 2.50 Suggest this merge request be backported to webkitglib/2.50 branch GLib Suggested Backport - 2.52 Suggest this merge request be backported to the webkitglib/2.52 stable branch WPE WebKit WebKit WPE component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants