[From nobody Tue Nov  3 00:07:08 2026
Received: (at submit) by bugs.debian.org; 2 Nov 2026 20:44:27 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-11.5 required=4.0 tests=BAYES_00,
 BODY_INCLUDES_CONTROL_AFFECTS,DATE_IN_PAST_03_06,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FOURLA,SPF_HELO_NONE,SPF_NONE,
 WORD_WITHOUT_VOWELS autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 52; hammy, 150; neutral, 291; spammy,
 0. spammytokens: hammytokens:0.000-+--H*Ad:N*Bug,
 0.000-+--HTo:N*Debian, 0.000-+--HTo:N*Bug, 0.000-+--HTo:N*System,
 0.000-+--HTo:N*Tracking
Return-path: &lt;helmut@subdivi.de&gt;
Received: from isilmar-4.linta.de ([136.243.71.142]:47598)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;helmut@subdivi.de&gt;) id 1xNytH-004ZWh-1J
 for submit@bugs.debian.org; Mon, 02 Nov 2026 20:44:27 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=subdivi.de;
 s=k34.isilmar-4; t=1793652263;
 bh=3Htk1AWTHrehu0UzVsOVyZWyAmYBbHayeQl/04s4cos=;
 h=Date:From:To:Subject:From;
 b=ag4wJRoBzF7EXOQgY2NbNRpkEFwZvsTbFm0bJX/E2bli+G5yKIBR5Cj4nCWhNXZOx
 4p2t2ZbdBlYbs/8beB2RzV2L7cLzURo5G31DYxuFUdvjInu/d9tXqo6iu/G6V9YT1j
 Ra6bA6yAttXxfFuvFUYXAUQMOjcbyOehTMMVG76vSaoLxuCmEgBHCdtp2vr8z85eRn
 FhEpJmG+H3HXdWnN2ICjzPo9vm0ElfgvL3+Wwn2ilzBQDKLre+TGOhFF5E+CJQS0ey
 CvF6lqQx5vllV3BgOGcrkoryJT8fKONt5Ny8UEgbtfbY+GjlikWroLXBZ8oMbOW+qt
 MxdKy7sUPi7TA==
Received: from isilmar-4.linta.de (isilmar.linta [10.0.0.1])
 by isilmar-4.linta.de (Postfix) with ESMTP id AD8F12009BB
 for &lt;submit@bugs.debian.org&gt;; Mon,  2 Nov 2026 20:44:23 +0000 (UTC)
Date: Mon, 2 Nov 2026 16:38:31 +0100
From: Helmut Grohne &lt;helmut@subdivi.de&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: librsvg FTCBFS: multiple reasons
Message-ID: &lt;20261102153831.GA2538939@subdivi.de&gt;
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=&quot;4RnwhdjBZDothlKr&quot;
Content-Disposition: inline
X-Reportbug-Version: 13.2.0
Delivered-To: submit@bugs.debian.org


--4RnwhdjBZDothlKr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Source: librsvg
Version: 2.63.3+dfsg-1
Tags: patch
User: debian-cross@lists.debian.org
Usertags: cross-satisfiability ftcbfs
Control: affects 1126007 + src:librsvg

librsvg fails to cross build from source for a fair number of reasons.

The first issue to run into is the locales dependency. The package is
Arch: all and not Multi-Arch: foreign. Rather than figuring out how to
make it work, I observe that it is only used inside dh_auto_test, so
annotating the dependency &lt;!nocheck&gt; is feasible. At that point, it
becomes irrelevant to cross building.

With that change in place, librsvg's dependencies become theoretically
satisfiable. Unfortunately, apt sees a difference to practice. The rustc
and cargo dependencies are interpreted has host architecture
dependencies, so they would get us tools that cannot be run. Since they
are multi-target tools, we need their native version. While the rustc
dependency normally includes libstd-rust-dev, it gets us the wrong
libstd-rust-dev once rustc is annotated :native, so libstd-rust-dev must
be added to Build-Depends explicitly.

At this point, Build-Depends can be installed. Unfortunately, meson
refuses to configure. It objects to enabling the introspection and vala
features as we cannot run host binaries. Indeed, there is no known way
to run the g-ir-scanner without actually running host binaries, but on
Debian the tool hides this fact and transparently uses qemu when needed,
so meson doesn't actually get to run host binaries. For vala, the story
is different. It actually doesn't require running host binaries. I'm not
sure whether removing the &quot;meson.can_run_host_binaries()&quot; calls is
acceptable upstream, but it certainly is not generally correct.

With that change, meson manages to configure librsvg. Unfortunately, it
does not pass a host triplet to cargo, so the Rust components are built
for the build architecture. librsvg's meson.build expect that you pass
the relevant triplet via -Dtriplet= and to be precise, a Rust triplet
rather than a GNU triplet is expected here.
/usr/share/rustc/architecture.mk can compute the relevant value.

Then, the build proceeds quite far until meson launches the wrong
vapigen. This is not a bug in librsvg but in meson itself and it is
reported as #1126007.

Please consider applying the attached patch.

Helmut

--4RnwhdjBZDothlKr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=&quot;librsvg_2.63.3+dfsg-1.1.debdiff&quot;

diff -Nru librsvg-2.63.3+dfsg/debian/changelog librsvg-2.63.3+dfsg/debian/changelog
--- librsvg-2.63.3+dfsg/debian/changelog	2026-10-19 17:37:26.000000000 +0200
+++ librsvg-2.63.3+dfsg/debian/changelog	2026-11-01 13:35:36.000000000 +0100
@@ -1,3 +1,14 @@
+librsvg (2.63.3+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Improve cross building: (Closes: #-1)
+    + Turn locales dependency optional via &lt;!nocheck&gt;.
+    + Use a native Rust toolchain.
+    + Pass the triplet option to meson.
+    + cross.patch: Reduce introspection and vala requirements.
+
+ -- Helmut Grohne &lt;helmut@subdivi.de&gt;  Sun, 01 Nov 2026 13:35:36 +0100
+
 librsvg (2.63.3+dfsg-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru librsvg-2.63.3+dfsg/debian/control librsvg-2.63.3+dfsg/debian/control
--- librsvg-2.63.3+dfsg/debian/control	2026-10-19 17:37:26.000000000 +0200
+++ librsvg-2.63.3+dfsg/debian/control	2026-11-01 13:35:36.000000000 +0100
@@ -10,8 +10,8 @@
 Build-Depends:
  debhelper-compat (= 14),
  dh-sequence-gir,
- cargo,
- cargo-c (&gt;= 0.10.10),
+ cargo:native,
+ cargo-c:native (&gt;= 0.10.10),
  gir1.2-cairo-1.0-dev &lt;!nogir&gt;,
  gir1.2-gdkpixbuf-2.0-dev &lt;!nogir&gt;,
  gir1.2-gio-2.0-dev &lt;!nogir&gt;,
@@ -24,11 +24,12 @@
  libglib2.0-dev,
  libharfbuzz-dev,
  libpango1.0-dev (&gt;= 1.58.2),
+ libstd-rust-dev,
  libxml2-dev,
- locales,
+ locales &lt;!nocheck&gt;,
  meson (&gt;= 1.3.0),
  python3-docutils,
- rustc (&gt;= 1.85.1),
+ rustc:native (&gt;= 1.85.1),
  valac,
 Build-Depends-Indep:
  gi-docgen &lt;!nodoc&gt;,
diff -Nru librsvg-2.63.3+dfsg/debian/patches/cross.patch librsvg-2.63.3+dfsg/debian/patches/cross.patch
--- librsvg-2.63.3+dfsg/debian/patches/cross.patch	1970-01-01 01:00:00.000000000 +0100
+++ librsvg-2.63.3+dfsg/debian/patches/cross.patch	2026-11-01 13:35:36.000000000 +0100
@@ -0,0 +1,14 @@
+--- librsvg-2.63.3+dfsg.orig/meson.build
++++ librsvg-2.63.3+dfsg/meson.build
+@@ -158,9 +158,9 @@
+ if host_system == 'windows'
+   build_gir = get_option('introspection').require(get_option('default_library') != 'static' and meson.can_run_host_binaries() and gi_dep.found())
+ else
+-  build_gir = get_option('introspection').require(meson.can_run_host_binaries() and gi_dep.found())
++  build_gir = get_option('introspection').require(gi_dep.found())
+ endif
+-build_vala = get_option('vala').require(meson.can_run_host_binaries() and vapigen_dep.found())
++build_vala = get_option('vala').require(vapigen_dep.found())
+ 
+ build_rsvg_convert = get_option('rsvg-convert')
+ 
diff -Nru librsvg-2.63.3+dfsg/debian/patches/series librsvg-2.63.3+dfsg/debian/patches/series
--- librsvg-2.63.3+dfsg/debian/patches/series	2026-10-19 17:37:26.000000000 +0200
+++ librsvg-2.63.3+dfsg/debian/patches/series	2026-11-01 13:35:36.000000000 +0100
@@ -4,3 +4,4 @@
 workarounds/skip-broken-reftests.diff
 workarounds/Skip-invalid_viewbox-test-on-32-bit-x86.patch
 workarounds/tests-Skip-known-failing-tests-on-i386.patch
+cross.patch
diff -Nru librsvg-2.63.3+dfsg/debian/rules librsvg-2.63.3+dfsg/debian/rules
--- librsvg-2.63.3+dfsg/debian/rules	2026-10-19 17:37:26.000000000 +0200
+++ librsvg-2.63.3+dfsg/debian/rules	2026-11-01 13:35:36.000000000 +0100
@@ -7,6 +7,8 @@
 export CARGO_VENDOR_DIR = $(CURDIR)/debian/missing-sources
 NULL =
 
+include /usr/share/rustc/architecture.mk
+
 # Increase reftest tolerance a bit to account for different harfbuzz,
 # pango, etc.
 export RSVG_TEST_TOLERANCE=20
@@ -27,6 +29,7 @@
 	dh_auto_configure -- \
 		-Davif=$(if $(shell dpkg-vendor --derives-from Ubuntu &amp;&amp; echo y),disabled,enabled) \
 		-Dpixbuf-loader=enabled \
+		-Dtriplet=$(DEB_HOST_RUST_TYPE) \
 		$(NULL)
 
 execute_after_dh_auto_build:

--4RnwhdjBZDothlKr--
]