After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725497 - srcdir != builddir, automake, and vala
srcdir != builddir, automake, and vala
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 694153 731826 741758 786843 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-03-02 11:39 UTC by Stef Walter
Modified: 2018-05-22 15:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Makefile.am: Use builddir correctly instead of srcdir (6.15 KB, patch)
2014-03-02 11:39 UTC, Stef Walter
rejected Details | Review
Makefile.am: Use builddir correctly instead of srcdir (7.32 KB, patch)
2014-03-03 07:55 UTC, Stef Walter
none Details | Review
Makefile.am: Use builddir correctly instead of srcdir (6.72 KB, patch)
2016-09-20 14:48 UTC, Rico Tzschichholz
none Details | Review

Description Stef Walter 2014-03-02 11:39:51 UTC
vala does not build from git master when $builddir != $srcdir. This is
a common build style where you don't put generated files in the source
directory.

The attached patch fixes the issue. Checked with 'make check'
Comment 1 Stef Walter 2014-03-02 11:39:54 UTC
Created attachment 270691 [details] [review]
Makefile.am: Use builddir correctly instead of srcdir

Generated files go into $builddir not $srcdir. They should be
consumed from $builddir as well. This allows build to succeed
from git when $builddir != $srcdir. ie:

 $ mkdir x86_64
 $ cd x86_64
 $ ../autogen.sh --prefix=/blah
 $ make
Comment 2 Jürg Billeter 2014-03-02 13:24:31 UTC
Review of attachment 270691 [details] [review]:

Thanks, however, this patch breaks build with $builddir != $srcdir when building from a source tarball and thus, breaks distcheck.

It may be possible to extend the patch to support this as well, however, it would be less clean, in my opinion. Also, I don't know whether automake officially supports $builddir != $srcdir when building from scratch with autoreconf. Do you have a link to an official statement saying that automake supports such builds (e.g., from the documentation)? If yes, I'd be happy to accept an updated patch that doesn't break distcheck.
Comment 3 Stef Walter 2014-03-03 07:55:24 UTC
(In reply to comment #2)
> Review of attachment 270691 [details] [review]:
> 
> Thanks, however, this patch breaks build with $builddir != $srcdir when
> building from a source tarball and thus, breaks distcheck.
> 
> It may be possible to extend the patch to support this as well, however, it
> would be less clean, in my opinion. Also, I don't know whether automake
> officially supports $builddir != $srcdir when building from scratch with
> autoreconf. Do you have a link to an official statement saying that automake
> supports such builds (e.g., from the documentation)? 

There's a lot that's not in the automake documentation ... Including the versions at which various features, including ones that vala uses were added.

Thousands of projects use builddir != srcdir throughout their development process regardless of whether building from git (ie: autogen/autoreconf) or tarballs. It's quickly becoming best-practice, much like non recursive automake and parallel tests.

Writing to $srcdir is bad practice from any of the standard targets.

But I now understand that vala generally wants to have generated code in srcdir in  tarballs. I've fixed the patch so this doesn't break.

> If yes, I'd be happy to
> accept an updated patch that doesn't break distcheck.

Done. I should have double checked that. Duh...
Comment 4 Stef Walter 2014-03-03 07:55:38 UTC
Created attachment 270758 [details] [review]
Makefile.am: Use builddir correctly instead of srcdir

Generated files go into $builddir not $srcdir. They should be
consumed from $builddir as well. This allows build to succeed
from git when $builddir != $srcdir. ie:

 $ mkdir x86_64
 $ cd x86_64
 $ ../autogen.sh --prefix=/blah
 $ make
Comment 5 Rico Tzschichholz 2016-09-20 14:43:51 UTC
*** Bug 694153 has been marked as a duplicate of this bug. ***
Comment 6 Rico Tzschichholz 2016-09-20 14:44:00 UTC
*** Bug 741758 has been marked as a duplicate of this bug. ***
Comment 7 Rico Tzschichholz 2016-09-20 14:44:41 UTC
*** Bug 731826 has been marked as a duplicate of this bug. ***
Comment 8 Rico Tzschichholz 2016-09-20 14:48:24 UTC
Created attachment 335938 [details] [review]
Makefile.am: Use builddir correctly instead of srcdir

Generated files go into $builddir not $srcdir. They should be
consumed from $builddir as well. This allows build to succeed
from git when $builddir != $srcdir. ie:

 $ mkdir x86_64
 $ cd x86_64
 $ ../autogen.sh --prefix=/blah
 $ make
Comment 9 Jakub Kaszycki 2017-08-26 19:42:31 UTC
*** Bug 786843 has been marked as a duplicate of this bug. ***
Comment 10 GNOME Infrastructure Team 2018-05-22 15:05:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/434.