Skip to content
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

Load libEGL.so.1 and fallback to unversioned soname #277

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

mukilan
Copy link
Member

@mukilan mukilan commented Feb 26, 2024

After the GStreamer update in Servo, the nightly binaries have been failing to launch on linux distros unless libegl1-mesa-dev or the equivalent package is installed in the runtime environment.

The binaries were loading before the GStreamer update was because the binary had a compile-time link to libEGL.so.1 due to gstreamer-sys crate. Because of this compile-time link, the dlsym calls are able to succesfully load the functions pointers even though the previous dlopen('libEGL.so') call returned a NULL handle indicating failure.

This patch makes surfman load libEGL.so.1 first and fallback to libEGL.so. If neither are available, then the initialization panics, unlike the previous behavior where we silently succeed if the binary has a link to the libEGL shared object with the symbols for functions that are used at the runtime.

Fixes #276.

After the GStreamer update in Servo, the nightly binaries
have been failing to launch on linux distros unless
`libegl1-mesa-dev` or the equivalent package is installed
in the runtime environment.

The binaries were loading before the GStreamer update was
because the binary had a compile-time link to libEGL.so.1
due to gstreamer-sys crate. Because of this compile-time
link, the dlsym calls are able to succesfully load the
functions pointers even though the previous dlopen('libEGL.so')
call returned a NULL handle indicating failure.

This patch makes surfman load `libEGL.so.1` first and
fallback to `libEGL.so`. If neither are available, then
the initialization panics, unlike the previous behavior
where we silently succeed if the binary has a link to
the libEGL shared object with the symbols for functions
that are used at the runtime.

Fixes #276.

Signed-off-by: Mukilan Thiyagarajan <[email protected]>
@@ -2,7 +2,7 @@
name = "surfman"
license = "MIT OR Apache-2.0 OR MPL-2.0"
edition = "2018"
version = "0.9.0"
version = "0.9.1"
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure if we need to bump the minor version here instead, as this patch could break consumers that are working due to the presence of a link to libEGL.so.1 in the binary, similar to servo.

@mukilan
Copy link
Member Author

mukilan commented Feb 27, 2024

Thanks for the review!

@mukilan mukilan added this pull request to the merge queue Feb 27, 2024
Merged via the queue into main with commit 5624f6b Feb 27, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider loading libEGL.so.1 instead of libEGL.so
2 participants