Describe the bug
When generating GIR XML and typelibs, the GNOME module always tells g-ir-scanner to link the "dumper" binary to libgirepository-1.0.
To Reproduce
Run Meson's unit tests, for example building test cases/frameworks/12 multiple gir is suitable.
Expected behavior
When gir/meson.build runs g-ir-scanner to generate Meson-1.0.gir, I expect the resulting "dumper" binary to be linked to libgobject-2.0 because girsubproject has that as a dependency, but I don't expect it to be linked to libgirepository-1.0 because the "dumper" binary doesn't need that library.
I believe the reason why this is happening is that commit 777004198 "
gnome: Fix usage of gobject-introspection as subproject" (#7020) added:
deps += [gir_dep]
which is the same as adding dependency('gobject-introspection-1.0') to the dependencies of an executable.
If GObject-Introspection is a subproject, I think it should be added to the depends, so that the subproject will be built before the GIR XML, and so that changes to the subproject will trigger a rebuild of the GIR XML; but I think it should not be included in the list of dependencies passed to self._get_dependencies_flags, which should mean there is no --extra-library=girepository-1.0 unless the meson.build explicitly specifies a dependency on libgirepository.
system parameters
native build (but cross builds also exhibit the same problem)
Describe the bug When generating GIR XML and typelibs, the GNOME module always tells g-ir-scanner to link the "dumper" binary to
libgirepository-1.0
.To Reproduce Run Meson's unit tests, for example building
test cases/frameworks/12 multiple gir
is suitable.Expected behavior When
gir/meson.build
runsg-ir-scanner
to generateMeson-1.0.gir
, I expect the resulting "dumper" binary to be linked tolibgobject-2.0
becausegirsubproject
has that as a dependency, but I don't expect it to be linked tolibgirepository-1.0
because the "dumper" binary doesn't need that library.For comparison, and to illustrate what I expected: Autotools doesn't link the "dumper" binary to
libgirepository-1.0
. For example, when I compile libostree in https://buildd.debian.org/status/fetch.php?pkg=ostree&arch=amd64&ver=2023.8-1&stamp=1702049756&raw=0, there are no--extra-library
flags at all, and the only-I
are for libostree's dependencies GLib, Gio and libmount:Actual behavior
(from https://buildd.debian.org/status/fetch.php?pkg=meson&arch=all&ver=1.3.1-1&stamp=1703618386&raw=0, whitespace added for clarity)
Meson adds
-I
and--extra-library
forlibgirepository-1.0
and its dependencies:I believe the reason why this is happening is that commit 777004198 " gnome: Fix usage of gobject-introspection as subproject" (#7020) added:
which is the same as adding
dependency('gobject-introspection-1.0')
to thedependencies
of an executable.If GObject-Introspection is a subproject, I think it should be added to the
depends
, so that the subproject will be built before the GIR XML, and so that changes to the subproject will trigger a rebuild of the GIR XML; but I think it should not be included in the list of dependencies passed toself._get_dependencies_flags
, which should mean there is no--extra-library=girepository-1.0
unless themeson.build
explicitly specifies a dependency on libgirepository.system parameters