GNU bug report logs - #54080
support X-pre & X-post like X-local & X-hook

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; Severity: wishlist; Reported by: Shahbaz Youssefi <shabbyx@HIDDEN>; Keywords: confirmed; dated Fri, 27 Feb 2015 16:59:02 UTC; Maintainer for automake is bug-automake@HIDDEN.

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


Received: (at 54080) by debbugs.gnu.org; 21 Feb 2022 03:59:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 20 22:59:34 2022
Received: from localhost ([127.0.0.1]:34403 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nLzrK-0006wC-Bl
	for submit <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:59:34 -0500
Received: from woodpecker.gentoo.org ([140.211.166.183]:38990
 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vapier@HIDDEN>) id 1nLzrI-0006vx-Uh
 for 54080 <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:59:33 -0500
Received: by smtp.gentoo.org (Postfix, from userid 559)
 id 3C36D3433AA; Mon, 21 Feb 2022 03:59:27 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
To: 54080 <at> debbugs.gnu.org
Subject: Re: bug#19961: check-local is kind of like check-hook
Message-Id: <20220221035927.3C36D3433AA@HIDDEN>
Date: Mon, 21 Feb 2022 03:59:27 +0000 (UTC)
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 54080
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: -6.0 (------)

On Mon, 02 Mar 2015 13:17:12 +0100, Shahbaz Youssefi wrote:
> I do have a related suggestion nevertheless. You see, no matter how
> many scenarios you think about, there is always some use-case that's
> going to be desired by someone but is unforeseen. Why not just create
> a general rule? My suggestion is to have for each target X, the
> following two targets:
>
> - X-pre is guaranteed to run before X
> - X-post is guaranteed to run after X
>
> This way, regardless of the target, anyone with whatever strange,
> foreseen or unforeseen scenario, can use these two to extend the
> operation of the target.

let's split this into a sep bug

other than semantics, afaict, X-pre is the same as X-local ?  and X-post is
the same as X-hook ?  ignoring the fact that not all targets atm support
X-hook (which is something we can/should fix).

in this case, i tend to agree that "X-pre" & "X-post" are better from a self-
documenting pov than "X-local" & "X-hook", but i'm not sure trying to rock the
boat is worth it when the existing conventions have been around for more than
20 years.  we could support both easily enough for backwards compatibility,
and shift the documentation to only mention pre/post.
-mike




Information forwarded to bug-automake@HIDDEN:
bug#54080; Package automake. Full text available.
Added tag(s) confirmed. Request was from Mike Frysinger <vapier@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Mike Frysinger <vapier@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Changed bug title to 'support X-pre & X-post like X-local & X-hook' from 'check-local is kind of like check-hook' Request was from Mike Frysinger <vapier@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug 19961 cloned as bug 54080. Request was from Mike Frysinger <vapier@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 19961) by debbugs.gnu.org; 21 Feb 2022 03:36:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 20 22:36:48 2022
Received: from localhost ([127.0.0.1]:34374 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nLzVI-00045q-Gm
	for submit <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:36:48 -0500
Received: from woodpecker.gentoo.org ([140.211.166.183]:33526
 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vapier@HIDDEN>) id 1nLzVE-00045J-GF
 for 19961 <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:36:44 -0500
Received: by smtp.gentoo.org (Postfix, from userid 559)
 id CC0203436EA; Mon, 21 Feb 2022 03:36:38 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
To: 19961 <at> debbugs.gnu.org
Subject: [PATCH 2/2] automake: allow check-local to run early
Date: Sun, 20 Feb 2022 22:36:32 -0500
Message-Id: <20220221033632.2672-2-vapier@HIDDEN>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20220221033632.2672-1-vapier@HIDDEN>
References: <20220221033632.2672-1-vapier@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 19961
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: -6.0 (------)

Fixes automake bug https://bugs.gnu.org/19961.

* NEWS: Note that check-local may run earlier that before.
* bin/automake.in: Allow check-local to run before check-am instead
of after like check-hook does.
---
 NEWS            | 5 +++++
 bin/automake.in | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 183825e8f2ed..a4f3d6063073 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,11 @@ New in 1.17:
 
   - The check target now supports user defined check-hook.
 
+* Miscellaneous changes
+
+  - The user defined check-local target may now run earlier in the check
+    process.  Users who want to always run at the end should use check-hook.
+
 * Obsolescent features:
 
   - py-compile no longer supports Python 0.x or 1.x versions.  Python 2.0,
diff --git a/bin/automake.in b/bin/automake.in
index 1a47865474f9..5a151455019e 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -4668,7 +4668,7 @@ sub handle_user_recursion ()
 sub do_check_merge_target ()
 {
   # Include user-defined local form of target.
-  push @check_tests, 'check-local'
+  $output_rules .= "check-local: all-am\n"
     if user_phony_rule 'check-local';
   push @check_tests, 'check-hook'
     if user_phony_rule 'check-hook';
@@ -4676,7 +4676,10 @@ sub do_check_merge_target ()
   # The check target must depend on the local equivalent of
   # 'all', to ensure all the primary targets are built.  Then it
   # must build the local check rules.
-  $output_rules .= "check-am: all-am\n";
+  $output_rules .= "check-am: all-am";
+  $output_rules .= " check-local"
+    if user_phony_rule 'check-local';
+  $output_rules .= "\n";
   if (@check)
     {
       pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t  ", @check);
-- 
2.34.1





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

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


Received: (at 19961) by debbugs.gnu.org; 21 Feb 2022 03:36:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 20 22:36:45 2022
Received: from localhost ([127.0.0.1]:34372 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nLzVF-00045e-7o
	for submit <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:36:45 -0500
Received: from woodpecker.gentoo.org ([140.211.166.183]:33520
 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vapier@HIDDEN>) id 1nLzVC-00045G-Sl
 for 19961 <at> debbugs.gnu.org; Sun, 20 Feb 2022 22:36:43 -0500
Received: by smtp.gentoo.org (Postfix, from userid 559)
 id A6E223436CD; Mon, 21 Feb 2022 03:36:36 +0000 (UTC)
From: Mike Frysinger <vapier@HIDDEN>
To: 19961 <at> debbugs.gnu.org
Subject: [PATCH 1/2] automake: support check-hook target
Date: Sun, 20 Feb 2022 22:36:31 -0500
Message-Id: <20220221033632.2672-1-vapier@HIDDEN>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 19961
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: -6.0 (------)

Related to automake bug https://bugs.gnu.org/19961.

Add hook support for the check target as requested by Shahbaz Youssefi.

* NEWS: Mention new check-hook.
* bin/automake.in: Run check-hook if defined.
* doc/automake.texi: Document new check-hook.
---
 NEWS              | 2 ++
 bin/automake.in   | 2 ++
 doc/automake.texi | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 665d8329d667..183825e8f2ed 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,8 @@ New in 1.17:
   - Variables using escaped \# will trigger portability warnings, but be
     retained when appended.  GNU Make & BSD Makes are known to support it.
 
+  - The check target now supports user defined check-hook.
+
 * Obsolescent features:
 
   - py-compile no longer supports Python 0.x or 1.x versions.  Python 2.0,
diff --git a/bin/automake.in b/bin/automake.in
index 6d55884023cd..1a47865474f9 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -4670,6 +4670,8 @@ sub do_check_merge_target ()
   # Include user-defined local form of target.
   push @check_tests, 'check-local'
     if user_phony_rule 'check-local';
+  push @check_tests, 'check-hook'
+    if user_phony_rule 'check-hook';
 
   # The check target must depend on the local equivalent of
   # 'all', to ensure all the primary targets are built.  Then it
diff --git a/doc/automake.texi b/doc/automake.texi
index b6a38dc27ce5..b13f96809ce3 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -11609,7 +11609,7 @@ In contrast, some rules also have a way to run another rule, called a
 @dfn{hook}; hooks are always executed after the main rule's work is done.
 The hook is named after the principal target, with @samp{-hook} appended.
 The targets allowing hooks are @code{install-data},
-@code{install-exec}, @code{uninstall}, @code{dist}, and
+@code{install-exec}, @code{uninstall}, @code{check}, @code{dist}, and
 @code{distcheck}.
 
 For instance, here is how to create a hard link to an installed program:
-- 
2.34.1





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

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


Received: (at 19961) by debbugs.gnu.org; 2 Mar 2015 12:17:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 02 07:17:21 2015
Received: from localhost ([127.0.0.1]:33886 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YSPHl-0007Dz-0f
	for submit <at> debbugs.gnu.org; Mon, 02 Mar 2015 07:17:21 -0500
Received: from mail-lb0-f176.google.com ([209.85.217.176]:45232)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <shabbyx@HIDDEN>) id 1YSPHi-0007Dh-7O
 for 19961 <at> debbugs.gnu.org; Mon, 02 Mar 2015 07:17:19 -0500
Received: by lbiz12 with SMTP id z12so1628430lbi.12
 for <19961 <at> debbugs.gnu.org>; Mon, 02 Mar 2015 04:17:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=+m8F4MWX8SNbxf3Pnt4T6SZ/l+SKBVC2dv61nDwxs84=;
 b=zyS5TDw3dPPzmv8JOIUhaz8K5z0brGBbeLmxd7k04w6Eq/0NQL8CVVotYLwqBL/TqI
 RuuXc27pAIWRWxd5mbOVt9ZMAkrS4WeOGzRBpURtnCODbryh6wXC9qC+7bVg9eibgjLJ
 4bQxaQNMMA91CHLcwXw9AgWraNdl8iUR6lar9yzkZPwFVEQdQKj20U7IgiZ1b7SKZTgG
 FBasR6yzFOJjKykDyaIRLjE9EeRKwDB7xDKAsw27HDLEtxnqI36Ebm6XT3mqwSs201NL
 yo8Z2ggkoR/Rj0+wNtV5/GtvfWOBmNZYS94TOnlJ2UhIBpc/3AOO3BhUsBzJ1arcFJko
 A+Cw==
MIME-Version: 1.0
X-Received: by 10.112.146.66 with SMTP id ta2mr24538965lbb.0.1425298632301;
 Mon, 02 Mar 2015 04:17:12 -0800 (PST)
Received: by 10.112.73.4 with HTTP; Mon, 2 Mar 2015 04:17:12 -0800 (PST)
In-Reply-To: <54F39E41.4020504@HIDDEN>
References: <CALeOzZ_mc6PP5YiRYJzC_J=YdsbSsz+rEWE6LfTxkEW7dJgSwA@HIDDEN>
 <54F39E41.4020504@HIDDEN>
Date: Mon, 2 Mar 2015 13:17:12 +0100
Message-ID: <CALeOzZ9M2tyG-sK69gM4MUW6mSxyAUuJqACLHjaXoz1=Gfg3eA@HIDDEN>
Subject: Re: bug#19961: check-local is kind of like check-hook
From: Shahbaz Youssefi <shabbyx@HIDDEN>
To: Peter Johansson <trojkan@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 19961
Cc: 19961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
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: -0.7 (/)

On Mon, Mar 2, 2015 at 12:18 AM, Peter Johansson <trojkan@HIDDEN> wrote:
> On 02/28/2015 02:07 AM, Shahbaz Youssefi wrote:
>>
>> To align this with the other -local rules, why not generate it like this?
>>
>> check-am: all-am check-local
>>      $(MAKE) $(AM_MAKEFLAGS) check-TESTS
>
> I think it would be a mistake to change this rule. Some projects might rely
> on the fact that 'check-local' depends on 'all-am' and 'check-local' might
> e.g. run some of the programs built within 'all-am'.
>

Fair enough. Wouldn't something like this address that issue?

check-local: all-am

check-am: check-local
     $(MAKE) $(AM_MAKEFLAGS) check-TESTS

>
> With my Automake the rule looks like:
>
> check-am: all-am
>     $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) $(check_DATA)
>     $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
>
> so you could move your check_kernelmodule into check_DATA with something
> like (untested)
>
> check_DATA = kernelmodule.timestamp
>
> kernelmodule.timestamp:
>     @echo "*******************************************"
>     @echo "*******************************************"
>     @echo "I want this to be called before the check"
>     @echo "*******************************************"
>     @echo "*******************************************"
>

Ok, I haven't seen check_DATA before (is that new in Automake 1.15?).
This could be a solution of course, although a bit strange, since the
kernel module is not really "data".

I do have a related suggestion nevertheless. You see, no matter how
many scenarios you think about, there is always some use-case that's
going to be desired by someone but is unforeseen. Why not just create
a general rule? My suggestion is to have for each target X, the
following two targets:

- X-pre is guaranteed to run before X
- X-post is guaranteed to run after X

This way, regardless of the target, anyone with whatever strange,
foreseen or unforeseen scenario, can use these two to extend the
operation of the target.

Kampai,
Shahbaz




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

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


Received: (at 19961) by debbugs.gnu.org; 1 Mar 2015 23:18:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 01 18:18:39 2015
Received: from localhost ([127.0.0.1]:33648 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YSD8A-0003wb-F8
	for submit <at> debbugs.gnu.org; Sun, 01 Mar 2015 18:18:39 -0500
Received: from mail-pa0-f51.google.com ([209.85.220.51]:35186)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <trojkan@HIDDEN>) id 1YSD87-0003wN-Mm
 for 19961 <at> debbugs.gnu.org; Sun, 01 Mar 2015 18:18:36 -0500
Received: by pabli10 with SMTP id li10so9141534pab.2
 for <19961 <at> debbugs.gnu.org>; Sun, 01 Mar 2015 15:18:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=message-id:date:from:user-agent:mime-version:to:cc:subject
 :references:in-reply-to:content-type:content-transfer-encoding;
 bh=jxv2Sfb6pAb6Yr3IohXrlWSYp3U7ZzPA/9DGmbM6ftA=;
 b=XkIuhi7o+q8LDSRrspwrReFdje4z7MDscXOUCCiX4sMi6f5d/Z3imG5QWg4b9OGWiK
 akbSusaSCzl//75gr4G8ZL8WsU1iFpVcyf41IrfI7QfXI4eA7uDeayH1Kw6tUAMOLnWc
 DYgMd/aGlFiH+6k56PaA62Ej4jaAjvuUO/DNp5vD5Wjf2p9YDvOoHvfp5pFKCVWx6GAk
 qVBE0oWkxzcRcwNlaRRge9MTUVoSDDk7AXoDQ3TTQfMfXv8WTgaKEFsAxM5MOLAvJJGA
 X71hYKjAIQ9ZlGD7Usn0a21rFFrPFVeYNK4iHyduwZGaFLt7QVqbVqPPbYpCWHCabW/a
 mMrg==
X-Received: by 10.68.211.228 with SMTP id nf4mr42400481pbc.66.1425251909722;
 Sun, 01 Mar 2015 15:18:29 -0800 (PST)
Received: from [10.3.81.47] (gateway.qimr.edu.au. [152.98.8.1])
 by mx.google.com with ESMTPSA id rr9sm10014641pbc.39.2015.03.01.15.18.27
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Sun, 01 Mar 2015 15:18:28 -0800 (PST)
Message-ID: <54F39E41.4020504@HIDDEN>
Date: Mon, 02 Mar 2015 09:18:25 +1000
From: Peter Johansson <trojkan@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:24.0) Gecko/20100101 Thunderbird/24.8.0
MIME-Version: 1.0
To: Shahbaz Youssefi <shabbyx@HIDDEN>
Subject: Re: bug#19961: check-local is kind of like check-hook
References: <CALeOzZ_mc6PP5YiRYJzC_J=YdsbSsz+rEWE6LfTxkEW7dJgSwA@HIDDEN>
In-Reply-To: <CALeOzZ_mc6PP5YiRYJzC_J=YdsbSsz+rEWE6LfTxkEW7dJgSwA@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 19961
Cc: 19961 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
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: -0.7 (/)

On 02/28/2015 02:07 AM, Shahbaz Youssefi wrote:
> Hi,
>
> The -local and -hook targets are generally used like this:
>
> X: X-local
>      # stuff to do X
>      $(MAKE) X-hook
>
> That is, X-local is run first, then the automake generated rules do X
> and then X-hook is called.
>
> With check-local, the generated Makefile.in looks like this:
>
> check-am: all-am
>      $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
>
> Now as far as the documentation is concerned, this is valid:
>
>> With the -local targets, there is no particular guarantee of execution order; typically, they are run early, but with parallel make, there is no way to be sure of that.
> However, even with not-parallel make, check-local executes after the tests.
>
> To align this with the other -local rules, why not generate it like this?
>
> check-am: all-am check-local
>      $(MAKE) $(AM_MAKEFLAGS) check-TESTS

I think it would be a mistake to change this rule. Some projects might 
rely on the fact that 'check-local' depends on 'all-am' and 
'check-local' might e.g. run some of the programs built within 'all-am'.


>
> The reason I actually have a problem with the current method is that
> it is impossible to perform an action before the check. In my
> particular case, my test scripts use test kernel modules. Of course,
> automake doesn't have a target like check_KERNELMODULE for example to
> automatically build the kernel module before running the tests. So
> ideally what I could do is to build the kernel module in check-local.
> The way the Makefile.in's are currently generated, this is impossible.
>
> In my case, I had to use all-local to build the test kernel modules,
> even if the user is not interested in make check, which is annoying in
> the least.

With my Automake the rule looks like:

check-am: all-am
     $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) $(check_DATA)
     $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local

so you could move your check_kernelmodule into check_DATA with something 
like (untested)

check_DATA = kernelmodule.timestamp

kernelmodule.timestamp:
     @echo "*******************************************"
     @echo "*******************************************"
     @echo "I want this to be called before the check"
     @echo "*******************************************"
     @echo "*******************************************"





Cheers,
Peter

-- 
Peter Johansson





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

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


Received: (at submit) by debbugs.gnu.org; 27 Feb 2015 16:58:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 27 11:58:13 2015
Received: from localhost ([127.0.0.1]:60147 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YROEv-0007NP-5Q
	for submit <at> debbugs.gnu.org; Fri, 27 Feb 2015 11:58:13 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52351)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <shabbyx@HIDDEN>) id 1YRNS1-0006CK-66
 for submit <at> debbugs.gnu.org; Fri, 27 Feb 2015 11:07:41 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <shabbyx@HIDDEN>) id 1YRNRr-0007gM-Ta
 for submit <at> debbugs.gnu.org; Fri, 27 Feb 2015 11:07:32 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:40429)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <shabbyx@HIDDEN>) id 1YRNRr-0007g3-RN
 for submit <at> debbugs.gnu.org; Fri, 27 Feb 2015 11:07:31 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54041)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <shabbyx@HIDDEN>) id 1YRNRq-0002kp-Su
 for bug-automake@HIDDEN; Fri, 27 Feb 2015 11:07:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <shabbyx@HIDDEN>) id 1YRNRp-0007er-Sq
 for bug-automake@HIDDEN; Fri, 27 Feb 2015 11:07:30 -0500
Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]:33014)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <shabbyx@HIDDEN>) id 1YRNRp-0007eE-LF
 for bug-automake@HIDDEN; Fri, 27 Feb 2015 11:07:29 -0500
Received: by lbvp9 with SMTP id p9so18277052lbv.0
 for <bug-automake@HIDDEN>; Fri, 27 Feb 2015 08:07:28 -0800 (PST)
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=9EJTFM3l896sGGdiIzC90fajNTH1x76Bo+kQpR2ML/w=;
 b=HIAID0rZVgTXHq/OesyV5OfzwAFKEhW40Zn2Y6KmnfsHp/RIS698X2SnMChOSK26jo
 XlfM1KaymtacPs0b/3Ax96IBc7c6DrEvvp734W9hhj6K3P+HeGXVE7iQ/uq8ZIVfgyRF
 9QjBTXtSdWJDrGp3ciVxg4UVb+CnifC3N6ulMfNAN/tyuQy6J/EWq0SBvGWFjrDL5fJB
 zYgJSSU80/GqhoJi1Vpsk+OEqdxny7AUsLE8D6jqoY8FIgkUeEefcHyNxoOPI4h8F+1Q
 W40Jhs95ceWi0SAldQhb6gpy8kHwe0qYv+4Nl3sGKXcTg/A/QxfVi1fKsTyosHOV4v7v
 LThw==
MIME-Version: 1.0
X-Received: by 10.152.10.98 with SMTP id h2mr13217613lab.18.1425053248008;
 Fri, 27 Feb 2015 08:07:28 -0800 (PST)
Received: by 10.112.73.4 with HTTP; Fri, 27 Feb 2015 08:07:27 -0800 (PST)
Date: Fri, 27 Feb 2015 17:07:27 +0100
Message-ID: <CALeOzZ_mc6PP5YiRYJzC_J=YdsbSsz+rEWE6LfTxkEW7dJgSwA@HIDDEN>
Subject: check-local is kind of like check-hook
From: Shahbaz Youssefi <shabbyx@HIDDEN>
To: bug-automake@HIDDEN
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 27 Feb 2015 11:58:11 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
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: -4.0 (----)

Hi,

The -local and -hook targets are generally used like this:

X: X-local
    # stuff to do X
    $(MAKE) X-hook

That is, X-local is run first, then the automake generated rules do X
and then X-hook is called.

With check-local, the generated Makefile.in looks like this:

check-am: all-am
    $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local

Now as far as the documentation is concerned, this is valid:

> With the -local targets, there is no particular guarantee of execution order; typically, they are run early, but with parallel make, there is no way to be sure of that.

However, even with not-parallel make, check-local executes after the tests.

To align this with the other -local rules, why not generate it like this?

check-am: all-am check-local
    $(MAKE) $(AM_MAKEFLAGS) check-TESTS

The reason I actually have a problem with the current method is that
it is impossible to perform an action before the check. In my
particular case, my test scripts use test kernel modules. Of course,
automake doesn't have a target like check_KERNELMODULE for example to
automatically build the kernel module before running the tests. So
ideally what I could do is to build the kernel module in check-local.
The way the Makefile.in's are currently generated, this is impossible.

In my case, I had to use all-local to build the test kernel modules,
even if the user is not interested in make check, which is annoying in
the least.

Good day,
Shahbaz

---

P.S. I think it's all very clear, but just for good measure, here is an example:

=================================

configure.ac:

AC_PREREQ([2.68])
AC_INIT([Demo], [0.0], [demo])
AC_CONFIG_AUX_DIR([bin])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.14 -Wall -Werror foreign])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

=================================

Makefile.am:

ACLOCAL_AMFLAGS = -I m4

check_SCRIPT = test_script

TESTS = $(check_SCRIPT)

check-local:
    @echo "*******************************************"
    @echo "*******************************************"
    @echo "I wanted this to be called before the check"
    @echo "*******************************************"
    @echo "*******************************************"

=================================

test_script:

#! /bin/bash

echo "Running test script"




Acknowledgement sent to Shahbaz Youssefi <shabbyx@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to bug-automake@HIDDEN:
bug#19961; 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, 21 Feb 2022 04:15:02 UTC

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