GNU bug report logs - #9238
"make dist" when "." is in SUBDIRS

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: minor; Reported by: Jim Meyering <jim@HIDDEN>; dated Thu, 4 Aug 2011 09:19:01 UTC; Maintainer for automake is bug-automake@HIDDEN.
Severity set to 'minor' from 'normal' Request was from Stefano Lattarini <stefano.lattarini@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Changed bug title to '"make dist" when "." is in SUBDIRS' from 'help help2man to find iwhd' Request was from Stefano Lattarini <stefano.lattarini@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 9238) by debbugs.gnu.org; 4 Jan 2012 12:13:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 04 07:13:23 2012
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1RiPic-0007PR-KV
	for submit <at> debbugs.gnu.org; Wed, 04 Jan 2012 07:13:23 -0500
Received: from mail-ww0-f46.google.com ([74.125.82.46])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stefano.lattarini@HIDDEN>)
	id 1RiPiY-0007PE-W3; Wed, 04 Jan 2012 07:13:20 -0500
Received: by wgbdq10 with SMTP id dq10so23404661wgb.15
	for <multiple recipients>; Wed, 04 Jan 2012 04:09:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=message-id:date:from:mime-version:to:subject:content-type
	:content-transfer-encoding;
	bh=O0PcT/TsogGAiA5IC1Kfrx07cbqOh5/J8jl5Fc+C4SU=;
	b=WZsTWjMe1Vah/Ekzte4bQmhpohSUoJ0JXy2X+hqx+++Qz6SMt5PzZPCet9zzGa0Ybe
	C80b64qrSEhVZFY4fZqyjs/cYu1XPtMjwsfJ8Gne1yeal5X1EWgV+FhdSCmswAhQURbA
	UIPfzzmjLwlgFNXVAxVHP99ilX6UjR/QfEAjY=
Received: by 10.227.197.77 with SMTP id ej13mr21902701wbb.25.1325678992745;
	Wed, 04 Jan 2012 04:09:52 -0800 (PST)
Received: from [87.0.95.102]
	(host102-95-dynamic.0-87-r.retail.telecomitalia.it. [87.0.95.102])
	by mx.google.com with ESMTPS id w8sm134231204wiz.4.2012.01.04.04.09.51
	(version=SSLv3 cipher=OTHER); Wed, 04 Jan 2012 04:09:52 -0800 (PST)
Message-ID: <4F044184.4010208@HIDDEN>
Date: Wed, 04 Jan 2012 13:09:40 +0100
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
MIME-Version: 1.0
To: 9238 <at> debbugs.gnu.org
Subject: "make dist" when "." is in SUBDIRS (was: Re: help help2man to find
	iwhd)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -3.9 (---)
X-Debbugs-Envelope-To: 9238
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://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: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.9 (---)

retitle 9238 "make dist" when "." is in SUBDIRS
severity 9238 minor
thanks

References:
  <https://fedorahosted.org/pipermail/iwhd-devel/2011-August/000769.html>
  <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9238>

Hi Jim, sorry for the delay.

Jim Meyering wrote:
>
> I took a look at the generated Makefile.in and conclude that
> there's an automake weakness when we use Makefile.am's SUBDIRS
> variable to kludge dependencies by specifying "." not at the
> end of the list.
>
> Notice how iwhd's Makefile.am is careful to list "." before "man"
> in the SUBDIRS list:
>
>    SUBDIRS = lib . gnulib-tests t man po
>
> With normal "recursive" rules, that ensures that iwhd is built
> in "." before the binary is needed by help2man in man/.
>
> However, the problem is that while all of automake's so-called
> RECURSIVE_TARGETS handle that special case of "." as expected,
> the "distdir" rule does not.  The distdir rule is at the core
> of what is run when you do "make distcheck", and it merely skips
> ".".
>
I'm not sure this can be qualified as a real weakness; could you show an
real-world (or potentially so) example where the behaviour of `distdir'
causes some concrete problem?

And yes, I believe that the iwhd issue is *not* such an example, because
even if you had everything under a single top-level directory, you would
still need to run "make all" before "make dist" to correctly have the
distributed `iwhd.8' manpage generated from the `iwhd' program (which
wouldn't be there if you hadn't run "make all" in advance!).

>
> [SNIP]
>

Thanks,
  Stefano




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

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


Received: (at submit) by debbugs.gnu.org; 6 Aug 2011 01:53:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 05 21:53:10 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QpW4a-0006HV-II
	for submit <at> debbugs.gnu.org; Fri, 05 Aug 2011 21:53:10 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <zaitcev@HIDDEN>) id 1Qp3tN-0006F7-6y
	for submit <at> debbugs.gnu.org; Thu, 04 Aug 2011 15:47:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <zaitcev@HIDDEN>) id 1Qp3sg-00011B-Ub
	for submit <at> debbugs.gnu.org; Thu, 04 Aug 2011 15:46:59 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	RP_MATCHES_RCVD autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([140.186.70.17]:58470)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <zaitcev@HIDDEN>) id 1Qp3sg-000117-TD
	for submit <at> debbugs.gnu.org; Thu, 04 Aug 2011 15:46:58 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58776)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <zaitcev@HIDDEN>) id 1Qp3sf-0006RR-V5
	for bug-automake@HIDDEN; Thu, 04 Aug 2011 15:46:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <zaitcev@HIDDEN>) id 1Qp3se-00010u-Ki
	for bug-automake@HIDDEN; Thu, 04 Aug 2011 15:46:57 -0400
Received: from mx1.redhat.com ([209.132.183.28]:13587)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <zaitcev@HIDDEN>) id 1Qp3se-00010l-Dd
	for bug-automake@HIDDEN; Thu, 04 Aug 2011 15:46:56 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p74JksgU008777
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 4 Aug 2011 15:46:54 -0400
Received: from lembas.zaitcev.lan (vpn-228-132.phx2.redhat.com [10.3.228.132])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with
	ESMTP id p74JksbP014249; Thu, 4 Aug 2011 15:46:54 -0400
Date: Thu, 4 Aug 2011 13:46:47 -0600
From: Pete Zaitcev <zaitcev@HIDDEN>
To: Jim Meyering <jim@HIDDEN>
Subject: Re: help help2man to find iwhd
Message-ID: <20110804134647.55152841@HIDDEN>
In-Reply-To: <87oc05sfgz.fsf@HIDDEN>
References: <20110803114253.6d36bfe6@HIDDEN>
	<87oc05sfgz.fsf@HIDDEN>
Organization: Red Hat, Inc.
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 05 Aug 2011 21:53:02 -0400
Cc: bug-automake@HIDDEN,
	"iwhd-devel@HIDDEN" <iwhd-devel@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://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: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.9 (-----)

On Thu, 04 Aug 2011 11:17:32 +0200
Jim Meyering <jim@HIDDEN> wrote:

> I simply insert a "make" before the "make distcheck":
> 
>     $ sh autogen.sh
>     $ ./configure
>     $ make && make distcheck

I see. Thanks for the explaining, too. I looked at RECURSIVE_TARGETS
and just could not understand what it meant for the evaluation order.

-- Pete




Information forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#9238; Package automake. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 4 Aug 2011 09:18:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 04 05:18:21 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Qou4K-0006OO-I1
	for submit <at> debbugs.gnu.org; Thu, 04 Aug 2011 05:18:20 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@HIDDEN>) id 1Qou4G-0006OG-UW
	for submit <at> debbugs.gnu.org; Thu, 04 Aug 2011 05:18:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@HIDDEN>) id 1Qou3c-0006ab-1h
	for submit <at> debbugs.gnu.org; Thu, 04 Aug 2011 05:17:38 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED,
	RP_MATCHES_RCVD autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([140.186.70.17]:60829)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@HIDDEN>) id 1Qou3c-0006aU-0B
	for submit <at> debbugs.gnu.org; Thu, 04 Aug 2011 05:17:36 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56187)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@HIDDEN>) id 1Qou3a-000547-Vx
	for bug-automake@HIDDEN; Thu, 04 Aug 2011 05:17:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@HIDDEN>) id 1Qou3Z-0006Xa-Uo
	for bug-automake@HIDDEN; Thu, 04 Aug 2011 05:17:34 -0400
Received: from mx.meyering.net ([82.230.74.64]:35225)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@HIDDEN>) id 1Qou3Z-0006WU-L5
	for bug-automake@HIDDEN; Thu, 04 Aug 2011 05:17:33 -0400
Received: from rho.meyering.net (localhost.localdomain [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 9AFA3600D0;
	Thu,  4 Aug 2011 11:17:32 +0200 (CEST)
From: Jim Meyering <jim@HIDDEN>
To: Pete Zaitcev <zaitcev@HIDDEN>
Subject: Re: help help2man to find iwhd
In-Reply-To: <20110803114253.6d36bfe6@HIDDEN> (Pete Zaitcev's
	message of "Wed, 3 Aug 2011 11:42:53 -0600")
References: <20110803114253.6d36bfe6@HIDDEN>
Date: Thu, 04 Aug 2011 11:17:32 +0200
Message-ID: <87oc05sfgz.fsf@HIDDEN>
Lines: 93
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -6.1 (------)
X-Debbugs-Envelope-To: submit
Cc: bug-automake@HIDDEN,
	"iwhd-devel@HIDDEN" <iwhd-devel@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://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: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.1 (------)

Pete Zaitcev wrote:
> I have a problem that I'm failing to solve.
>
> If "make distcheck" is ran on a freshly-cloned iwhd repo, just after the
> configuring it, the following happens:
...
>
> But the above causes this to happen:
>
> $ sh autogen.sh
> $ ./configure
> $ make distcheck
> ............
> checking where the gettext function comes from... libc
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating gnulib-tests/Makefile
> config.status: creating lib/Makefile
> config.status: error: cannot find input file: `man/Makefile.in'
>
> So, what to do?

Life is already short enough ;-)
I simply insert a "make" before the "make distcheck":

    $ sh autogen.sh
    $ ./configure
    $ make && make distcheck

However, I took a look at the generated Makefile.in and conclude that
there's an automake weakness when we use Makefile.am's SUBDIRS variable
to kludge dependencies by specifying "." not at the end of the list.

Notice how iwhd's Makefile.am is careful to list "." before "man"
in the SUBDIRS list:

    SUBDIRS = lib . gnulib-tests t man po

With normal "recursive" rules, that ensures that iwhd is built
in "." before the binary is needed by help2man in man/.

However, the problem is that while all of automake's so-called
RECURSIVE_TARGETS handle that special case of "." as expected, the
"distdir" rule does not.  The distdir rule is at the core of what
is run when you do "make distcheck", and it merely skips ".".

Then I thought "Hey, use the "dist*-hook" mechanism!".
Unfortunately, that doesn't work, either, since "."
is simply skipped in this "distdir:" loop.  The hook
is run only after all subdirs have been processed:

      @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
      if test "$$subdir" = .; then :; else \
        dir1=$$subdir;
        ...
      fi
      $(MAKE) $(AM_MAKEFLAGS) \
          top_distdir="$(top_distdir)" distdir="$(distdir)" \
          dist-hook

Contrast that with how it's done for RECURSIVE_TARGETS:
(here, the position of "." in SUBDIRS *is* honored):

$(RECURSIVE_TARGETS):
	@fail= failcom='exit 1'; \
	for f in x $$MAKEFLAGS; do \
	  case $$f in \
	    *=* | --[!k]*);; \
	    *k*) failcom='fail=yes';; \
	  esac; \
	done; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
	fi; test -z "$$fail"

-------------------------------------------------------
In case you're wondering why this is not a problem for other
projects, at least for some, it's because they put programs
in a sub-directory (often named src/), and so it works fine.
No need to special-case ".".




Acknowledgement sent to Jim Meyering <jim@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#9238; 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.