GNU bug report logs - #31465
Automake 1.16 breaks custom dependency handling

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: automake; Reported by: Sander Niemeijer <sander.niemeijer@HIDDEN>; dated Tue, 15 May 2018 20:39:01 UTC; Maintainer for automake is bug-automake@HIDDEN.

Message received at 31465 <at> debbugs.gnu.org:


Received: (at 31465) by debbugs.gnu.org; 15 May 2018 21:23:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 15 17:23:50 2018
Received: from localhost ([127.0.0.1]:36087 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fIhQE-0004RI-5c
	for submit <at> debbugs.gnu.org; Tue, 15 May 2018 17:23:50 -0400
Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34202 helo=mx1.redhat.com)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eblake@HIDDEN>) id 1fIhQC-0004R3-CU
 for 31465 <at> debbugs.gnu.org; Tue, 15 May 2018 17:23:48 -0400
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com
 [10.11.54.4])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id E3D54406DE36;
 Tue, 15 May 2018 21:23:42 +0000 (UTC)
Received: from [10.10.124.57] (ovpn-124-57.rdu2.redhat.com [10.10.124.57])
 by smtp.corp.redhat.com (Postfix) with ESMTP id 86CBF2026DFD;
 Tue, 15 May 2018 21:23:42 +0000 (UTC)
Subject: Re: bug#31465: Automake 1.16 breaks custom dependency handling
To: Sander Niemeijer <sander.niemeijer@HIDDEN>, 31465 <at> debbugs.gnu.org
References: <EC5CFB32-9EE3-4AF8-8B5E-CF1E3B020833@HIDDEN>
From: Eric Blake <eblake@HIDDEN>
Organization: Red Hat, Inc.
Message-ID: <5011c796-1c75-2bcb-49c8-bdaf1ce43f63@HIDDEN>
Date: Tue, 15 May 2018 16:23:42 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <EC5CFB32-9EE3-4AF8-8B5E-CF1E3B020833@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.11.55.7]); Tue, 15 May 2018 21:23:42 +0000 (UTC)
X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]);
 Tue, 15 May 2018 21:23:42 +0000 (UTC) for IP:'10.11.54.4'
 DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com'
 HELO:'smtp.corp.redhat.com' FROM:'eblake@HIDDEN' RCPT:''
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 31465
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 05/15/2018 11:56 AM, Sander Niemeijer wrote:
> I have a software package that uses SWIG to dynamically generates .c files.
> With automake 1.15 and earlier I was able to add my own dependency rules for this by adding some custom entries to the Makefile.am.
> 
> A small reduced example of the approach I am using:
> 
> @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/foo.Pc@am__quote@
> 
> foo.c: $(srcdir)/foo.i
> @AMDEP_TRUE@	source='$(srcdir)/foo.i' object='foo.c' libtool=no @AMDEPBACKSLASH@
> @AMDEP_TRUE@	depfile='$(DEPDIR)/foo.Pc' tmpdepfile='$(DEPDIR)/foo.TPc' @AMDEPBACKSLASH@
> @AMDEP_TRUE@	depmode='none' $(depcomp) @AMDEPBACKSLASH@
> @AMDEP_TRUE@	$(SWIG) $(SWIGFLAGS) -M $(srcdir)/foo.i > $(DEPDIR)/foo.Pc
> 	$(SWIG) $(SWIGFLAGS) -o foo.c $(srcdir)/foo.i

Are you actually writing ALL of that in your Makefile.am?  Don't. You're 
abusing automake's internals, and when automake changes how its 
internals work, things fall apart fast.  You should only use documented 
entries into automake; any use of @AMDEP_TRUE@, @am__include@, 
@am__quote@, @AMDEPBACKSLASH@, and $(DEPDIR) falls in the realm of using 
undocumented internals.

Also, the fact that you are calling $(SWIG) two separate times per file 
may defeat the purpose of fast dependency tracking, which says that 
dependencies should be computed as a side-effect of the compilation, 
rather than as a second run of a tool.

The automake manual mentions that you can instead use the hammer of 
declaring foo.c as part of BUILT_SOURCES (so that it is guaranteed to be 
built before dependency rules kick in), or to list manual additional 
dependencies as needed, as in:

foo.$(OBJEXT): $(srcdir)/foo.i
foo.c: $(srcdir)/foo.i
	$(SWIG) $(SWIGFLAGS) -o foo.c $(srcdir)/foo.i


> I have been able to work around this by overriding am--depfiles to:
> 
> am--depfiles: $(am__depfiles_remade) $(local_depfiles)

No, that's still mucking around with automake's internals, and a bad idea.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




Information forwarded to bug-automake@HIDDEN:
bug#31465; Package automake. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 May 2018 20:38:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 15 16:38:23 2018
Received: from localhost ([127.0.0.1]:36055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1fIgiF-0003MM-2x
	for submit <at> debbugs.gnu.org; Tue, 15 May 2018 16:38:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55727)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sander.niemeijer@HIDDEN>) id 1fIdqA-0007aP-AO
 for submit <at> debbugs.gnu.org; Tue, 15 May 2018 13:34:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <sander.niemeijer@HIDDEN>) id 1fIdq4-0006Iw-Cr
 for submit <at> debbugs.gnu.org; Tue, 15 May 2018 13:34:17 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: ***
X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,
 RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39520)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <sander.niemeijer@HIDDEN>)
 id 1fIdq4-0006Iq-9K
 for submit <at> debbugs.gnu.org; Tue, 15 May 2018 13:34:16 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46678)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <sander.niemeijer@HIDDEN>) id 1fIdq2-0001It-W2
 for bug-automake@HIDDEN; Tue, 15 May 2018 13:34:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <sander.niemeijer@HIDDEN>) id 1fIdpz-0006H3-17
 for bug-automake@HIDDEN; Tue, 15 May 2018 13:34:14 -0400
Received: from relay10.prolocation.net ([2a00:d00:ff:133:94:228:133:100]:53903)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <sander.niemeijer@HIDDEN>)
 id 1fIdpy-0006F6-RV
 for bug-automake@HIDDEN; Tue, 15 May 2018 13:34:10 -0400
Received: from cust-178-250-146-250.breedbanddelft.nl ([178.250.146.250]
 helo=themisto.stcorp.nl) by relay10.prolocation.net with esmtpsa
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1)
 (envelope-from <sander.niemeijer@HIDDEN>) id 1fIdG1-0006nK-PA
 for bug-automake@HIDDEN; Tue, 15 May 2018 18:57:01 +0200
From: Sander Niemeijer <sander.niemeijer@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\))
Subject: Automake 1.16 breaks custom dependency handling
Message-Id: <EC5CFB32-9EE3-4AF8-8B5E-CF1E3B020833@HIDDEN>
Date: Tue, 15 May 2018 18:56:56 +0200
To: bug-automake@HIDDEN
X-Mailer: Apple Mail (2.3445.6.18)
X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 15 May 2018 16:38:21 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

I have a software package that uses SWIG to dynamically generates .c =
files.
With automake 1.15 and earlier I was able to add my own dependency rules =
for this by adding some custom entries to the Makefile.am.

A small reduced example of the approach I am using:

@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/foo.Pc@am__quote@

foo.c: $(srcdir)/foo.i
@AMDEP_TRUE@	source=3D'$(srcdir)/foo.i' object=3D'foo.c' libtool=3Dno =
@AMDEPBACKSLASH@
@AMDEP_TRUE@	depfile=3D'$(DEPDIR)/foo.Pc' =
tmpdepfile=3D'$(DEPDIR)/foo.TPc' @AMDEPBACKSLASH@
@AMDEP_TRUE@	depmode=3D'none' $(depcomp) @AMDEPBACKSLASH@
@AMDEP_TRUE@	$(SWIG) $(SWIGFLAGS) -M $(srcdir)/foo.i > =
$(DEPDIR)/foo.Pc
	$(SWIG) $(SWIGFLAGS) -o foo.c $(srcdir)/foo.i


This approach worked fine with previous (15.x and earlier) automake =
versions, but with the latest release (I tested with 1.16.1) this no =
longer works.

The 'Something went wrong bootstrapping makefile fragments' problem that =
was raised by the configure script was easily solved by adding an '# =
am--include-marker' to the include statement.

But after that, a call to 'make' will complain about '.deps/foo.Pc: No =
such file or directory'.

The problem here is that the dependency file $(DEPDIR)/foo.Pc no longer =
gets generated by configure (or config.status).

I have been able to work around this by overriding am--depfiles to:

am--depfiles: $(am__depfiles_remade) $(local_depfiles)

And then generate the foo.Pc file as part of the $(local_depfiles) =
target (using some additional custom rules).

This seems to work nicely, except that automake still keeps giving me =
warnings about am--depfiles being overridden, which I would like to get =
rid off.

The question is thus whether it would be possible to add some hook into =
automake to have am--depfiles depend on some additional (optional) =
target (that can then be used by the Makefile.am author to generate =
custom dependency files).
Something in the spirit of the extension mechanism that is already =
available for e.g. the *-hook and *-local targets.

For instance, allowing an optional am--depfiles-local target that, if it =
exists in the Makefile.am, will be added as dependency to am--depfiles:

am--depfiles: $(am__depfiles_remade) am--depfiles-local

which will then allow me to use:

am--depfiles-local: $(local_depfiles)

Best regards,
Sander Niemeijer





Acknowledgement sent to Sander Niemeijer <sander.niemeijer@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to bug-automake@HIDDEN:
bug#31465; Package automake. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.