From unknown Thu Aug 14 22:22:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12540: Usage of srcdir when valac is generating a header file Resent-From: Vivien Malerba Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Sat, 29 Sep 2012 17:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12540 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: 12540@debbugs.gnu.org X-Debbugs-Original-To: bug-automake@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134894149930425 (code B ref -1); Sat, 29 Sep 2012 17:59:01 +0000 Received: (at submit) by debbugs.gnu.org; 29 Sep 2012 17:58:19 +0000 Received: from localhost ([127.0.0.1]:33859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TI1Iw-0007uf-OW for submit@debbugs.gnu.org; Sat, 29 Sep 2012 13:58:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45690) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TI0u0-0007MD-CQ for submit@debbugs.gnu.org; Sat, 29 Sep 2012 13:32:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TI0ti-0001H9-W4 for submit@debbugs.gnu.org; Sat, 29 Sep 2012 13:32:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:32798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TI0ti-0001H5-Sd for submit@debbugs.gnu.org; Sat, 29 Sep 2012 13:32:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TI0th-0000YT-MG for bug-automake@gnu.org; Sat, 29 Sep 2012 13:32:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TI0tg-0001Gp-No for bug-automake@gnu.org; Sat, 29 Sep 2012 13:32:13 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:62485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TI0tg-0001Gd-H7 for bug-automake@gnu.org; Sat, 29 Sep 2012 13:32:12 -0400 Received: by padfa10 with SMTP id fa10so3352554pad.0 for ; Sat, 29 Sep 2012 10:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=+5tZ9z3cCznt9OvrFnkATaSrgjZ3O20YmuSll8Y48M0=; b=t8iYgWaTlr+sxCLcQ9ZczfuDGpalQjYPCnO6GzQazTwyZvSaIp2Qtj5BEdwK+5hPi5 HP1GPuDAfgICW+V7PU8abw5jgvDeRttjAbYfZhp2p4kKHDHaZMU44zS7oXOeOesMVqLb 42BejqTLeDt60haR16+b9kbcQDEYzZR1P5YkjAKIZ2mTj2jczef2v7AXgt0Xa88CiV+N 2pxDyNaHtj6RvRytWT1A5+KtitxAI3D06lh7aPvEwxCNYk/VVKQehT/KfzljjH3tfgtZ JZFUZN0C91KwvyTxhMwm2faeOBdsfr/p85YEBMB/Vw3YUHXvOFzkQoMf/iEdp6YfSz2U 3gtA== MIME-Version: 1.0 Received: by 10.66.89.6 with SMTP id bk6mr25498897pab.81.1348939931405; Sat, 29 Sep 2012 10:32:11 -0700 (PDT) Received: by 10.68.58.136 with HTTP; Sat, 29 Sep 2012 10:32:11 -0700 (PDT) Date: Sat, 29 Sep 2012 19:32:11 +0200 Message-ID: From: Vivien Malerba Content-Type: multipart/alternative; boundary=f46d042fd9326f4eb804cada8d49 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Mailman-Approved-At: Sat, 29 Sep 2012 13:58:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --f46d042fd9326f4eb804cada8d49 Content-Type: text/plain; charset=ISO-8859-1 Hi! I'm working on the Libgda project, which includes Vala source code. I use the Autotools to generate the Makefiles and I've noticed that during the conversion of vala code to C an H code a .stamp file is generated (from what I understand, that timestamped file is then a dependency for all the Vala files' conversion). The Automake's code to make that happen is: foreach my $vala_file (@vala_sources) { my $c_file = $vala_file; if ($c_file =~ s/(.*)\.vala$/$1.c/) { $c_file = "\$(srcdir)/$c_file"; $output_rules .= "$c_file: \$(srcdir)/${derived}_vala.stamp\n" . "\t\@if test -f \$@; then :; else rm -f \$(srcdir)/${derived}_vala.stamp; fi\n" . "\t\@if test -f \$@; then :; else \\\n" . "\t \$(MAKE) \$(AM_MAKEFLAGS) \$(srcdir)/${derived}_vala.stamp; \\\n" . "\tfi\n"; $clean_files{$c_file} = MAINTAINER_CLEAN; } } You can see that the .stamp file is generated in the $(srcdir) directory instead of $(builddir), which breaks the rule when building out of sources. My suggestion is to replace $(srcdir) with $(builddir) (this timestamp file is also a build dependency for each vala file, so there is more code impacted than the snippet above). Best regards, Vivien --f46d042fd9326f4eb804cada8d49 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi!

I'm working on the Libgda project, which includes Vala sourc= e code. I use the Autotools to generate the Makefiles and I've noticed = that during the conversion of vala code to C an H code a .stamp file is gen= erated (from what I understand, that timestamped file is then a dependency = for all the Vala files' conversion). The Automake's code to make th= at happen is:
foreach my $vala_file (@v= ala_sources)
=A0=A0=A0 {
=A0=A0=A0=A0=A0 my $c_file =3D $vala_file;=A0=A0=A0=A0=A0 if ($c_file =3D~ s/(.*)\.vala$/$1.c/)
=A0=A0=A0=A0=A0= =A0=A0 {
=A0=A0=A0=A0=A0=A0=A0=A0=A0 $c_file =3D "\$(srcdir)/$c_fil= e";
=A0=A0=A0=A0=A0=A0=A0=A0=A0 $output_rules .=3D "$c_file: \$(srcdir)/${= derived}_vala.stamp\n"
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 . "\t= \@if test -f \$@; then :; else rm -f \$(srcdir)/${derived}_vala.stamp; fi\n= "
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 . "\t\@if test -f \$@; the= n :; else \\\n"
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 . "\t=A0 \$(MAKE) \$(AM_MAKEFLAGS) \= $(srcdir)/${derived}_vala.stamp; \\\n"
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 . "\tfi\n";
=A0=A0=A0=A0=A0=A0=A0=A0=A0 $clean_files{$c= _file} =3D MAINTAINER_CLEAN;
=A0=A0=A0=A0=A0=A0=A0 }
=A0=A0=A0 }

You can see that the .stamp file is generated in the $(srcdir) directory in= stead of $(builddir), which breaks the rule when building out of sources. M= y suggestion is to replace $(srcdir) with $(builddir) (this timestamp file = is also a build dependency for each vala file, so there is more code impact= ed than the snippet above).

Best regards,

Vivien
--f46d042fd9326f4eb804cada8d49-- From unknown Thu Aug 14 22:22:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12540: Usage of srcdir when valac is generating a header file Resent-From: Nick Bowler Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Mon, 01 Oct 2012 13:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12540 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Vivien Malerba Cc: 12540@debbugs.gnu.org Received: via spool by 12540-submit@debbugs.gnu.org id=B12540.134909893430382 (code B ref 12540); Mon, 01 Oct 2012 13:43:02 +0000 Received: (at 12540) by debbugs.gnu.org; 1 Oct 2012 13:42:14 +0000 Received: from localhost ([127.0.0.1]:35938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIgGE-0007tz-Ew for submit@debbugs.gnu.org; Mon, 01 Oct 2012 09:42:14 -0400 Received: from mx.scalarmail.ca ([98.158.95.75]:15423 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIgGC-0007tr-1S for 12540@debbugs.gnu.org; Mon, 01 Oct 2012 09:42:13 -0400 Received: from unknown (HELO sms-zimbra-mta-02.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 01 Oct 2012 09:41:23 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTP id 4F5CC87BE0; Mon, 1 Oct 2012 09:41:23 -0400 (EDT) Received: from sms-zimbra-mta-02.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-02.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5sfxoD0jwbC7; Mon, 1 Oct 2012 09:41:22 -0400 (EDT) Received: from mail.ellipticsemi.com (mail.elliptictech.com [209.217.122.41]) (Authenticated sender: nbowler@elliptictech.com) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTPSA id 3885287BDE; Mon, 1 Oct 2012 09:41:22 -0400 (EDT) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Mon, 1 Oct 2012 09:41:22 -0400 (EDT) Date: Mon, 1 Oct 2012 09:41:21 -0400 From: Nick Bowler Message-ID: <20121001134121.GA15626@elliptictech.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) On 2012-09-29 19:32 +0200, Vivien Malerba wrote: > I'm working on the Libgda project, which includes Vala source code. I use > the Autotools to generate the Makefiles and I've noticed that during the > conversion of vala code to C an H code a .stamp file is generated (from > what I understand, that timestamped file is then a dependency for all the > Vala files' conversion). The Automake's code to make that happen is: > foreach my $vala_file (@vala_sources) [...] > You can see that the .stamp file is generated in the $(srcdir) directory > instead of $(builddir), which breaks the rule when building out of sources. > My suggestion is to replace $(srcdir) with $(builddir) (this timestamp file > is also a build dependency for each vala file, so there is more code > impacted than the snippet above). Disclaimer: I have never used Vala. I think these generated files are intended to be included in the distribution. Automake takes the approach of putting generated and distributed files in srcdir. The reason for this is that things can get really hairy when generated files are built in builddir, essentially because of the following scenario (for the following, we will say that foo.h is distributed and generated from foo.vala): (1) user unpacks tarball, foo.h is unpacked to srcdir. (2) user does a VPATH build of the package. (3) user edits foo.vala, causing the foo.h in srcdir to be out of date. (4) user does an incremental VPATH build of the package, generating foo.h in the builddir. Now, we have an environment with an up-to-date version of foo.h in the builddir and an out-of-date foo.h in the srcdir. This is not per se a problem, but it is very tricky to get right and a bunch of Automake's built-in behaviours (such as its automatic dependency tracking for C programs) get it wrong. This particular problem can be avoided by putting such generated files in the srcdir, so that distributed versions get overwritten. This is the approach taken by Automake. Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From unknown Thu Aug 14 22:22:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12540: Usage of srcdir when valac is generating a header file Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-automake@gnu.org Resent-Date: Tue, 02 Oct 2012 14:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12540 X-GNU-PR-Package: automake X-GNU-PR-Keywords: To: Nick Bowler Cc: 12540@debbugs.gnu.org, Vivien Malerba Received: via spool by 12540-submit@debbugs.gnu.org id=B12540.134918793117564 (code B ref 12540); Tue, 02 Oct 2012 14:26:01 +0000 Received: (at 12540) by debbugs.gnu.org; 2 Oct 2012 14:25:31 +0000 Received: from localhost ([127.0.0.1]:37845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TJ3Pe-0004ZE-Nk for submit@debbugs.gnu.org; Tue, 02 Oct 2012 10:25:31 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:41248) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TJ3Pc-0004Z7-B2 for 12540@debbugs.gnu.org; Tue, 02 Oct 2012 10:25:29 -0400 Received: by bkcjc3 with SMTP id jc3so5421280bkc.3 for <12540@debbugs.gnu.org>; Tue, 02 Oct 2012 07:24:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=FXOFrRp+X2tVksXKnorquWrXiiIvarCBx5m9yl4OL4s=; b=XblbBtNRbFj/LvJNPHcQNgtpU5+uhjarauCQp00APrixCefsQVc6iPHchKx86MNtHf nc/neUA9FpD9EuoCPAQI9CI8TbCeJB6FfeL/S3pzuPWawOIaUyQ/16PBLF/DupEZc3tJ u6KdDbHrklbfV7rKa6R7sMy6CDCswf1Pu2h1sI+Op9i4BiPdzRUxZOnGWM0xdChIDCVl efJtBD+1s5mfIPAokys+CEZ6phfVDohuf8wc1AOQPYN/+VOmwvW2WFe8y7yFb8h19dI9 VASx8SSrb7QoHFo+TviKX8d8Upi//xiqwCeCaH9ARkDWcmXvug1zxP+IBRbwZPZgiVhW u67A== Received: by 10.204.129.16 with SMTP id m16mr6916699bks.136.1349187894877; Tue, 02 Oct 2012 07:24:54 -0700 (PDT) Received: from [192.168.178.21] (host194-94-dynamic.2-87-r.retail.telecomitalia.it. [87.2.94.194]) by mx.google.com with ESMTPS id gy18sm1400267bkc.4.2012.10.02.07.24.52 (version=SSLv3 cipher=OTHER); Tue, 02 Oct 2012 07:24:53 -0700 (PDT) Message-ID: <506AF928.1040001@gmail.com> Date: Tue, 02 Oct 2012 16:24:40 +0200 From: Stefano Lattarini MIME-Version: 1.0 References: <20121001134121.GA15626@elliptictech.com> In-Reply-To: <20121001134121.GA15626@elliptictech.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) Thanks Nick for chiming in. Your explanation is basically right: Automake ought to place generated-but-distributed files in the source directory rather than in the build directory, for two major reasons: 1. as you've noted, putting such files in builddir could cause inconsistencies in general, and sometimes weird bugs in the automatic dependency tracking; see also a report from Akim: 2. the distributed files should not be modified nor regenerated by a "make all" issued from the builddir of an extracted tarball (otherwise, what is the point of distributing them in the first place?); having such files in the srcdir allows "make distcheck" to catch and report such an inconsistency (because the distcheck runs with the srcdir set to readonly, so that any attempt to modify files in there will lead to a error). Thus I'm closing this ticket as "Won't Fix". Anyone who has doubts, questions or objections is however free (actually encouraged!) to continue the discussion here. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 02 10:26:03 2012 Received: (at control) by debbugs.gnu.org; 2 Oct 2012 14:26:03 +0000 Received: from localhost ([127.0.0.1]:37850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TJ3QA-0004aJ-PC for submit@debbugs.gnu.org; Tue, 02 Oct 2012 10:26:03 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:34936) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TJ3Q8-0004Zp-P9 for control@debbugs.gnu.org; Tue, 02 Oct 2012 10:26:01 -0400 Received: by bkcjc3 with SMTP id jc3so5421708bkc.3 for ; Tue, 02 Oct 2012 07:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=be01RGdvsj7JPcWBCIRwVSy9QT5MM2oOHEVvShU6/20=; b=Kyo33fZD7BM4u4SLzuLSYQNOY/LR+jvxqrjoOYTVQd4gHCglGfuSXYj1jzdqKcYcgB 5N+BmsEsJpqJZJZhR2ayjR+IAYF1YoKpO6zBSY9KuoIHrStPYqo4Q0GoIO3lkQT+ShOd WnEPnvqgPh7nyjuuLlK8DPkoFv5oLq67r5KBK0lsvsMpNMIijVFGjAAVOojEktZfFg/c 4Ir9eqdPmg1XAk6wIE5PnXh6zSeHfFYwf9MJqaml5287KeYvOeogcITVm8H0fsRkLEPv RlemAhmmIQirwZwGsdtPoA3XomXhTZVyZjHieAxAdXVlGOlm18hZuLfHvkE3euNkOCq9 K8Nw== Received: by 10.204.12.215 with SMTP id y23mr6758034bky.13.1349187927626; Tue, 02 Oct 2012 07:25:27 -0700 (PDT) Received: from [192.168.178.21] (host194-94-dynamic.2-87-r.retail.telecomitalia.it. [87.2.94.194]) by mx.google.com with ESMTPS id ia2sm1405726bkc.11.2012.10.02.07.25.24 (version=SSLv3 cipher=OTHER); Tue, 02 Oct 2012 07:25:25 -0700 (PDT) Message-ID: <506AF952.8000701@gmail.com> Date: Tue, 02 Oct 2012 16:25:22 +0200 From: Stefano Lattarini MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: close bug Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) tags 12540 wontfix close 12540 thanks