Bug 260496 - [Tools][GTK][WPE] generate-bundle: include the graphics libraries also on the sysdeps bundle with install script
Summary: [Tools][GTK][WPE] generate-bundle: include the graphics libraries also on the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Diego Pino
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-08-21 16:53 PDT by Carlos Alberto Lopez Perez
Modified: 2023-08-29 08:15 PDT (History)
3 users (show)

See Also:


Attachments
debian 11 vs 12 (88.20 KB, image/png)
2023-08-25 13:55 PDT, Max Schmitt
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2023-08-21 16:53:25 PDT
generate-bundle script supports generating two types of bundles

 1) one that bundles everything (syslibs=all)
 2) one that includes a install script and only bundles strictly what is needed (syslibs=install-script)

The first one can run in theory on any distro and the second one only can run on the very specific distro where the bundle was created (for example: Ubuntu-20.04)

On the first type of bundle we are including all graphics libraries but on the second one we are missing to list the packages providing this libraries.
We simply list a specific graphic library if that library links with WebKit, but otherwise we don't add extra graphics libraries

That was working fine so far, but since 265017@main the GTK MiniBrowser depends on libepoxy and libepoxy uses dlopen() to open one OpenGL library or other.
Also the Ubuntu package of libepoxy doesn't depend on anything.

So the GTK MiniBrowser now has an indirect dependency on LibGLESv2 caused by libepoxy but this dependency can't be obtained by examining the libraries linked.

This caused that the WPT tests started to fail on the WPT CI with errors like:

 2:23.51 pid:1875 Full command: /home/test/web-platform-tests/_venv3/browsers/nightly/webkitgtk_minibrowser/WebKitWebDriver --port=44323 --host=127.0.0.1
pid:1875 Couldn't open libGLESv2.so.2: libGLESv2.so.2: cannot open shared object file: No such file or directory

https://community-tc.services.mozilla.com/tasks/a-PzAVJoS9CEJglQjA5Yjw/runs/0


To fix this I propose that we list the same graphics libraries that we use for bundle type 1) on bundle type 2) so we ensure those are installed via apt-get

Related: https://github.com/web-platform-tests/wpt/issues/40901
Comment 1 Carlos Alberto Lopez Perez 2023-08-21 17:09:21 PDT
Pull request: https://github.com/WebKit/WebKit/pull/16908
Comment 2 EWS 2023-08-23 08:00:44 PDT
Committed 267186@main (2e99fa3f861b): <https://commits.webkit.org/267186@main>

Reviewed commits have been landed. Closing PR #16908 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-08-23 08:01:14 PDT
<rdar://problem/114324129>
Comment 4 Max Schmitt 2023-08-25 13:55:04 PDT
Created attachment 467440 [details]
debian 11 vs 12

looks like https://github.com/WebKit/WebKit/commit/2e99fa3f861b9ab48569aa970498ab63b5db8ba9 broke Debian 12 builds.
We are now executing "self._get_mesa_dri_drivers()" in != self._syslibs == "bundle-all" mode. This internally will do "pkg-config --variable=libdir dri" which on Debian 12 returns nothing, since mesa-common-dev has no libdir in the dri.pc anymore. See the pic.

We then get this on our build bots:

Traceback (most recent call last):
  File "/home/pwuser/webkit/Tools/Scripts/generate-bundle", line 916, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pwuser/webkit/Tools/Scripts/generate-bundle", line 911, in main
    bundle_file_path = bundle_creator.create()
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pwuser/webkit/Tools/Scripts/generate-bundle", line 337, in create
    self._create_bundle(bundle_binary)
  File "/home/pwuser/webkit/Tools/Scripts/generate-bundle", line 686, in _create_bundle
    objects_to_copy.extend(self._get_mesa_libraries())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pwuser/webkit/Tools/Scripts/generate-bundle", line 487, in _get_mesa_libraries
    lib_dir_dri = self._get_pkg_config_var('dri', 'libdir')
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pwuser/webkit/Tools/Scripts/generate-bundle", line 415, in _get_pkg_config_var
    raise RuntimeError('The pkg-config entry for %s is not a directory: %s' % (var_name, var_value))
RuntimeError: The pkg-config entry for libdir is not a directory:
Comment 5 Carlos Alberto Lopez Perez 2023-08-25 14:02:35 PDT
Please try install the package mesa-common-dev via 'apt-get install'
Comment 6 Carlos Alberto Lopez Perez 2023-08-25 14:06:58 PDT
(In reply to Carlos Alberto Lopez Perez from comment #5)
> Please try install the package mesa-common-dev via 'apt-get install'

Ups sorry, forget that comment.

I see you already have it installed but is defining the libdir variable

I see the issue, thanks for reporting it.
Comment 7 Diego Pino 2023-08-28 01:50:25 PDT
Re-opening for pull request https://github.com/webkit/webkit/pull/17116
Comment 8 EWS 2023-08-29 08:15:23 PDT
Committed 267404@main (8124fd9a748e): <https://commits.webkit.org/267404@main>

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