From 19c69782eb3c1d99b79878d82efa935d565910f9 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 8 Oct 2026 12:10:16 +0000 Subject: [PATCH] Fix panic when EGL fails without reporting an error (#65329) Pin `khronos-egl` to the Zed fork's defensive error-handling fix for [FR-522](https://linear.app/zed-industries/issue/FR-522/zed-c82-called-optionunwrap-on-a-none-value). An EGL call can fail while `eglGetError()` reports `EGL_SUCCESS`. The binding currently unwraps the missing error, which caused the reported panic during Wayland surface creation. The fork returns a distinct `Error::Unreported` instead, preserves real EGL errors, and applies the same rule consistently to failed-call wrappers. - Fork commit: [42214b3](https://github.com/zed-industries/khronos-egl/commit/42214b36347b108fd9630ca6254b96dde59e04fe). - Upstream PR: [timothee-haudebourg/khronos-egl#37](https://github.com/timothee-haudebourg/khronos-egl/pull/37). - This PR changes only `Cargo.toml` and `Cargo.lock`. Remove the temporary fork patch once an upstream release includes the fix. The new public error variant is source-breaking for exhaustive matches, so the upstream PR explicitly leaves release/versioning to the maintainer. This integration uses a controlled Git pin and has been checked against the GLES downstream consumer. Release Notes: - [GPUI] Fixed a panic when EGL calls fail without reporting an error. --- Cargo.lock | 3 +-- Cargo.toml | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f65089978b6..84ab4d002f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9378,8 +9378,7 @@ dependencies = [ [[package]] name = "khronos-egl" version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" +source = "git+https://github.com/zed-industries/khronos-egl?rev=42214b36347b108fd9630ca6254b96dde59e04fe#42214b36347b108fd9630ca6254b96dde59e04fe" dependencies = [ "libc", "libloading", diff --git a/Cargo.toml b/Cargo.toml index f327ad4e588..062c473f593 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -995,6 +995,9 @@ libwebrtc = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = notify = { git = "https://github.com/zed-industries/notify", rev = "d842f16b2716bd60f09caf3ae3a894237ab38f54" } notify-types = { git = "https://github.com/zed-industries/notify", rev = "d842f16b2716bd60f09caf3ae3a894237ab38f54" } webrtc-sys = { git = "https://github.com/zed-industries/livekit-rust-sdks", rev = "0a1c519cfce9b365229026b55de9b9dbdb6fed3c" } +# Avoid panicking when a failed EGL call reports EGL_SUCCESS. +# https://github.com/timothee-haudebourg/khronos-egl/pull/37 +khronos-egl = { git = "https://github.com/zed-industries/khronos-egl", rev = "42214b36347b108fd9630ca6254b96dde59e04fe" } # corgi runs build.rs/proc-macros in a sandbox with no write access outside the # action's own OUT_DIR. Upstream `scratch` bakes its build-time OUT_DIR in via