-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnome: Doesn't generate typelib that is depended on by an executable (regression in b1e3440e) #7756
Comments
See https://gitlab.gnome.org/GNOME/libpeas/-/issues/40 for the other side of this. |
In Meson since 0.55.0, having the test executable depend on the GIR dependency is not enough to ensure that uninstalled GIR and typelib files are generated: we also need to have the test itself depend on the GIR build target. It is not clear to me whether this is a workaround for a Meson regression (if what libpeas previously did was meant to work), or a solution to a libpeas bug (if it was never meant to be guaranteed to work). For more details see <mesonbuild/meson#7756>. Resolves: https://gitlab.gnome.org/GNOME/libpeas/-/issues/40 Bug-Debian: https://bugs.debian.org/966951
No, this was unintended. I'll look into it. |
I turned @smcv code into a unit test and I can confirm it does not pass. One possible fix is to special case .gir and .typelib as link_depend instead. But I think b1e3440 should rather be reverted because if it's in the sources then it's a dependency, that's what the user asked for... That being said, I know why there is that pattern of putting gir files into sources. That's the only way they have to make gir depend on other gir. If you add a 2nd library libfoo that depends on libhello, you do We can be smarter than that, pkgconfig.generate() has a very similar case:
In that case libhello is promoted from I think gnome.generate_gir(libhello) should do something similar, libhello should remember the generated gir target so when it's passed to another generate_gir it can be added as dependency. |
@smcv as for libpeas case, I think libhello_gir really is a dependency of the test, your workaround is the actual proper fix IMHO. Alternatively it could also be set as |
I ran into the same problem, with my custom gir not being built because it wasn't a dependency or installed. I expected it to be built nonetheless, like an uninstalled binary would have. Surprising. |
Describe the bug
The gnome module in Meson since b1e3440 doesn't generate GObject-Introspection data under some circumstances where older versions did, causing libpeas to fail its build-time tests.
I'm honestly not sure whether this is a Meson bug or a libpeas bug, so I'm reporting it to both projects.
To Reproduce
This is a simplified version of the libpeas test suite. It builds a library that will not be installed, and generates a GObject-Introspection typelib which will also not be installed. The test assumes it can load that typelib.
This is a simplification. In the real libpeas, the equivalent of "Hello" is called "Introspection" and contains various toy objects, and the equivalents of
test.c
actually do something with the Introspection typelib.Expected behavior
Before meson commit b1e3440 (found by bisection), the fact that
test_exe
depends onlibhello_dep
andlibhello_gir_dep
is enough to guarantee thatHello-1.0.typelib
andHello-1.0.gir
are generated, even if you do not configure with-Dworkaround=true
.Actual behaviour
If you do not configure with
-Dworkaround=true
,Hello-1.0.typelib
is not generated and the test fails.Workaround
Adding
depends: [libhello_gir]
to thetest()
(not just theexecutable()
) forces the GIR and typelib to be generated, making the test pass. For easy comparison, my sample code does this when configured with-Dworkaround=true
.system parameters
The text was updated successfully, but these errors were encountered: