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

Dependencies for Vala added to the C build target #1994

Open
ebassi opened this issue Jun 24, 2017 · 4 comments
Open

Dependencies for Vala added to the C build target #1994

ebassi opened this issue Jun 24, 2017 · 4 comments

Comments

@ebassi
Copy link
Contributor

ebassi commented Jun 24, 2017

Meson adds the dependency for building Vala-based targets to the .c → .o target, but some dependencies are needed at the .vala → .c target — for instance, a dependency on an in-tree GIR file needs to be satisfied when building the C source from Vala.

If I generate introspection data with gnome.generate_gir() and then declare a dependency:

totem_gir = gnome.generate_gir(...)
totem_gir_dep = declare_dependency(sources: totem_gir[0])

And then use the totem_gir_dep as a dependency for a build target like:

shared_module('some vala plugin', sources: 'foo.vala', dependencies: totem_gir_dep, ...)

Then Meson will generate a build target like:

build src/plugins/rotation/rotation@sha/totem-rotation-plugin.c src/plugins/rotation/rotation.h src/plugins/rotation/rotation.vapi: vala_COMPILER ../src/plugins/rotation/bacon-video.vapi ../src/plugins/rotation/totem-rotation-plugin.vala
 ...
build src/plugins/rotation/rotation@sha/src_plugins_rotation_rotation@sha_totem-rotation-plugin.c.o: c_COMPILER src/plugins/rotation/rotation@sha/totem-rotation-plugin.c || src/Totem-1.0.gir

With the src/Totem-1.0.gir dependency on the latter rule, instead of the former.

@ebassi
Copy link
Contributor Author

ebassi commented Jun 24, 2017

I guess this is related to #1923.

@nirbheek
Copy link
Member

Yes, probably has the same root cause.

@hadess
Copy link

hadess commented Oct 6, 2017

Original totem bug:
https://bugzilla.gnome.org/show_bug.cgi?id=786248

orivej added a commit to orivej/nixpkgs that referenced this issue Dec 7, 2017
meson does not support parallel building of certain vala projects:
mesonbuild/meson#1994
https://bugzilla.gnome.org/show_bug.cgi?id=784236

but at the moment this only affects gnome3.totem:

ninja src/plugins/rotation/rotation.vapi
[1/1] Compiling Vala source ../src/plugins/rotation/bacon-video.vapi ../src/plugins/rotation/totem-rotation-plugin.vala.
FAILED: src/plugins/rotation/rotation@sha/totem-rotation-plugin.c src/plugins/rotation/rotation.h src/plugins/rotation/rotation.vapi
valac -C --pkg clutter-gtk-1.0 --pkg cogl-pango-1.0 --pkg libpeas-1.0 --pkg gtk+-3.0 --color=always --directory src/plugins/rotation/rotation@sha --basedir ../src/plugins/rotation --library rotation --header src/plugins/rotation/rotation.h --vapi ../rotation.vapi --girdir=/tmp/nds-build-gnome3.totem/totem-3.26.0/build/src --pkg=Totem-1.0 ../src/plugins/rotation/bacon-video.vapi ../src/plugins/rotation/totem-rotation-plugin.vala
error: Package `Totem-1.0' not found in specified Vala API directories or GObject-Introspection GIR directories
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jun 14, 2018
With vala support disabled for now:
mesonbuild/meson#1994
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jun 14, 2018
With vala support disabled for now:
mesonbuild/meson#1994
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jul 30, 2018
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jul 30, 2018
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jul 31, 2018
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jul 31, 2018
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jul 31, 2018
hadess added a commit to flatpak/flatpak-builder that referenced this issue Aug 1, 2018
ninja defaults to running in a highly parallel mode, but some bugs in
meson, such as:
mesonbuild/meson#1994
require building serially.

This change makes the cmake-ninja and meson buildsystems respect
"no-parallel-make" during building.
hadess added a commit to flatpak/flatpak-builder that referenced this issue Aug 1, 2018
ninja defaults to running in a highly parallel mode, but some bugs in
meson, such as:
mesonbuild/meson#1994
require building serially.

This change makes the cmake-ninja and meson buildsystems respect
"no-parallel-make" during building.
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Aug 1, 2018
Disable vala to work-around:
mesonbuild/meson#1994
until we can use the "-j1" work-around once flatpak-builder is fixed:
flatpak/flatpak-builder#190
rh-atomic-bot pushed a commit to flatpak/flatpak-builder that referenced this issue Aug 1, 2018
ninja defaults to running in a highly parallel mode, but some bugs in
meson, such as:
mesonbuild/meson#1994
require building serially.

This change makes the cmake-ninja and meson buildsystems respect
"no-parallel-make" during building.

Closes: #190
Approved by: TingPing
gnomesysadmins pushed a commit to GNOME/gnome-boxes that referenced this issue Aug 5, 2018
At the moment, parallel build does not work because of how Meson handles
dependencies for Vala:

mesonbuild/meson#1994

This failed the nightly build, for example:

https://gnome1.codethink.co.uk/logs/build-2018-08-05-091458/build-gnome-apps-nightly-master-org.gnome.Boxes-aarch64.txt

Building with `-j 1` works around the bug.
@eli-schwartz
Copy link
Member

Without knowing too much about how Meson's vala support works under the hood, this seems like something that makes sense to simply categorize internally based on "knowing" that for any multi-stage vala->c->o set of rules, gir files are always applied to the first stage. Do we really need to mess around with how dependencies are represented?

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

No branches or pull requests

4 participants