Skip to content
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

[Feature request] Encode runtime dependencies of exe #13385

Open
pwithnall opened this issue Jul 4, 2024 · 2 comments
Open

[Feature request] Encode runtime dependencies of exe #13385

pwithnall opened this issue Jul 4, 2024 · 2 comments

Comments

@pwithnall
Copy link
Contributor

pwithnall commented Jul 4, 2024

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

See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4125

@dnicolodi
Copy link
Member

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.

@benoit-pierre
Copy link
Contributor

benoit-pierre commented Jul 5, 2024

@dnicolodi:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants