commit:     bd04550468f8cdc436e07319d926ba7c295c4afd
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 26 04:40:23 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 26 04:40:23 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd045504

gnome-base/librsvg: workaroud/fix tests w/ libxml2-2.15.0

The patch used is from nixpkgs. It only touches tests and still expects
an error, just not exactly the same error as before, so it's good enough
as a workaround for us for now.

Closes: https://bugs.gentoo.org/964256
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../librsvg-2.60.0-libxml2-2.15.0-tests.patch      | 28 ++++++++++++++++++++++
 gnome-base/librsvg/librsvg-2.60.0.ebuild           |  4 ++++
 2 files changed, 32 insertions(+)

diff --git a/gnome-base/librsvg/files/librsvg-2.60.0-libxml2-2.15.0-tests.patch 
b/gnome-base/librsvg/files/librsvg-2.60.0-libxml2-2.15.0-tests.patch
new file mode 100644
index 000000000000..80ee10855b0a
--- /dev/null
+++ b/gnome-base/librsvg/files/librsvg-2.60.0-libxml2-2.15.0-tests.patch
@@ -0,0 +1,28 @@
+https://bugs.gentoo.org/964256
+https://gitlab.gnome.org/GNOME/librsvg/-/issues/1201
+
+"This patch makes the test succeed. Therefore, there is probably not a 
security issue here.
+An error does occur, it just is not being reported as TooManyLoadedElements.
+So just the dumb thing, adding an unwrap and expecting it to fail is a decent 
enough bandaid."
+--- a/rsvg/tests/errors.rs
++++ b/rsvg/tests/errors.rs
+@@ -14,15 +14,12 @@ use rsvg::{CairoRenderer, ImplementationLimit, Loader, 
LoadingError, RenderingEr
+ 
+ #[ignore]
+ #[test]
++#[should_panic]
+ fn too_many_elements() {
+     let name = "tests/fixtures/errors/bug515-too-many-elements.svgz";
+ 
+-    assert!(matches!(
+-        Loader::new().read_path(name),
+-        Err(LoadingError::LimitExceeded(
+-            ImplementationLimit::TooManyLoadedElements
+-        ))
+-    ));
++    // libxml2 might return an error without updating the element count, so 
just expect any error, not specifically too many elements
++    Loader::new().read_path(name).unwrap();
+ }
+ 
+ fn rendering_instancing_limit(name: &str) {
+

diff --git a/gnome-base/librsvg/librsvg-2.60.0.ebuild 
b/gnome-base/librsvg/librsvg-2.60.0.ebuild
index 2376d63fe1ea..07eca7a4728c 100644
--- a/gnome-base/librsvg/librsvg-2.60.0.ebuild
+++ b/gnome-base/librsvg/librsvg-2.60.0.ebuild
@@ -62,6 +62,10 @@ QA_FLAGS_IGNORED="
        usr/lib.*/gdk-pixbuf*/*/loaders/*
 "
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.60.0-libxml2-2.15.0-tests.patch
+)
+
 pkg_setup() {
        rust_pkg_setup
        python-any-r1_pkg_setup

Reply via email to