Your message dated Tue, 19 Mar 2024 10:38:08 +0000
with message-id <[email protected]>
and subject line Bug#1060904: fixed in vala 0.56.16-2
has caused the Debian Bug report #1060904,
regarding vapigen, valadoc: Please search the same paths for GIR XML that 
GObject-Introspection does
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1060904: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060904
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: valac
Version: 0.56.14-1
Severity: important
Tags: trixie sid
User: [email protected]
Usertags: gi-gir-path

Steps to reproduce
------------------

$ podman run --rm -it debian:sid-slim
# apt update
# apt install valac libportal-dev gir1.2-glib-2.0-dev
# apt remove libgirepository1.0-dev
# vapigen --library=libportal --pkg=gio-2.0 /usr/share/gir-1.0/Xdp-1.0.gir

Expected result
---------------

libportal.vapi is generated successfully

Actual result
-------------

error: Package `GLib-2.0' not found in specified Vala API directories or 
GObject-Introspection GIR directories

Workaround
----------

# apt install libgirepository1.0-dev
# vapigen --library=libportal --pkg=gio-2.0 /usr/share/gir-1.0/Xdp-1.0.gir
Generation succeeded - 0 warning(s)

Discussion
----------

The gobject-introspection package had a long-standing bug that
GLib-2.0.gir was installed in /usr/share, but has architecture-dependent
contents, preventing it from being co-installed on different
architectures. Recent versions solve this by moving GLib-2.0.gir
to /usr/lib/${DEB_HOST_MULTIARCH}/gir-1.0 (in the gir1.2-glib-2.0-dev
package), and configuring gobject-introspection to search that path.

Unfortunately, various other programs like vapigen and valadoc also
want to read GIR XML, and they don't search the same directories for
it that gobject-introspection does.  For backwards compatibility,
gobject-introspection still installs a symbolic link
/usr/share/gir-1.0/GLib-2.0.gir -> ../../lib/${DEB_HOST_MULTIARCH}/GLib-2.0.gir
in the libgirepository1.0-dev package to avoid breaking those tools,
but I would prefer that symlink to disappear eventually.

There is at least one other package that has an architecture-dependent
GIR XML file: GstAudio-1.0.gir in libgstreamer-plugins-base1.0-dev
(https://bugs.debian.org/1016631). Having a symbolic link in /usr/share
is probably not an option here, because there's no convenient package
split to take advantage of; but if we move GstAudio-1.0.gir into
/usr/lib/${DEB_HOST_MULTIARCH}, then vapigen and valadoc will become
unable to process it.

I think the best way to solve this in vapigen and valadoc would be to
propose changes upstream to make it use the same search path as
gobject-introspection, resolving upstream issue
https://gitlab.gnome.org/GNOME/vala/-/issues/1518,
and then apply those changes in Debian (as a backported patch if necessary)
and configure it in a suitable way so that it searches
/usr/lib/${DEB_HOST_MULTIARCH}.

If that cannot be done in the near future, a less good alternative would
be to have a Debian-specific patch to search the ${libdir}, like the
attached (which is untested - sorry, I don't really know Vala).

Implementing this will also be an enabler for being able to cross-compile
packages that contain Vala bindings. I will open a separate bug report
for that, since the best solution for that is not completely obvious.

    smcv
>From 128f82310e24e9c72d192fc102a5a7a3af49f6cf Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Fri, 2 Oct 2020 10:01:03 +0100
Subject: [PATCH] Look for GIR files in compile-time ${libdir}, ${datadir}

This makes the search path used by Vala a little more compatible with
what's used by GObject-Introspection, which searches:

1. Any include paths explicitly given on the command-line
2. $GI_GIR_PATH, split on G_SEARCHPATH_SEPARATOR_S
3. g_get_user_data_dir()/gir-1.0 (usually ~/.local/share/gir-1.0),
   for completeness
4. Each item of g_get_system_data_dirs() + /gir-1.0
   (usually /usr/local/share/gir-1.0, /usr/share/gir-1.0)
5. GIR_DIR hard-coded at build-time, usually /usr/share/gir-1.0,
   but /usr/lib/MULTIARCH/gir-1.0 in Debian
6. DATADIR/gir-1.0 hard-coded at build-time
7. /usr/share/gir-1.0 (hard-coded)

This is not a full implementation of GObject-Introspection's
search path, and is only enough to provide compatibility with recent
GObject-Introspection versions in Debian that install some GIR XML into
/usr/lib/MULTIARCH/gir-1.0.

For upstream, a better solution would be to implement the full search
path <https://gitlab.gnome.org/GNOME/vala/-/issues/1518>, but my knowledge
of Vala is insufficient for that.

Forwarded: not-needed, Debian-specific
---
 compiler/Makefile.am      | 2 ++
 vala/Makefile.am          | 2 ++
 vala/valacodecontext.vala | 7 ++++++-
 vapi/config.vapi          | 2 ++
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/compiler/Makefile.am b/compiler/Makefile.am
index 9faaed197..e4e1af1c8 100644
--- a/compiler/Makefile.am
+++ b/compiler/Makefile.am
@@ -10,6 +10,8 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/vala \
 	-I$(top_srcdir)/codegen \
 	$(GLIB_CFLAGS) \
+	-DDATADIR=\"$(datadir)\" \
+	-DLIBDIR=\"$(libdir)\" \
 	-DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
 	$(NULL)
 
diff --git a/vala/Makefile.am b/vala/Makefile.am
index 09f3c0672..242bf6200 100644
--- a/vala/Makefile.am
+++ b/vala/Makefile.am
@@ -8,6 +8,8 @@ AM_CPPFLAGS = \
 	-I$(top_srcdir)/gee \
 	$(GLIB_CFLAGS) \
 	$(GMODULE_CFLAGS) \
+	-DDATADIR=\"$(datadir)\" \
+	-DLIBDIR=\"$(libdir)\" \
 	-DPACKAGE_DATADIR=\"$(pkgdatadir)\" \
 	$(NULL)
 
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 0ac4bbdf8..2586db820 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -688,7 +688,12 @@ public class Vala.CodeContext {
 	}
 
 	public string? get_gir_path (string gir) {
-		return get_file_path (gir + ".gir", "gir-1.0", null, gir_directories);
+		var basename = gir + ".gir";
+		var filename = get_file_path (basename, "gir-1.0", null, gir_directories);
+
+		if (filename == null) {
+			filename = get_file_path (basename, "gir-1.0", null, { Config.LIBDIR, Config.DATADIR });
+		}
 	}
 
 	public string? get_gresource_path (string gresource, string resource) {
diff --git a/vapi/config.vapi b/vapi/config.vapi
index c8b5d58a1..f0d219408 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -22,6 +22,8 @@
 
 [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
 namespace Config {
+	public const string DATADIR;
+	public const string LIBDIR;
 	public const string PACKAGE_DATADIR;
 	public const string PACKAGE_SUFFIX;
 	public const string PACKAGE_VALADOC_LIBDIR;
-- 
2.43.0


--- End Message ---
--- Begin Message ---
Source: vala
Source-Version: 0.56.16-2
Done: Simon McVittie <[email protected]>

We believe that the bug you reported is fixed in the latest version of
vala, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon McVittie <[email protected]> (supplier of updated vala package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 19 Mar 2024 09:44:55 +0000
Source: vala
Architecture: source
Version: 0.56.16-2
Distribution: unstable
Urgency: medium
Maintainer: Debian GNOME Maintainers 
<[email protected]>
Changed-By: Simon McVittie <[email protected]>
Closes: 1055530 1060904
Changes:
 vala (0.56.16-2) unstable; urgency=medium
 .
   * Team upload
 .
   [ Samuel Thibault ]
   * Add a pkg.vala.nographviz build-profile.
     This avoids a build-dependency loop: vala, graphviz, librsvg, vala.
     valadoc is rarely build-depended on, and mostly as Build-Depends-Indep
     or with <!nodoc>, so it seems like a good candidate for the place
     to break this cycle. (Closes: #1055530)
 .
   [ Simon McVittie ]
   * Temporarily disable valadoc on 32-bit non-x86.
     This allows it to be re-bootstrapped for the 64-bit time_t transition.
   * d/p/vala-Correctly-use-Path.build_path.patch,
     d/rules: Search /usr/lib/MULTIARCH/gir-1.0 for GIR XML
     (Closes: #1060904)
   * d/control: Avoid build-depending on libgirepository1.0-dev.
     That package is not multi-arch friendly, and now that we search
     /usr/lib/MULTIARCH/gir-1.0, we no longer need it.
Checksums-Sha1:
 0e28f4621385d116ae094492456302871d68cc75 3249 vala_0.56.16-2.dsc
 f8d41bb684cc422d108c9367125aaf78ca1585c7 35300 vala_0.56.16-2.debian.tar.xz
 f0f5216063331175176630bf0c43935bf83c6b6e 10525 vala_0.56.16-2_source.buildinfo
Checksums-Sha256:
 2ec952992e3e29dca621a5164983deec65a9676267a7b7d93139f5bd05eb6db0 3249 
vala_0.56.16-2.dsc
 3939e35add28b226ee853b9794582f5215840c14c08ce9d6cb6103345accd709 35300 
vala_0.56.16-2.debian.tar.xz
 49ceaf224d0d65ca0ecb925bec9a862688008e44b834edbb4874cdba2017752f 10525 
vala_0.56.16-2_source.buildinfo
Files:
 4febfbd9cc37e9fa8e3dde5620d675d3 3249 devel optional vala_0.56.16-2.dsc
 8bc45039f880639b6e73c11c782fcb28 35300 devel optional 
vala_0.56.16-2.debian.tar.xz
 8ca103a75e7d0c00983d479e28694675 10525 devel optional 
vala_0.56.16-2_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEENuxaZEik9e95vv6Y4FrhR4+BTE8FAmX5Z0AACgkQ4FrhR4+B
TE+u5g//dZb4lRFv3FML7T1D4kHx8/zjGqZO1H6vj5O5d3KyWPHS31ifZwB7l6oC
2pAVWaXJi0PWrm2iSkgR+g49olpvm+kMH14xRKYbN3t49Bs586TyM3uslOAZOJcF
nB/6TKF9HWGLMgRikQqoaHuqXiwg//p1AewNVE01kpatikVRM5Ovs8FmezO5Bfvb
R5qz/YnKncI4ATZFUWgUHOWwt35jxgVK0fdLSWbWo5h/vu4CLSrAYgQY4rg1Qddw
6izeqgc2z3QbwEOsRfp5DRafpLdmZGNaB+f1RYgRD5Y6ceGf/J/cASuxUkPZlMas
oZoTwe9ZsRaIhUmswFEANCK49cGwkkrl+fBqv21+2aYz+26KgD9V5n7y1ONVDCFB
2GtCZH0rPmahB0xS9AQeftMW0liiNsg7ymrgnYJMtQT0sXKf6/9ffAThbMO9+WLn
6xes5HhpKjvJagBSr5DRTkysMBBqqa4TdWtKkm34derjdlouR91QAOeNA+4Hg7iH
EC+R0IN0hXk+w2PD0Sg5OHQsxh52xPG+eCdyc3rd9Zqj9J+BZp4OYWC7pIgOaXrb
shoe+cTYm5kPx8GI5OnLwOTSjeW4hGCoHyjs5SVERIST16D0UT6+qnG3CQUHRniq
zKr5Vr3rgIlIjiPyTvS5CW8Qk7nmRVJzAvjx9VZgF1sdcyXn/dg=
=d6Pq
-----END PGP SIGNATURE-----

Attachment: pgpI4deQrAEFo.pgp
Description: PGP signature


--- End Message ---

Reply via email to