GNOME Bugzilla – Bug 694153
srcdir != builddir, automake, and vala
Last modified: 2016-09-20 14:43:51 UTC
This "bug" may not conceptually be in vala, but it's most convenient to discuss here I think. In the gnome-ostree build system, it uses srcdir != builddir, but note here that srcdir is a git checkout, so the .[ch] files aren't pregenerated. Recently I tracked down a bug where caribou stopped building in gnome-ostree, and it turned out to be because it uses --vapidir=$(top_srcdir), but the problem is that automake's generated vala rules include a "cd $(srcdir)" before the build command. From sub lang_vala_finish_target of automake 1.12.3: $output_rules .= "\$(srcdir)/${derived}_vala.stamp: @vala_sources\n". # Since the C files generated from the vala sources depend on the # ${derived}_vala.stamp file, we must ensure its timestamp is older than # those of the C files generated by the valac invocation below (this is # especially important on systems with sub-second timestamp resolution). # Thus we need to create the stamp file *before* invoking valac, and to # move it to its final location only after valac has been invoked. "\t${silent}rm -f \$\@ && echo stamp > \$\@-t\n". "\t${verbose}\$(am__cd) \$(srcdir) && $compile @vala_sources\n". "\t${silent}mv -f \$\@-t \$\@\n"; I guess all the vala rules are designed under the model that one is shipping pregenerated .[ch] in tarballs, so here the intention is that we compile the output into srcdir. But I personally always want to build from source code. Is there a vala change that could be made so automake didn't have to cd to srcdir?
The workaround I've been using so far is like this: http://git.gnome.org/browse/caribou/commit/?id=9a57b567b4753d948a0c3027d0ff26debd7c7314 But it's kind of unfortunate to just endlessly mark all vala-using modules as not supporting this form of srcdir != builddir, so I'd like to use this bug to figure out a long term plan.
*** Bug 760478 has been marked as a duplicate of this bug. ***
(In reply to Colin Walters from comment #1) > The workaround I've been using so far is like this: > > http://git.gnome.org/browse/caribou/commit/ > ?id=9a57b567b4753d948a0c3027d0ff26debd7c7314 That is not enough since distcheck also uses srcdir != builddir.
*** This bug has been marked as a duplicate of bug 725497 ***