You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an executable in GLib (called glib-compile-resources) which is built as part of the main project build, and then run to build some files for the unit tests. On Windows, glib-compile-resources needs to spawn a subprocess (gspawn-win32-helper) which is built in a separate part of the build.
Currently, this means that building the files for the unit tests can sometimes fail if glib-compile-resources is built early, then the unit tests are attempted to be built before gspawn-win32-helper is built.
The only way we can come up with encoding this in Meson is to add gspawn-win32-helper to the depends of every test’s custom_target() if it uses glib-compile-resources. This is repetitive and hard to maintain: it’ll be easy to add another call to glib-compile-resources in future but forget to add the depends: gspawn-win32-helper to it.
It would be helpful if Meson provided a way to specify runtime dependencies of an executable, as a property of that executable. They would only affect the build dependency tree in the case where that executable is run as part of a custom_target() (or similar), and wouldn’t have to be explicitly/manually passed to the custom_target (as is our current workaround).
If I were to solve this issue, I would add gspawn-win32-helper to the extra dependencies of the glib-compile-resources executable. This would remove some parallelism in the build (gspawn-win32-helper and glib-compile-resources cannot be built concurrently anymore) but it would ensure that when glib-compile-resources is used in the tests, also gspawn-win32-helper has been built.
You can't add it to the glib-compile-resources executable dependencies, because it's not a dependency object.
You can't add it to its sources (well, you can, but it does no do anything).
You could add it to link_depends: glib-compile-resources & gspawn-win32-helper would still be built in parallel, but the former would always be linked after the later.
There is an
executable
in GLib (calledglib-compile-resources
) which is built as part of the main project build, and then run to build some files for the unit tests. On Windows,glib-compile-resources
needs to spawn a subprocess (gspawn-win32-helper
) which is built in a separate part of the build.Currently, this means that building the files for the unit tests can sometimes fail if
glib-compile-resources
is built early, then the unit tests are attempted to be built beforegspawn-win32-helper
is built.The only way we can come up with encoding this in Meson is to add
gspawn-win32-helper
to thedepends
of every test’scustom_target()
if it usesglib-compile-resources
. This is repetitive and hard to maintain: it’ll be easy to add another call toglib-compile-resources
in future but forget to add thedepends: gspawn-win32-helper
to it.It would be helpful if Meson provided a way to specify runtime dependencies of an
executable
, as a property of thatexecutable
. They would only affect the build dependency tree in the case where thatexecutable
is run as part of acustom_target()
(or similar), and wouldn’t have to be explicitly/manually passed to thecustom_target
(as is our current workaround).See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4125
The text was updated successfully, but these errors were encountered: