🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
3 messages
3 total messages Started by Helmut Grohne Mon, 02 Nov 2026 20:50
Bug#1152880: librsvg FTCBFS: multiple reasons
#3065
Author: Helmut Grohne
Date: Mon, 02 Nov 2026 20:50
153 lines
7883 bytes
--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 <!nocheck> 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 "meson.can_run_host_binaries()" 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="librsvg_2.63.3+dfsg-1.1.debdiff"

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 <!nocheck>.
+    + Use a native Rust toolchain.
+    + Pass the triplet option to meson.
+    + cross.patch: Reduce introspection and vala requirements.
+
+ -- Helmut Grohne <helmut@subdivi.de>  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 (>= 0.10.10),
+ cargo:native,
+ cargo-c:native (>= 0.10.10),
  gir1.2-cairo-1.0-dev <!nogir>,
  gir1.2-gdkpixbuf-2.0-dev <!nogir>,
  gir1.2-gio-2.0-dev <!nogir>,
@@ -24,11 +24,12 @@
  libglib2.0-dev,
  libharfbuzz-dev,
  libpango1.0-dev (>= 1.58.2),
+ libstd-rust-dev,
  libxml2-dev,
- locales,
+ locales <!nocheck>,
  meson (>= 1.3.0),
  python3-docutils,
- rustc (>= 1.85.1),
+ rustc:native (>= 1.85.1),
  valac,
 Build-Depends-Indep:
  gi-docgen <!nodoc>,
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 && echo y),disabled,enabled) \
 		-Dpixbuf-loader=enabled \
+		-Dtriplet=$(DEB_HOST_RUST_TYPE) \
 		$(NULL)
 
 execute_after_dh_auto_build:

--4RnwhdjBZDothlKr--
Bug#1152880: librsvg FTCBFS: multiple reasons
#3086
Author: Simon McVittie
Date: Mon, 02 Nov 2026 23:50
30 lines
3107 bytes
On Mon, 02 Nov 2026 at 16:38:31 +0100, Helmut Grohne wrote:
>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.

Actually we can, if `meson env2mfile` is used to generate a cross-file 
that sets exe_wrapper to the Debian-specific 
MULTIARCH-cross-exe-wrapper. This is a long-standing feature request for 
debhelper, which currently uses the deprecated debcrossgen tool, which 
the meson maintainer doesn't want to improve any further (see also 
#1111001, https://salsa.debian.org/debian/debhelper/-/merge_requests/127) 
but `export MESON_USE_NEW_CROSSGEN=1` in debian/rules should be enough 
to make this work.

I think using `meson env2mfile` would be preferable to patching the 
upstream build system to pretend that introspection can work without the 
ability to run host binaries.

>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.

If the build uses `meson env2mfile`, then recent Meson should resolve 
this without necessarily needing to look up vapigen via pkg-config, 
because https://github.com/mesonbuild/meson/pull/15056 was merged.

(Or the cross-file
/usr/share/meson/cross/${DEB_HOST_GNU_TYPE}-vala.ini is also available.)

     smcv
Bug#1152880: librsvg FTCBFS: multiple reasons
#3092
Author: Helmut Grohne
Date: Tue, 03 Nov 2026 06:10
56 lines
4622 bytes
Hi Simon,

On Mon, Nov 02, 2026 at 11:45:46PM +0000, Simon McVittie wrote:
> On Mon, 02 Nov 2026 at 16:38:31 +0100, Helmut Grohne wrote:
> > 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.
> 
> Actually we can, if `meson env2mfile` is used to generate a cross-file that
> sets exe_wrapper to the Debian-specific MULTIARCH-cross-exe-wrapper. This is
> a long-standing feature request for debhelper, which currently uses the
> deprecated debcrossgen tool, which the meson maintainer doesn't want to
> improve any further (see also #1111001,
> https://salsa.debian.org/debian/debhelper/-/merge_requests/127) but `export
> MESON_USE_NEW_CROSSGEN=1` in debian/rules should be enough to make this
> work.

I agree that improving meson would be preferable, but that does not seem
to be a practical option with an uncooperative meson maintainer and an
upstream that we angered in social interaction.

> I think using `meson env2mfile` would be preferable to patching the upstream
> build system to pretend that introspection can work without the ability to
> run host binaries.

I agree that the patch likely is not upstreamable. It was meant more as
a stop-gap solution demonstrating the cause and also highlighting
existsing meson bugs. At least in the vala case, I believe the upstream
way is technically wrong, but I'm not sure what a good solution is.

In any case, I won't object to using other solutions and shall continue
to work towards making env2mfile available.

> > 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.
> 
> If the build uses `meson env2mfile`, then recent Meson should resolve this
> without necessarily needing to look up vapigen via pkg-config, because
> https://github.com/mesonbuild/meson/pull/15056 was merged.
> 
> (Or the cross-file
> /usr/share/meson/cross/${DEB_HOST_GNU_TYPE}-vala.ini is also available.)

Be that as it may be, but meson should default to a way that just works.
Requiring all packages to provide such aspects via a cross-file when
pkg-config can readily discover it is backwards. I therefore see this as
a meson problem, not as a librsvg problem. The sheer amount of packages
affected by this very bug (I count at least 53) makes it clear that it
should be fixed there.

Given that Jeremy uploaded my patch already, I would like to know
whether I should rework the patch to use MESON_USE_NEW_CROSSGEN or
whether we should keep the new status quo until meson gets fixed.

Helmut
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads