From unknown Fri Jun 20 07:13:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13760 <13760@debbugs.gnu.org> To: bug#13760 <13760@debbugs.gnu.org> Subject: Status: am__make_dryrun fails to handle GNU make -I option Reply-To: bug#13760 <13760@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:13:04 +0000 retitle 13760 am__make_dryrun fails to handle GNU make -I option reassign 13760 automake submitter 13760 Boris Kolpackov severity 13760 normal tag 13760 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 19 11:53:49 2013 Received: (at submit) by debbugs.gnu.org; 19 Feb 2013 16:53:49 +0000 Received: from localhost ([127.0.0.1]:37138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7qRw-0007br-Et for submit@debbugs.gnu.org; Tue, 19 Feb 2013 11:53:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56827) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7kYT-00050Q-55 for submit@debbugs.gnu.org; Tue, 19 Feb 2013 05:36:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7kXG-0006rP-R7 for submit@debbugs.gnu.org; Tue, 19 Feb 2013 05:35:04 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:47016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7kXG-0006rK-N6 for submit@debbugs.gnu.org; Tue, 19 Feb 2013 05:34:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7kX9-0003GT-66 for bug-automake@gnu.org; Tue, 19 Feb 2013 05:34:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7kX1-0006lG-6E for bug-automake@gnu.org; Tue, 19 Feb 2013 05:34:47 -0500 Received: from codesynthesis.com ([70.85.31.65]:59234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7kX0-0006jg-TJ for bug-automake@gnu.org; Tue, 19 Feb 2013 05:34:39 -0500 Received: from onega.codesynthesis.com (41-134-166-218.dsl.mweb.co.za [41.134.166.218]) (authenticated bits=0) by codesynthesis.com (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id r1JAYSYc003039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 19 Feb 2013 05:34:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codesynthesis.com; s=default; t=1361270072; bh=nsZOckV2eTvBNmD71+eJso6C94hHGh4JgGdsvafsqm4=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=Tfz0BExws85hgQVGX7XpkMtICS4H8/dKuTVicMC8oTFjmHbaLP0kLsQaKTGD4faj8 15GGX8ayF8vy8cFNHUxG+5nW9hUQ0UyVDqKQ7HjriXaprIwgnoN3M51TR9D6Ce+cQo V9S6wDs2IzuUSAikCJHLmGPL/b2Q+XBnNmGTZYsk= Received: from onega.codesynthesis.com (localhost [127.0.0.1]) by onega.codesynthesis.com (8.14.3/8.14.3/Debian-9) with ESMTP id r1JAYQvk007864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 19 Feb 2013 12:34:27 +0200 Received: (from boris@localhost) by onega.codesynthesis.com (8.14.3/8.14.3/Submit) id r1JAYQFi007861; Tue, 19 Feb 2013 12:34:26 +0200 Date: Tue, 19 Feb 2013 12:34:26 +0200 From: Boris Kolpackov To: bug-automake@gnu.org Subject: am__make_dryrun fails to handle GNU make -I option Message-ID: <20130219103426.GA6438@onega.codesynthesis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: Code Synthesis Tools CC User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 19 Feb 2013 11:53:47 -0500 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: -3.5 (---) Hi, After upgrading from 1.11.1 to 1.11.6 or 1.12.6, or 1.13.1 my project's dist target stopped working. After some debugging, the culprit turned out to be am__make_dryrun function that mis-detects make dry-run mode (make -n) if make flags contain a -I option with a path containing character 'n'. In my case, flags come from the MAKEFLAGS environment variable which has the following value: -I ~/work/build -I/opt/qnx632/target/qnx6/usr/include The MAKEFLAGS value as passed to the shell by make then becomes (note the missing '-' in the first option -- that's documented GNU make behavior): "I /home/boris/work/build -I /opt/qnx632/target/qnx6/usr/include" am__make_dryrun then goes ahead and check each word in this list for the presence of 'n' and finds it in the path. I've had some dealings with GNU make's MAKEFLAGS and the semantics is quite convoluted. GNU make doesn't just store flags the way they appeared on the command line. Instead, it translates, combines, and rearranges them in a certain way. For example, GNU make will combine certain one-letter options (including -n) and place them at the front of MAKEFLAGS without the preceding '-'. For example: make -n -k -j 2 foo=bar => "nk --jobserver-fds=3,4 -j -- foo=bar" Generally, in GNU make, the -n option (or its aliases) will always be translated and come in the first word of MAKEFLAGS. And the first word in MAKEFLAGS is always one of the following: 1. Empty. If no "old" options (those that are combined in the first word) were specified but a new option was, then GNU make will add a leading space to the MAKEFLAGS, for example: make -j 2 => " --jobserver-fds=3,4 -j" 2. The "old" options combination (including -n), one letter per option, for example: make -n -k -j 2 => "nk --jobserver-fds=3,4 -j" 3. Command line variable assignment. If no options were specified ("old" or "new") but a variable assignment was specified, then the first word will be the variable assignment, for example (note that there is no leading space as in (2)): make foo=bar => "foo=bar" So, based on this knowledge, for GNU make, all we need to do is examine the first word in MAKEFLAGS. If it contains '=', then it is a variable assignment, otherwise, we search for the 'n' character. The complication is that we have to also support other makes (BSD, Solaris). I have no idea about their MAKEFLAGS behavior. Boris From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 20 08:09:25 2013 Received: (at 13760) by debbugs.gnu.org; 20 Feb 2013 13:09:25 +0000 Received: from localhost ([127.0.0.1]:38891 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89QI-0006bB-EG for submit@debbugs.gnu.org; Wed, 20 Feb 2013 08:09:25 -0500 Received: from mail-ea0-f173.google.com ([209.85.215.173]:45529) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89QG-0006b2-Bt for 13760@debbugs.gnu.org; Wed, 20 Feb 2013 08:09:21 -0500 Received: by mail-ea0-f173.google.com with SMTP id i1so3340589eaa.32 for <13760@debbugs.gnu.org>; Wed, 20 Feb 2013 05:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ClkgblM+v6NYX0mrDVOJtL84WZq9kzfiUTlQ7WpWlOo=; b=QXrKIY324MDflPLv5vKJscW8Je/aed6VAGwQwLuyBGPrnbKzfDs90Tg1cnEWwkBdKc aZf8L1MExz+niGSGZMviwf6p5VdzdjUvUs2rNSJIw62hv1Ztevip9337WjmF0ap2FAYK 4jqPn3HkqWUWswGI9S1Xq1sDDb4xu0HfK5PCqv/14Wco3yV1rBiOaw/9cEgz81/lZgW4 7vMzv7a3ncGP9As7osGdG/T453/+aR0N8XCoFurzxmHTs86x0qtDJSIfhsyaralQxpPd UuuEMY19MC7j1RNqnloNScy2hPLWbt1Osx4e1x7iTMgpQcEYH/GpJC4hhCVNr4dckmPt NvuA== X-Received: by 10.14.179.5 with SMTP id g5mr69029020eem.41.1361365688824; Wed, 20 Feb 2013 05:08:08 -0800 (PST) Received: from localhost.localdomain (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id q5sm109315328eeo.17.2013.02.20.05.08.06 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 05:08:07 -0800 (PST) From: Stefano Lattarini To: 13760@debbugs.gnu.org Subject: [PATCH 0/2] am__make_dryrun fails to handle GNU make -I option Date: Wed, 20 Feb 2013 14:07:51 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.1.754.gb3600c3 In-Reply-To: <20130219103426.GA6438@onega.codesynthesis.com> References: <20130219103426.GA6438@onega.codesynthesis.com> X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13760 Cc: boris@codesynthesis.com, automake-patches@gnu.org 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: -2.6 (--) Reference: On 02/19/2013 11:34 AM, Boris Kolpackov wrote: > Hi, > Hi Boris, thanks for the clear and detailed report. > After upgrading from 1.11.1 to 1.11.6 or 1.12.6, or 1.13.1 my > project's dist target stopped working. After some debugging, > the culprit turned out to be am__make_dryrun function that > mis-detects make dry-run mode (make -n) if make flags contain > a -I option with a path containing character 'n'. > For the moment, I have exposed the bug you have reported in the testsuite (see the two upcoming patches). This issue shouldn't be too difficult too fix; I hope I'll be able to cook something in the next days, in time for the next beta for 1.13.2. > So, based on this knowledge, for GNU make, all we need to do is > examine the first word in MAKEFLAGS. If it contains '=', then it > is a variable assignment, otherwise, we search for the 'n' character. > This might be OK for GNU make: $ gmake -ki -I none -k -f- <<<'all:;@echo "$$MAKEFLAGS"' kI none -i but not, e.g., for the FreeBSD and NetBSD make: $ bsd-make -ki -I none -k -f- <<<'all:;@echo "$$MAKEFLAGS"' -k -i -I none -k nor for Solaris CCS make (note that this doesn't even support thr -I option, though): $ /usr/ccs/bin/make -ki -k -f - <<<'all:;@echo "$$MAKEFLAGS"' -ik > The complication is that we have to also support other makes (BSD, > Solaris). I have no idea about their MAKEFLAGS behavior. > I have only a patchy knowledge too, but combining that with some experimenting might be enough to find a fix > Boris > Thanks, Stefano -*-*-*- Stefano Lattarini (2): tests: refactor/enhance tests about make dry-run mode coverage: expose automake bug#13760 t/make-dryrun.tap | 123 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 51 deletions(-) -- 1.8.1.1.754.gb3600c3 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 20 08:09:35 2013 Received: (at 13760) by debbugs.gnu.org; 20 Feb 2013 13:09:35 +0000 Received: from localhost ([127.0.0.1]:38896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89QV-0006bk-47 for submit@debbugs.gnu.org; Wed, 20 Feb 2013 08:09:35 -0500 Received: from mail-ea0-f178.google.com ([209.85.215.178]:56918) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89QM-0006bH-2D for 13760@debbugs.gnu.org; Wed, 20 Feb 2013 08:09:31 -0500 Received: by mail-ea0-f178.google.com with SMTP id a14so3398485eaa.9 for <13760@debbugs.gnu.org>; Wed, 20 Feb 2013 05:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=mXGelHxpO8F6Ili2Y6aSSzGyxCK7IN++wxw8ka/ykP4=; b=atE/SFfKz+69lpuTcVNLDQC7c9YEvLSJzi6Tu8oPgQTHcsOGlashdR7seVMAT5hibE CpI/h7cpr21fmKtZPgFeHVZOkBcQwFILHvk9AdkGJDiRCTDxSileMH6+vTC4D20hOD0X fNJPH1vp4/IVgJQx+zI+jpLMLLPlVxWTxB5ouFtfWOzqbsfAkBp/xK8iG1Dzh8FeK6rr jZiBRKhUoG+JeEqhMPG2Trxd42UGwEmDRHD+lNpx6I2MROV00/aA3GHGCtSyQ3MdoV0R gJPs9iH+S4onavc1EqV+TNPw1Dpk1ACcOByqA96neNgi5nF3x3oIG72xZSc2BMyhvaA8 spKg== X-Received: by 10.14.219.7 with SMTP id l7mr45125290eep.12.1361365692957; Wed, 20 Feb 2013 05:08:12 -0800 (PST) Received: from localhost.localdomain (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id q5sm109315328eeo.17.2013.02.20.05.08.11 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 05:08:12 -0800 (PST) From: Stefano Lattarini To: 13760@debbugs.gnu.org Subject: [PATCH 2/2] coverage: expose automake bug#13760 Date: Wed, 20 Feb 2013 14:07:53 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.1.754.gb3600c3 In-Reply-To: References: <20130219103426.GA6438@onega.codesynthesis.com> In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13760 Cc: boris@codesynthesis.com, automake-patches@gnu.org 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: -2.6 (--) * t/make-dryrun.tap: Here. * THANKS: Update with the name of the bug reporter. Signed-off-by: Stefano Lattarini --- t/make-dryrun.tap | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap index 4aa7146..1459a9f 100755 --- a/t/make-dryrun.tap +++ b/t/make-dryrun.tap @@ -18,7 +18,7 @@ . test-init.sh -plan_ 14 +plan_ 18 if echo "all: ; +@printf %sbb%s aa cc" | $MAKE -n -f - | grep aabbcc; then make_plus_silence () { return 0; } @@ -26,6 +26,13 @@ else make_plus_silence () { return 1; } fi +mkdir none +if echo nil: | $MAKE -I none -f -; then + make_supports_option_I () { return 0; } +else + make_supports_option_I () { return 1; } +fi + echo AC_OUTPUT >> configure.ac cat > Makefile.am <<'END' @@ -100,6 +107,25 @@ check_make --dry -C using_gmake "\$MAKE is not GNU make" --dry-run -k # ---------------------------------------------------------------------- +# Automake bug#13760: the "n" in "none" used to confound am__make_dryrun +# into thinking the '-n' option had been passed. + +pr='bug#13760' + +check_make --run -X -C make_supports_option_I "-I make option unsupported" \ + -M "$pr" -I none + +check_make --run -X -C using_gmake "\$MAKE is not GNU make" \ + -M "$pr" -I none --include dry-run + +check_make --dry -C make_supports_option_I "-I make option unsupported" \ + -M "$pr" -I none -n + +check_make --dry -C using_gmake "\$MAKE is not GNU make" \ + -M "$pr" --dry-run -I none --include dry-run + +# ---------------------------------------------------------------------- + # Test for when shell metacharacters or backslashes are in $(MAKEFLAGS). check_metachars () -- 1.8.1.1.754.gb3600c3 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 20 08:09:37 2013 Received: (at 13760) by debbugs.gnu.org; 20 Feb 2013 13:09:37 +0000 Received: from localhost ([127.0.0.1]:38898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89QV-0006bn-Ol for submit@debbugs.gnu.org; Wed, 20 Feb 2013 08:09:36 -0500 Received: from mail-ea0-f177.google.com ([209.85.215.177]:53742) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89QI-0006bA-QE for 13760@debbugs.gnu.org; Wed, 20 Feb 2013 08:09:28 -0500 Received: by mail-ea0-f177.google.com with SMTP id n13so3326981eaa.36 for <13760@debbugs.gnu.org>; Wed, 20 Feb 2013 05:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=xnn2U9SJA0/+VBh5rV1INl7XHKIPvo0KV6ib32xn9WI=; b=AqKqqdhcXh8o3oL/enNLhtngXHZQGrlsRU4r78EJxA7fPS8a1NXsyDGLZNnVaXkgYa N1f7ctucQ5UQhPg/DcijUcy/YVswZbo0O94OunBf8EBAMmhw486Mc8zAo3IgcCOxFi0h soUogUzhu68TXaqCP188aIJcgoOkevP5xWBKktCdFVXOzWU72fEYBnTljY/+ZSK2A/XH hSX2JvhNtTdmxI7qIyzdp7fZ4+eAwXJhZCXoe4uzke6idW8HhD+Ic13n4N+yGuBWVeUb UJKO6IrnYVjW48pnQc1VboIhzqMPglfMZW5SNS8rKA9ZvGCQFEvkJNUj9BhC+2kgd3mA 16bQ== X-Received: by 10.14.204.195 with SMTP id h43mr69172345eeo.14.1361365691123; Wed, 20 Feb 2013 05:08:11 -0800 (PST) Received: from localhost.localdomain (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id q5sm109315328eeo.17.2013.02.20.05.08.09 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 05:08:10 -0800 (PST) From: Stefano Lattarini To: 13760@debbugs.gnu.org Subject: [PATCH 1/2] tests: refactor/enhance tests about make dry-run mode Date: Wed, 20 Feb 2013 14:07:52 +0100 Message-Id: <436d6f6f75f08f77f26f857c9b883d64c5061898.1361365428.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.8.1.1.754.gb3600c3 In-Reply-To: References: <20130219103426.GA6438@onega.codesynthesis.com> In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13760 Cc: boris@codesynthesis.com, automake-patches@gnu.org 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: -2.6 (--) * t/make-dryrun.tap: Here. Signed-off-by: Stefano Lattarini --- t/make-dryrun.tap | 99 ++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 52 deletions(-) diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap index 14d379a..4aa7146 100755 --- a/t/make-dryrun.tap +++ b/t/make-dryrun.tap @@ -20,14 +20,12 @@ plan_ 14 -if echo "all: ; @+printf %sbb%s aa cc" | $MAKE -n -f - | grep aabbcc; then +if echo "all: ; +@printf %sbb%s aa cc" | $MAKE -n -f - | grep aabbcc; then make_plus_silence () { return 0; } else make_plus_silence () { return 1; } fi -mkdir sub - echo AC_OUTPUT >> configure.ac cat > Makefile.am <<'END' @@ -35,14 +33,48 @@ all: : Dummy, nothing to do. foo: $(MAKE) all -notdry: +run: @echo ":: $$MAKEFLAGS ::"; : For debugging. - $(am__make_dryrun) && exit 1; exit 0 + $(am__make_dryrun) && exit 1; echo ok > from-run dry: +@echo ":: $$MAKEFLAGS ::"; : For debugging. - +$(am__make_dryrun) || exit 1; echo ok > from-dry-mode + +$(am__make_dryrun) || exit 1; echo ok > from-dry END +check_make () +{ + r=ok msg= mode= condition=: directive= reason= skip_reason= + case $1 in + --dry) mode=dry;; + --run) mode=run;; + *) fatal_ "check_run: invalid usage";; + esac + shift + while test $# -gt 0; do + case $1 in + -C) condition=$2 skip_reason=$3; shift; shift;; + -M) msg=$2; shift;; + -X) directive=TODO;; + --) shift; break;; + *) break;; + esac + shift + done + msg=${mode}${msg:+" [$msg]"} + if $condition; then + $MAKE "$mode" ${1+"$@"} || r='not ok' + test -f from-$mode || r='not ok' + test ! -e bad || r='not ok' + rm -f bad from-* || fatal_ "cleaning up" + else + directive=SKIP reason=$skip_reason + fi + result_ "$r" -D "$directive" -r "$reason" "$msg" + unset r msg mode condition directive reason skip_reason +} + +# ---------------------------------------------------------------------- + $ACLOCAL || fatal_ "aclocal failed" $AUTOCONF || fatal_ "autoconf failed" $AUTOMAKE || fatal_ "automake failed" @@ -50,48 +82,21 @@ $AUTOMAKE || fatal_ "automake failed" # ---------------------------------------------------------------------- -check_no_dryrun () -{ - command_ok_ "dry-run ($cnt)" $MAKE notdry ${1+"$@"} - cnt=$(($cnt + 1)) -} -cnt=1 - -check_no_dryrun +check_make --run # Test against a known regression. This was especially heinous, since # make running in normal mode was sometimes mistaken for make running # in dry mode. -check_no_dryrun TESTS="n1.test n2.test" -check_no_dryrun TESTS="n1 n2" AM_MAKEFLAGS="TESTS='n1 n2'" -check_no_dryrun TESTS="n1 n2" AM_MAKEFLAGS='TESTS="n1 n2"' -check_no_dryrun FOOFLAGS="-n -n -knf2 n --none -n" -check_no_dryrun MYFLAGS="-n --dryrun -n --dry-run -n" +check_make --run TESTS="n1.test n2.test" +check_make --run TESTS="n1 n2" AM_MAKEFLAGS="TESTS='n1 n2'" +check_make --run TESTS="n1 n2" AM_MAKEFLAGS='TESTS="n1 n2"' +check_make --run FOOFLAGS="-n -n -knf2 n --none -n" +check_make --run MYFLAGS="-n --dryrun -n --dry-run -n" # ---------------------------------------------------------------------- -check_dryrun () -{ - r=ok directive= - case $1 in - -C) condition=$2 reason=$3; shift; shift; shift;; - *) condition=: reason=;; - esac - if $condition; then - $MAKE dry ${1+"$@"} || r='not ok' - test -f from-dry-mode || r='not ok' - rm -f from-dry-mode || fatal_ "cleaning up" - else - directive=SKIP - fi - result_ "$r" -D "$directive" -r "$reason" "not dry-run ($cnt)" - unset r directive reason - cnt=$(($cnt + 1)) -} -cnt=1 - -check_dryrun -C make_plus_silence 'recipe prefix "+" unsupported' -n -check_dryrun -C using_gmake "\$MAKE is not GNU make" --dry-run -k +check_make --dry -C make_plus_silence 'recipe prefix "+" unsupported' -n +check_make --dry -C using_gmake "\$MAKE is not GNU make" --dry-run -k # ---------------------------------------------------------------------- @@ -99,18 +104,8 @@ check_dryrun -C using_gmake "\$MAKE is not GNU make" --dry-run -k check_metachars () { - r=ok - $MAKE notdry ${1+"$@"} || r='not ok' - if test -f bad; then - r='not ok' - else - rm -f bad || fatal_ "cleaning up" - fi - result_ "$r" "dry-run, with shell metachars ($cnt)" - unset r - cnt=$(($cnt + 1)) + check_make --run -M "metachars" "$@" } -cnt=1 check_metachars MYFLAGS="-n \"n\" '-n' --none -n" check_metachars MYFLAGS='-knf2\ n\ \\n' -- 1.8.1.1.754.gb3600c3 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 20 08:17:29 2013 Received: (at 13760) by debbugs.gnu.org; 20 Feb 2013 13:17:29 +0000 Received: from localhost ([127.0.0.1]:38937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89Y8-0006oC-Qm for submit@debbugs.gnu.org; Wed, 20 Feb 2013 08:17:29 -0500 Received: from mail-ee0-f47.google.com ([74.125.83.47]:55758) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89Y7-0006o6-JL for 13760@debbugs.gnu.org; Wed, 20 Feb 2013 08:17:28 -0500 Received: by mail-ee0-f47.google.com with SMTP id e52so4037266eek.34 for <13760@debbugs.gnu.org>; Wed, 20 Feb 2013 05:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=vYMYXAUJDrUO+r5wjaYGMjKvtCa8qhCYOFFVlff/Omk=; b=DDou/P6pLE24sQQgI7WcvW+HjUEnWQkQejRnF8laSbZMLJotsaJOah1hFyqATefEwc npmUAs5bx1DWffEVn7wTRmSAkn7iwWK/hCh3buaQfScTIteVcu9MvUE215E+fqEZf1UP CRrK7SQA9co14LucA/e4WDLBlNXQzOoNb2igHG0nNT5KvnS0f1LL8IjSGAIMVB5Hv3uk svJzdn8T+EV4TUHMDrpmnxF/Y0DR8xsOauY8B/eQrYyz7c6cdaNudvSIBMWe9dKnhVTP yd+gIentJmeupM2SAKFIoRmBU+P5lfD/qO65zaciEV6MT/Wl39XvIMyzGrWsESWe1RmT 3QwA== X-Received: by 10.14.173.67 with SMTP id u43mr69233674eel.22.1361366175924; Wed, 20 Feb 2013 05:16:15 -0800 (PST) Received: from [192.168.178.20] (host137-94-dynamic.4-87-r.retail.telecomitalia.it. [87.4.94.137]) by mx.google.com with ESMTPS id a1sm84000690eep.2.2013.02.20.05.16.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Feb 2013 05:16:15 -0800 (PST) Message-ID: <5124CC9D.20905@gmail.com> Date: Wed, 20 Feb 2013 14:16:13 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: 13760@debbugs.gnu.org Subject: Re: [PATCH 0/2] am__make_dryrun fails to handle GNU make -I option References: <20130219103426.GA6438@onega.codesynthesis.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13760 Cc: boris@codesynthesis.com, automake-patches@gnu.org 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: -1.2 (-) On 02/20/2013 02:07 PM, Stefano Lattarini wrote: > Reference: > > [SNIP] > > I have only a patchy knowledge too, but combining that with some > experimenting might be enough to find a fix > ESENTTOOEARLY, sorry. Here is the complete paragraph I intended to send: I too have only a patchy knowledge of them, but combining that with some experimenting might be enough to find a fix for this bug. And of course, if you want to attempt a fix yourself in the meantime, be my guest ;-) Sorry for the noise, Stefano From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 20 08:46:20 2013 Received: (at 13760) by debbugs.gnu.org; 20 Feb 2013 13:46:21 +0000 Received: from localhost ([127.0.0.1]:38994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89zz-0007V3-Pw for submit@debbugs.gnu.org; Wed, 20 Feb 2013 08:46:20 -0500 Received: from codesynthesis.com ([70.85.31.65]:48582) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U89zv-0007Ur-Ft for 13760@debbugs.gnu.org; Wed, 20 Feb 2013 08:46:12 -0500 Received: from onega.codesynthesis.com (41-134-166-218.dsl.mweb.co.za [41.134.166.218]) (authenticated bits=0) by codesynthesis.com (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id r1KDit0m028876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 20 Feb 2013 08:44:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codesynthesis.com; s=default; t=1361367899; bh=DtbuXrtt1+zJfR0xkckMUpsXtVmsfo00dQKdFaScZhg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=ED97bN8g7vghkJra+wcb2Qs5fzw5KlAxAqCK7CeS7d/7cQM6U4WXwFv+9562G9oMH THjMjLolOachW2dzJkyG2AJmq08XArDUo+zEpDvLLwOY8aYQbhPOZCzhFX53bj71mJ DPWO1tv7jPiRjZ2k6SEtROsgywQ/L0wxjm7buMsw= Received: from onega.codesynthesis.com (localhost [127.0.0.1]) by onega.codesynthesis.com (8.14.3/8.14.3/Debian-9) with ESMTP id r1KDirBj004856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 20 Feb 2013 15:44:53 +0200 Received: (from boris@localhost) by onega.codesynthesis.com (8.14.3/8.14.3/Submit) id r1KDiqBe004853; Wed, 20 Feb 2013 15:44:52 +0200 Date: Wed, 20 Feb 2013 15:44:52 +0200 From: Boris Kolpackov To: 13760@debbugs.gnu.org Subject: Re: [PATCH 0/2] am__make_dryrun fails to handle GNU make -I option Message-ID: References: <20130219103426.GA6438@onega.codesynthesis.com> <5124CC9D.20905@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5124CC9D.20905@gmail.com> Organization: Code Synthesis Tools CC User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 13760 Cc: Stefano Lattarini , automake-patches@gnu.org 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.2 (/) Stefano Lattarini writes: > And of course, if you want to attempt a fix yourself in the meantime, > be my guest ;-) I was thinking of coming up with a fix. My problem is I can only do it for GNU make; I don't know anything (and, to be honest, don't care) about other flavors of make which the code has to support. I think the clean way to fix this would be to detect somehow if we are using GNU make and then have different tests for GNU make and other makes. I looked around for any GNU make indication but didn't see anything obvious (maybe the fact that in GNU make the first word can never have '-'). I think if we try to support all make flavors in a combined test, things will get messy (my other idea was to resort to executing make if MAKEFLAGS contains more than one word). Seeing that the majority is probably using GNU make and we can do a really fast test for it, it would be bad to resort to some pessimistic tests (like running make) just so that we can support other makes. Just my thoughts. Boris From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 05:18:04 2013 Received: (at 13760) by debbugs.gnu.org; 23 Apr 2013 09:18:04 +0000 Received: from localhost ([127.0.0.1]:38337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMQ-0004I1-80 for submit@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:03 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:34738) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMO-0004Hd-CB for 13760@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:01 -0400 Received: by mail-wi0-f175.google.com with SMTP id h11so5757752wiv.14 for <13760@debbugs.gnu.org>; Tue, 23 Apr 2013 02:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=WU2xIpc8TniML4mIYYwkjWmhKOJIVsKek0KQc2kcgV0=; b=hZjcN/sDd29i5IFdcyOW0EwZe/Ob4eZdHSi8cqfVx6qIDBlGQvNH06h3RBlHiwzRKZ gARAVzOHNKV+vr+LAX53BPrLn9hIA10sEAact9vedXWoSUwdZPHdfXLzctEaMaJS4S3s R/mR5dBHfRbhR6CRNBXdKoq12WEz7e9BnMaL2PHle1Qouv+SGXp05KcU/qTUiwASQi6U 8TDXOl5RNKjARC5OmcOlGkaO6tLUiHlflu+Zb+HoogySLSF6Gqomu+1N/GmhPv52/pVj oRtZB1ZPLuz4rdmdf7vpmphpkvxxJeCvheGu+LH6NUNx0BjvlY4YS4egd/w0OXiTJko5 I7YQ== X-Received: by 10.180.85.103 with SMTP id g7mr72968705wiz.23.1366708383689; Tue, 23 Apr 2013 02:13:03 -0700 (PDT) Received: from localhost.localdomain (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPSA id t14sm25700080wib.0.2013.04.23.02.13.01 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 02:13:02 -0700 (PDT) From: Stefano Lattarini To: boris@codesynthesis.com Subject: [PATCH 0/3] dry-run: don't get confused by '-I' option Date: Tue, 23 Apr 2013 11:12:45 +0200 Message-Id: X-Mailer: git-send-email 1.8.2.1.389.gcaa7d79 In-Reply-To: References: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13760 Cc: 13760@debbugs.gnu.org, automake-patches@gnu.org 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: -2.6 (--) Reference: Hello, and sorry for the shameful delay. Boris Kolpackov wrote: > > I think if we try to support all make flavors in a combined test, > things will get messy (my other idea was to resort to executing make if > MAKEFLAGS contains more than one word). Seeing that the majority is > probably using GNU make and we can do a really fast test for it, it > would be bad to resort to some pessimistic tests (like running make) > just so that we can support other makes. > This sounds sensible. I've taken this approach of using an "optimized" test for GNU make, and the more messy tests (in a "best-effort" fashion) for non-GNU makes. So, this series should fix automake bug#13760. Testing and comments are welcome. I will proceed to push in a few days if there is no objection. Thanks, Stefano -*-*-*- Stefano Lattarini (3): header vars: can determine whether we are running under GNU make dry-run: with GNU make, prefer $(MFLAGS) over $(MAKEFLAGS) dry-run: don't get confused by '-I' option lib/am/header-vars.am | 57 +++++++++++++++++++++++++++++++------------- t/list-of-tests.mk | 3 ++- t/make-dryrun.tap | 4 ++-- t/make-is-gnu.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+), 19 deletions(-) create mode 100755 t/make-is-gnu.sh -- 1.8.2.1.389.gcaa7d79 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 05:18:08 2013 Received: (at 13760) by debbugs.gnu.org; 23 Apr 2013 09:18:08 +0000 Received: from localhost ([127.0.0.1]:38341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMU-0004J2-0n for submit@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:08 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:45270) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMP-0004Hp-NH for 13760@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:03 -0400 Received: by mail-wi0-f177.google.com with SMTP id hj19so449432wib.10 for <13760@debbugs.gnu.org>; Tue, 23 Apr 2013 02:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=LMqCNcG00kLR/Dy8kKLo7bTMhok8lMt6IZL8w0JuQzM=; b=ZyjsiKyfuOdvQjkPu8wjMVs3+PKnmNZb5XnFcq8fd0O9SV10sKvkFsocRJJvWvyYqb 1BPh6CPNFna0cOwPIrK8COUsMfc19XsGCA2R0aToH/vQ9PgHB46QbM0QGNH5hgF809I2 E9Z4SFDYsJdCO/K4pd52rvl70t3KvlCR1eeQV/FwWB8G7IRz/Wdus22p4YhxEP8PXs2u ItgCpIFKKd4McT4/w8+KorVevWB8g4Q29wpnCslRqzeJO2FyslY/keIFP1aby7hktf8T X3RlPDiVGoBthYpvMlfErQelGDMCVicNZ4soZFUd91hCE4zgeCH9VzcQfPcmy4jRXlQH Swig== X-Received: by 10.180.205.135 with SMTP id lg7mr44083110wic.11.1366708385388; Tue, 23 Apr 2013 02:13:05 -0700 (PDT) Received: from localhost.localdomain (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPSA id t14sm25700080wib.0.2013.04.23.02.13.03 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 02:13:04 -0700 (PDT) From: Stefano Lattarini To: boris@codesynthesis.com Subject: [PATCH 1/3] header vars: can determine whether we are running under GNU make Date: Tue, 23 Apr 2013 11:12:46 +0200 Message-Id: <3de27839c88bda6c755f00c7142620080b725be0.1366707905.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.8.2.1.389.gcaa7d79 In-Reply-To: References: In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13760 Cc: 13760@debbugs.gnu.org, automake-patches@gnu.org 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: -2.6 (--) This is mostly a preparatory patch in view of future changes. * lib/am/header-vars.am (am__is_gnu_make): New, contains shell code that determines whether we are running under GNU make. * t/make-is-gnu.sh: New test. * t/list-of-tests.mk: Add it. Signed-off-by: Stefano Lattarini --- lib/am/header-vars.am | 6 ++++- t/list-of-tests.mk | 3 ++- t/make-is-gnu.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100755 t/make-is-gnu.sh diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index 9fda37c..8295a99 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -26,12 +26,16 @@ VPATH = @srcdir@ ## a vendor make. ## DESTDIR = +## Shell code that determines whether we are running under GNU make. +## This is somewhat of an hack, and might be improved, but is good +## enough for now. +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' + ## Shell code that determines whether make is running in "dry mode" ## ("make -n") or not. Useful in rules that invoke make recursively, ## and are thus executed also with "make -n" -- either because they ## are declared as dependencies to '.MAKE' (NetBSD make), or because ## their recipes contain the "$(MAKE)" string (GNU and Solaris make). - am__make_dryrun = \ { \ am__dry=no; \ diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index f1e3dca..c72a636 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -664,8 +664,9 @@ t/makej.sh \ t/makej2.sh \ t/maken.sh \ t/maken3.sh \ -t/make-dryrun.tap \ t/makevars.sh \ +t/make-dryrun.tap \ +t/make-is-gnu.sh \ t/man.sh \ t/man2.sh \ t/man3.sh \ diff --git a/t/make-is-gnu.sh b/t/make-is-gnu.sh new file mode 100755 index 0000000..c37cc17 --- /dev/null +++ b/t/make-is-gnu.sh @@ -0,0 +1,66 @@ +#! /bin/sh +# Copyright (C) 2013 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that $(am__is_gnu_make) can be used to correctly determine if +# we are running under GNU make. + +. test-init.sh + +if using_gmake; then + as_expected () { test $1 -eq 0 && test -f ok && test ! -e ko; } +else + as_expected () { test $1 -gt 0 && test -f ko && test ! -e ok; } +fi + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +all: file + $(am__is_gnu_make) +file: + if $(am__is_gnu_make); then : > ok; else : > ko; fi +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure + +st=0; $MAKE || st=$? +if using_gmake; then + test $st -eq 0 + test -f ok + test ! -e ko +else + test $st -gt 0 + test -f ko + test ! -e ok +fi + +rm -f ok ko + +$MAKE -s file >output 2>&1 +cat output +if using_gmake; then + test -f ok + test ! -e ko +else + test -f ko + test ! -e ok +fi +test ! -s output + +: -- 1.8.2.1.389.gcaa7d79 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 05:18:09 2013 Received: (at 13760) by debbugs.gnu.org; 23 Apr 2013 09:18:09 +0000 Received: from localhost ([127.0.0.1]:38344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMX-0004JU-4A for submit@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:09 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:40916) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMR-0004IQ-Ui for 13760@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:05 -0400 Received: by mail-wi0-f182.google.com with SMTP id m6so448281wiv.15 for <13760@debbugs.gnu.org>; Tue, 23 Apr 2013 02:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=7iys2jdBe8EZLmQUTRVuEkcaH/hteHZVvpAAhkRV4Mo=; b=XUU/h6Dbd+OUBO/GAr5N8x1t+JywH5oB6I7/2JZQ3fEV/niX7WDnFG0jUgCBmWrXYo XYVlPRyi8IJ9qzKKpT3PgQcO8VPXFaJjmw5WQZ8TQ5kQHpu1pxFuGm42a20bgz8zaSo1 feRw1l5scQpybaV9zZf2V88DDhyWcFZI4ATuT+f5HctNcMOetQ0pR0uEVqSyKQQ0cqPQ TYvxQlJRcA5nx71xDYYdvFzd+4mPUkJONBohy0CK3R9M5df9WWWuxyWhkZ7ZeoKsHzCR QcFyN7zU+TBg0Epn8b008f1X1YzuCk5GhyT9IJPtRNd52VSEGLxvGnhuszBaC+acnN9m MVlA== X-Received: by 10.194.92.197 with SMTP id co5mr29451101wjb.41.1366708387489; Tue, 23 Apr 2013 02:13:07 -0700 (PDT) Received: from localhost.localdomain (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPSA id t14sm25700080wib.0.2013.04.23.02.13.05 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 02:13:06 -0700 (PDT) From: Stefano Lattarini To: boris@codesynthesis.com Subject: [PATCH 2/3] dry-run: with GNU make, prefer $(MFLAGS) over $(MAKEFLAGS) Date: Tue, 23 Apr 2013 11:12:47 +0200 Message-Id: <334a2e0b46c3d17ffb24f415cbec2e13e48b6c94.1366707905.git.stefano.lattarini@gmail.com> X-Mailer: git-send-email 1.8.2.1.389.gcaa7d79 In-Reply-To: References: In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13760 Cc: 13760@debbugs.gnu.org, automake-patches@gnu.org 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: -2.6 (--) Fixes automake bug#13760 for GNU make. * lib/am/header-vars.am (am__make_dryrun): If GNU make is being used, rely on the contents of the $(MFLAGS) variable rather than of the $(MAKEFLAGS) to decide whther make is being executed in "dry run" mode. Not only this makes the code possibly faster and less brittle, but also fixes automake bug#13760 (at least when GNU make is in use). * t/make-dryrun.tap: Adjust: some tests that were xfailing now pass. Signed-off-by: Stefano Lattarini --- lib/am/header-vars.am | 43 ++++++++++++++++++++++++++++--------------- t/make-dryrun.tap | 4 ++-- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index 8295a99..23c627e 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -39,23 +39,36 @@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_dryrun = \ { \ am__dry=no; \ - case $$MAKEFLAGS in \ -## If we run "make TESTS='snooze nap'", GNU make will export MAKEFLAGS -## to "TESTS=foo\ nap", so that the simpler loop below (on word-splitted + if $(am__is_gnu_make); then \ +## GNU make: $(MAKEFLAGS) is quite tricky there, and the older +## $(MFLAGS) variable behaves much better. + for am__flg in $$MFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + -*n*) am__dry=yes; break;; \ + esac; \ + done; \ + else \ +## Non-GNU make: we must rely on $(MAKEFLAGS). This is tricky and brittle, +## but is the best we can do. + case $$MAKEFLAGS in \ +## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS +## to " TESTS=foo\ nap", so that the simpler loop below (on word-splitted ## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly ## misinterpret that as and indication that make is running in dry mode. -## This has already happened in practice. So we need this hack. - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ +## This has already happened in practice. So we need this unpleasant hack. + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes ;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done ;;\ + esac; \ + fi; \ test $$am__dry = yes; \ } diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap index 1459a9f..208b421 100755 --- a/t/make-dryrun.tap +++ b/t/make-dryrun.tap @@ -112,10 +112,10 @@ check_make --dry -C using_gmake "\$MAKE is not GNU make" --dry-run -k pr='bug#13760' -check_make --run -X -C make_supports_option_I "-I make option unsupported" \ +check_make --run -C make_supports_option_I "-I make option unsupported" \ -M "$pr" -I none -check_make --run -X -C using_gmake "\$MAKE is not GNU make" \ +check_make --run -C using_gmake "\$MAKE is not GNU make" \ -M "$pr" -I none --include dry-run check_make --dry -C make_supports_option_I "-I make option unsupported" \ -- 1.8.2.1.389.gcaa7d79 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 05:18:10 2013 Received: (at 13760) by debbugs.gnu.org; 23 Apr 2013 09:18:10 +0000 Received: from localhost ([127.0.0.1]:38346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMX-0004JX-Kw for submit@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:09 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:59704) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMT-0004In-ER for 13760@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:06 -0400 Received: by mail-wi0-f177.google.com with SMTP id hj19so449496wib.10 for <13760@debbugs.gnu.org>; Tue, 23 Apr 2013 02:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=fRPem5T2WpZUjzQwrfcRdtyJFJnfcJ8MX7z9XCCeqn8=; b=bf5fmKS+8i1Y/JWvfaVXEiDz4Ttpn/dqN3oMrGNTlP9xY8inWPayAicOgd1g7BkLuR OWu2zwQJWGyf2I/lbKSUG0tXHBJDYBR3y3KiVIft3WGwcYhNT/wV7ieRtTrAobYHdQxX Kzr8NWSEJ7itXEbO1iLCVs6xLhsUNsOvis9of4frZJoz8vhmD1DrOEUhiI/eiIQWOArg zc+XN59w7XZcOeaQ9yMtr/v/5vC53PetrAQ6irqGaC+wYRDOMr8Ohewj3B1Ov53ecS9v xKvH16xz+Cp5cUAg6VvO90Hic2k/nKhZLkquTTV9u44qPrp/XNv+nvYljolHAPGXDVIt sL5w== X-Received: by 10.180.85.103 with SMTP id g7mr72969345wiz.23.1366708389112; Tue, 23 Apr 2013 02:13:09 -0700 (PDT) Received: from localhost.localdomain (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPSA id t14sm25700080wib.0.2013.04.23.02.13.07 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 02:13:08 -0700 (PDT) From: Stefano Lattarini To: boris@codesynthesis.com Subject: [PATCH 3/3] dry-run: don't get confused by '-I' option Date: Tue, 23 Apr 2013 11:12:48 +0200 Message-Id: X-Mailer: git-send-email 1.8.2.1.389.gcaa7d79 In-Reply-To: References: In-Reply-To: References: X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 13760 Cc: 13760@debbugs.gnu.org, automake-patches@gnu.org 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: -2.6 (--) Fixes automake bug#13760 for non-GNU make implementations that still support the option '-I'. So far, the only such make implementation are FreeBSD (8.x) make and NetBSD (5.x) make. * lib/am/header-vars.am (am__make_dryrun): If a non-GNU make is being used, try to handle the '-I' option in $MAKEFLAGS correctly. For GNU make, that is already done by the proper use of the $MFLAGS variable. Signed-off-by: Stefano Lattarini --- lib/am/header-vars.am | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index 23c627e..d2f0984 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -61,9 +61,17 @@ am__make_dryrun = \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes ;; \ *) \ + am__skip_next=no; \ for am__flg in $$MAKEFLAGS; do \ + if test $$am__skip_next = yes; then \ + am__skip_next=no; \ + continue; \ + fi; \ case $$am__flg in \ *=*|--*) ;; \ +## Quite ugly special-casing. We might need other similar, but let's +## wait until the need arises. + -I) am__skip_next=yes;; \ *n*) am__dry=yes; break;; \ esac; \ done ;;\ -- 1.8.2.1.389.gcaa7d79 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 05:18:12 2013 Received: (at control) by debbugs.gnu.org; 23 Apr 2013 09:18:12 +0000 Received: from localhost ([127.0.0.1]:38348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMa-0004Jr-12 for submit@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:12 -0400 Received: from mail-ee0-f52.google.com ([74.125.83.52]:61430) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UUZMU-0004J0-Ip for control@debbugs.gnu.org; Tue, 23 Apr 2013 05:18:08 -0400 Received: by mail-ee0-f52.google.com with SMTP id d41so135865eek.25 for ; Tue, 23 Apr 2013 02:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; bh=4WX9tJIom7DqLABzcaz2PsQVJDuEbKyZY/ndu7ReBZw=; b=V5CJIqAf66l6MaVDOFmiRO61F27LAEc1eUBYRFnRR4lYY638OEP12jvgNvl3PIAZ/Q 9IiyIhGvg0ftd/iFFO5Uv+riDlsvNst9IQHLgq/5uzP5zEE3e6fZJQ+5NwQsnHm5f8qB e3NSFtWDH5HQa5FBH6nRXPNkrHwdj0pj24y37oFatXcXkp0R3Y6RaT+IETuUJ0ElT9VC 3OwwUgA/r+6hJ+1dMvLs5rs0JtEWuICh0HfbDrIN2lu52RELwjL461Lf40o74YtCnaih tJd5V0dj5a7mdEfo4ObAaU7KjdIUBimTLtUhzQ9MFMFwKtLfBUZvj6xmHtdztS6NuDyJ 700g== X-Received: by 10.14.219.130 with SMTP id m2mr49538070eep.32.1366708389821; Tue, 23 Apr 2013 02:13:09 -0700 (PDT) Received: from [192.168.178.20] (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPS id bk42sm45564957eeb.3.2013.04.23.02.13.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Apr 2013 02:13:09 -0700 (PDT) Message-ID: <517650A2.2050308@gmail.com> Date: Tue, 23 Apr 2013 11:13:06 +0200 From: Stefano Lattarini MIME-Version: 1.0 To: GNU bug tracker automated control server Subject: x 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: -1.2 (-) tags 13760 + patch stop From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 26 14:25:30 2013 Received: (at 13760-done) by debbugs.gnu.org; 26 Apr 2013 18:25:30 +0000 Received: from localhost ([127.0.0.1]:45287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVnKn-000180-PR for submit@debbugs.gnu.org; Fri, 26 Apr 2013 14:25:29 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:47344) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UVnKf-00017P-ON; Fri, 26 Apr 2013 14:25:23 -0400 Received: by mail-ee0-f54.google.com with SMTP id e49so740390eek.13 for ; Fri, 26 Apr 2013 11:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=74Iq1O2nBXG0Hrer9H1a2037FS3/CSRvw2ZRXmz3it8=; b=L5oHdLM/nBGkIyX1D8flqr6y51+sQKBJ1ZJZPKL8j9DL6qgw/LNHSr3bl3oudhFgyP dz4ekPqKNkXkOqMctdTyohRz15+GHgX9L3u5vbxYU/we6L1/akUPLRFDMLx7e6MDpQNZ tp8X8KxdEWODch4a9C9b7mGw/n6ic2XT7fUXD5nz0ImIisvCj5ppUznpYwHnLdAhLKSi 5m6/1Mwd7UfVelFR7vhiT9uAshPj82FjP42lqk5ijhH4R2mtD/bpW2y3TczPMW2Zs7La 7Z9ZnpK+J4CyM/T0YAuDtYyPWAhZC7HPrz7SfAxuIZ1jemolgO7K9ZHx5V4cGuisz+KA GmXg== X-Received: by 10.15.35.71 with SMTP id f47mr34615488eev.15.1367000715160; Fri, 26 Apr 2013 11:25:15 -0700 (PDT) Received: from [192.168.178.20] (host93-95-dynamic.6-79-r.retail.telecomitalia.it. [79.6.95.93]) by mx.google.com with ESMTPSA id e50sm709917eev.13.2013.04.26.11.25.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 26 Apr 2013 11:25:14 -0700 (PDT) Message-ID: <517AC682.8000009@gmail.com> Date: Fri, 26 Apr 2013 20:25:06 +0200 From: Stefano Lattarini MIME-Version: 1.0 To: boris@codesynthesis.com Subject: Re: [PATCH 0/3] dry-run: don't get confused by '-I' option References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13760-done Cc: 13760-done@debbugs.gnu.org, automake-patches@gnu.org 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: -2.6 (--) tags 13760 + patch stop On 04/23/2013 11:12 AM, Stefano Lattarini wrote: > Reference: > > Hello, and sorry for the shameful delay. > > Boris Kolpackov wrote: >> >> I think if we try to support all make flavors in a combined test, >> things will get messy (my other idea was to resort to executing make if >> MAKEFLAGS contains more than one word). Seeing that the majority is >> probably using GNU make and we can do a really fast test for it, it >> would be bad to resort to some pessimistic tests (like running make) >> just so that we can support other makes. >> > This sounds sensible. I've taken this approach of using an "optimized" > test for GNU make, and the more messy tests (in a "best-effort" fashion) > for non-GNU makes. > > So, this series should fix automake bug#13760. Testing and comments are > welcome. I will proceed to push in a few days if there is no objection. > Pushed now. I'm thus closing this bug report. Thanks, Stefano From unknown Fri Jun 20 07:13:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 25 May 2013 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator