From b8fcfdf14cba264f35a007b6d42470838d02658a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?= Date: Wed, 11 Mar 2026 10:58:25 +0100 Subject: [PATCH] chromium: Conditionally apply the Rust 1.8x patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For Rust 1.94 in Yocto master, the patch causes a build error: --> ../../third_party/crabbyavif/src/src/lib.rs:16:46 | 16 | #![cfg_attr(feature = "disable_cfi", feature(no_sanitize))] | ^^^^^^^^^^^ feature has been removed | = note: removed in 1.91.0; see for more information = note: renamed to sanitize(xyz = "on|off") Applying the patch conditionally based on RUSTVERSION allows building both under Yocto 5.3 and current master. Signed-off-by: Zoltán Böszörményi --- meta-chromium/recipes-browser/chromium/chromium-gn.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta-chromium/recipes-browser/chromium/chromium-gn.inc b/meta-chromium/recipes-browser/chromium/chromium-gn.inc index f82fedd45..5424205a6 100644 --- a/meta-chromium/recipes-browser/chromium/chromium-gn.inc +++ b/meta-chromium/recipes-browser/chromium/chromium-gn.inc @@ -10,6 +10,10 @@ inherit features_check pkgconfig gtk-icon-cache qemu rust-common OUTPUT_DIR = "out/Release" B = "${S}/${OUTPUT_DIR}" +def rust_is_newer_than_190(d): + rustver = d.getVar('RUSTVERSION').split('.') + return int(rustver[0]) > 1 or (int(rustver[0]) == 1 and int(rustver[1]) > 90) + # Backported patches. # None currently \o/ @@ -27,7 +31,7 @@ SRC_URI += "\ file://0012-chromium-fix-v4l2-compiler-error-on-arm.patch \ file://0013-Reduce-minimum-browser-window-width-to-480px.patch \ file://0001-Fix-building-gpu_host_impl.cc-on-Linux.patch \ - file://chromium-142-crabbyavif-rust18x.patch \ + ${@ '' if rust_is_newer_than_190(d) else 'file://chromium-142-crabbyavif-rust18x.patch'} \ " # ARM/AArch64-specific patches.