From unknown Sat Aug 16 15:54:21 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#10878 <10878@debbugs.gnu.org> To: bug#10878 <10878@debbugs.gnu.org> Subject: Status: "make dist" with read-only srcdir generates read-only tarball Reply-To: bug#10878 <10878@debbugs.gnu.org> Date: Sat, 16 Aug 2025 22:54:21 +0000 retitle 10878 "make dist" with read-only srcdir generates read-only tarball reassign 10878 automake submitter 10878 Nick Bowler severity 10878 minor tag 10878 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 11:05:09 2012 Received: (at submit) by debbugs.gnu.org; 24 Feb 2012 16:05:09 +0000 Received: from localhost ([127.0.0.1]:54326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0xds-0002Po-6E for submit@debbugs.gnu.org; Fri, 24 Feb 2012 11:05:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49440) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0xdo-0002P2-Ho for submit@debbugs.gnu.org; Fri, 24 Feb 2012 11:05:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0xbD-0001MB-EI for submit@debbugs.gnu.org; Fri, 24 Feb 2012 11:02:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,FROM_12LTRDOM, TO_NO_BRKTS_PCNT autolearn=no version=3.3.2 Received: from lists.gnu.org ([140.186.70.17]:34146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0xbD-0001M5-AW for submit@debbugs.gnu.org; Fri, 24 Feb 2012 11:02:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0xb8-0002Lq-Fs for bug-automake@gnu.org; Fri, 24 Feb 2012 11:02:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0xb6-0001LC-Ny for bug-automake@gnu.org; Fri, 24 Feb 2012 11:02:18 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:38343 helo=ironport-01.sms.scalar.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0xb6-0001Ht-Jp for bug-automake@gnu.org; Fri, 24 Feb 2012 11:02:16 -0500 Received: from unknown (HELO sms-zimbra-mta-01.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 24 Feb 2012 10:09:41 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTP id DEB2817F49 for ; Fri, 24 Feb 2012 10:09:40 -0500 (EST) Received: from sms-zimbra-mta-01.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-01.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sKjz6pGuouUv for ; Fri, 24 Feb 2012 10:09:40 -0500 (EST) Received: from mail.ellipticsemi.com (dsl-67-204-24-19.acanac.net [67.204.24.19]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTPSA id 9730417F47 for ; Fri, 24 Feb 2012 10:09:39 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Fri, 24 Feb 2012 10:09:39 -0500 (EST) Date: Fri, 24 Feb 2012 10:09:38 -0500 From: Nick Bowler To: bug-automake@gnu.org Subject: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120224150938.GA22342@elliptictech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) 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: -1.6 (-) X-Debbugs-Envelope-To: submit 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.9 (-) Hi, When using a read-only srcdir, "make dist" will generate a tarball whose permissions have all files read-only (though directories are writable). I noticed this because "dist-hook" targets cannot actually modify any files in distdir as they're all read-only (without first running chmod, anyway), causing distcheck failures. While the GNU coding standards do not demand write permissions on files in distribution tarballs (I'm not really sure why), Automake's behaviour in the build directory should not depend on whether or not srcdir is writable. Tested with both automake-1.11.1 and git master. Here's a simple example: % cat >configure.ac <<'EOF' AC_INIT([test], [1.0]) AM_INIT_AUTOMAKE([foreign]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT EOF % cat >Makefile.am <<'EOF' EOF % autoreconf -is % ./configure && make dist % tar tvf test-1.0.tar.gz drwxr-xr-x 550/509 0 2012-02-24 09:56 test-1.0/ -rw-r--r-- 550/509 89 2012-02-24 09:56 test-1.0/configure.ac -rw-r--r-- 550/509 22000 2012-02-24 09:56 test-1.0/aclocal.m4 -rwxr-xr-x 550/509 98862 2012-02-24 09:56 test-1.0/configure -rw-r--r-- 550/509 0 2012-02-24 09:56 test-1.0/Makefile.am -rw-r--r-- 550/509 13264 2012-02-24 09:56 test-1.0/Makefile.in -rwxr-xr-x 550/509 11419 2009-12-10 12:58 test-1.0/missing -rwxr-xr-x 550/509 13663 2009-12-10 12:58 test-1.0/install-sh (notice correct user write permissions on all files) % tar xf test-1.0.tar.gz % chmod -R a-w test-1.0 % mkdir build && cd build % ../test-1.0/configure && make dist % tar tvf test-1.0.tar.gz drwxr-xr-x 550/509 0 2012-02-24 09:59 test-1.0/ -r--r--r-- 550/509 89 2012-02-24 09:56 test-1.0/configure.ac -r--r--r-- 550/509 22000 2012-02-24 09:56 test-1.0/aclocal.m4 -r-xr-xr-x 550/509 98862 2012-02-24 09:56 test-1.0/configure -r--r--r-- 550/509 0 2012-02-24 09:56 test-1.0/Makefile.am -r--r--r-- 550/509 13264 2012-02-24 09:56 test-1.0/Makefile.in -r-xr-xr-x 550/509 11419 2009-12-10 12:58 test-1.0/missing -r-xr-xr-x 550/509 13663 2009-12-10 12:58 test-1.0/install-sh (notice that user write permissions are missing) Automake should at least add user write permissions to all files in distdir prior to running dist-hook (and hence prior to generating the distribution tarball). Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 11:15:39 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 16:15:40 +0000 Received: from localhost ([127.0.0.1]:54340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0xo3-0002em-AF for submit@debbugs.gnu.org; Fri, 24 Feb 2012 11:15:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22393) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0xo0-0002eY-2a for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 11:15:37 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1OGCtih007140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Feb 2012 11:12:55 -0500 Received: from [10.3.113.113] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1OGCtQ6029765; Fri, 24 Feb 2012 11:12:55 -0500 Message-ID: <4F47B706.20408@redhat.com> Date: Fri, 24 Feb 2012 09:12:54 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1 MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> In-Reply-To: <20120224150938.GA22342@elliptictech.com> X-Enigmail-Version: 1.3.5 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig8BD3067F4AFE52A53FBC2CBB" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.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: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8BD3067F4AFE52A53FBC2CBB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/24/2012 08:09 AM, Nick Bowler wrote: > Hi, >=20 > When using a read-only srcdir, "make dist" will generate a tarball whos= e > permissions have all files read-only (though directories are writable).= > I noticed this because "dist-hook" targets cannot actually modify any > files in distdir as they're all read-only (without first running chmod,= > anyway), causing distcheck failures. While the GNU coding standards do= > not demand write permissions on files in distribution tarballs (I'm not= > really sure why), Automake's behaviour in the build directory should no= t > depend on whether or not srcdir is writable. >=20 > Tested with both automake-1.11.1 and git master. >=20 > (notice that user write permissions are missing) >=20 > Automake should at least add user write permissions to all files in > distdir prior to running dist-hook (and hence prior to generating the > distribution tarball). Automake must not add write permissions to files that were intended to be shipped as read-only. For example, coreutils intentionally converts generated-but-distributed files to read-only, so that users are more likely to notice that they should edit the source that generates the file, and not the generated file itself. So how do you propose to tell automake which files are supposed to be read-only, vs. those that should be writable even if the tarball was re-created from a read-only srcdir? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig8BD3067F4AFE52A53FBC2CBB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPR7cGAAoJEKeha0olJ0NqgBUIAJVOxj6JrIdMT3xCWpfx2PV0 HDIT2A2jFxj7uuShY/Dk0rovpUcnfGaXczPUUQJ2iwg9P1MTy7NnFZOTGO5kofBA fp84tVSoH52CoDvwRZvps60/VxcYfJDPyxSmgUDRwyvVQi4UJ5GlpVHvcSfYT6Pk vRHtMATRDtzyWopWpFkJLAVu3t/OEkO2wdyA9/q76kNpiYJiXUMpLHje5nmmkDpa ooIxo5a06rAODdVaYoDtGH91dg7CSuXPinC0heTJIva9fjVWzI6PxD/h1fmGHM7u IqDPS3dl9aCVpeloEMKobh3jDVnjbht1fAoQFCjZ/d13Q7FYFHWvlBdSJ5oaEzk= =NW1W -----END PGP SIGNATURE----- --------------enig8BD3067F4AFE52A53FBC2CBB-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 12:28:55 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 17:28:55 +0000 Received: from localhost ([127.0.0.1]:54408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0ywv-0004KU-4O for submit@debbugs.gnu.org; Fri, 24 Feb 2012 12:28:53 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:32354 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0ywr-0004KG-Ms for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 12:28:50 -0500 Received: from unknown (HELO sms-zimbra-mta-01.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 24 Feb 2012 12:26:09 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTP id 4798D17F48; Fri, 24 Feb 2012 12:26:09 -0500 (EST) Received: from sms-zimbra-mta-01.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-01.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AGgJUizrm+lH; Fri, 24 Feb 2012 12:26:07 -0500 (EST) Received: from mail.ellipticsemi.com (dsl-67-204-24-19.acanac.net [67.204.24.19]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTPSA id 26B3517F47; Fri, 24 Feb 2012 12:26:06 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Fri, 24 Feb 2012 12:26:06 -0500 (EST) Date: Fri, 24 Feb 2012 12:26:04 -0500 From: Nick Bowler To: Eric Blake Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120224172604.GA27932@elliptictech.com> References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F47B706.20408@redhat.com> Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.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.9 (-) On 2012-02-24 09:12 -0700, Eric Blake wrote: > On 02/24/2012 08:09 AM, Nick Bowler wrote: [...] > > Automake should at least add user write permissions to all files in > > distdir prior to running dist-hook (and hence prior to generating the > > distribution tarball). > > Automake must not add write permissions to files that were intended to > be shipped as read-only. For example, coreutils intentionally converts > generated-but-distributed files to read-only, so that users are more > likely to notice that they should edit the source that generates the > file, and not the generated file itself. This sounds to me like a weird special case. Coreutils would still work correctly if the files were writable (otherwise it wouldn't build at all on some filesystems). Generated files should also have a statement to that effect in them, if at all possible. Regardless, I think it's a bad idea and frustrating for users to have any read-only files in a source tarball at all. > So how do you propose to tell automake which files are supposed to be > read-only, vs. those that should be writable even if the tarball was > re-created from a read-only srcdir? With my above proposed solution, the way to do this would be to use a dist-hook to remove the write permissions from the relevant files at "make dist" time. Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 12:40:33 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 17:40:33 +0000 Received: from localhost ([127.0.0.1]:54428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0z8C-0004dc-RK for submit@debbugs.gnu.org; Fri, 24 Feb 2012 12:40:33 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:42399) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0z89-0004dL-VF; Fri, 24 Feb 2012 12:40:31 -0500 Received: by werg1 with SMTP id g1so1653055wer.3 for ; Fri, 24 Feb 2012 09:37:49 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.180.96.8 as permitted sender) client-ip=10.180.96.8; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.180.96.8 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.180.96.8]) by 10.180.96.8 with SMTP id do8mr7270595wib.21.1330105069516 (num_hops = 1); Fri, 24 Feb 2012 09:37:49 -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:cc:subject:references :in-reply-to:content-type; bh=XaW8fKYWB0a7XvoE6xfj9kGSX6u/vmXDo3qQONVacWs=; b=h3ubiK+rb1SqaoBxPvzRHHc/ELbAdv+1BpBvrUuJ4OuXaX4eJ9tih5f/J85gZBiwBB wqRr1yIglw/gX+epS8KrJIy7x+t7DaMm/6ofhbz8anAF0idGI5Sul7/W7+HbJYY43GKJ MoZJtWuU/2G2gWEjUD6UsCe1p0V68SgX+ESIg= Received: by 10.180.96.8 with SMTP id do8mr5823287wib.21.1330105069480; Fri, 24 Feb 2012 09:37:49 -0800 (PST) Received: from [87.2.97.83] (host83-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.83]) by mx.google.com with ESMTPS id dw7sm4919981wib.4.2012.02.24.09.37.47 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 09:37:48 -0800 (PST) Message-ID: <4F47CAE3.8030600@gmail.com> Date: Fri, 24 Feb 2012 18:37:39 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> In-Reply-To: <4F47B706.20408@redhat.com> Content-Type: multipart/mixed; boundary="------------080709020005020809080800" X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: Nick Bowler , 10878@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 a multi-part message in MIME format. --------------080709020005020809080800 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit severity 10878 wishlist tags 10878 wontfix close 10878 thanks On 02/24/2012 08:09 AM, Nick Bowler wrote: > > Automake should at least add user write permissions to all files in > distdir prior to running dist-hook (and hence prior to generating the > distribution tarball). > I disagree; in case the user wants to change the permission of the distributed files from the ones that they have in the builddir/srcdir, he can do so in the dist-hook already, with full control (I've just added a tiny test to verify this behaviour, see attached patch). So we don't need to change the automake behaviour in this respect (but a documentation improvement might be nice, in case someone feels like writing it). On 02/24/2012 05:12 PM, Eric Blake replied: > > Automake must not add write permissions to files that were intended to > be shipped as read-only. For example, coreutils intentionally converts > generated-but-distributed files to read-only, so that users are more > likely to notice that they should edit the source that generates the > file, and not the generated file itself. > > So how do you propose to tell automake which files are supposed to be > read-only, vs. those that should be writable even if the tarball was > re-created from a read-only srcdir? > With a dist-hook ;-) Regards, Stefano --------------080709020005020809080800 Content-Type: text/x-diff; name="0001-coverage-test-that-dist-hook-can-modify-file-permiss.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-coverage-test-that-dist-hook-can-modify-file-permiss.pa"; filename*1="tch" >From d3957b27c205145e026e62fcf23f8bef969edeb8 Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini Date: Fri, 24 Feb 2012 18:34:04 +0100 Subject: [PATCH] coverage: test that dist-hook can modify file permission See automake bug#10878. * tests/dist-hook-perms.test: New test, checking that the user can use the 'dist-hook' target to modify permissions of distributed files before putting them in the distribution tarball. * tests/list-of-tests.mk: Add it. --- tests/disthook-perms.test | 59 +++++++++++++++++++++++++++++++++++++++++++++ tests/list-of-tests.mk | 1 + 2 files changed, 60 insertions(+), 0 deletions(-) create mode 100755 tests/disthook-perms.test diff --git a/tests/disthook-perms.test b/tests/disthook-perms.test new file mode 100755 index 0000000..a5f0acb --- /dev/null +++ b/tests/disthook-perms.test @@ -0,0 +1,59 @@ +#! /bin/sh +# Copyright (C) 2012 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 the user can use the 'dist-hook' target to modify +# permissions of distributed files before putting them in the +# distribution tarball. See automake bug#10878. + +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +EXTRA_DIST = write execute +dist-hook: + chmod u+w $(distdir)/write + chmod u+x $(distdir)/execute +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure + +echo Will be clobbered > write +cat > execute <<'END' +#!/bin/sh +echo I run successfully +END + +chmod a-w write +chmod a-x execute + +$MAKE +$MAKE dist + +test -f $distdir.tar.gz +gzip -dc $distdir.tar.gz | tar xvf - + +cd $distdir +echo clobber clobber > write +cat write | grep 'clobber clobber' +./execute +./execute | grep 'I run successfully' + +: diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index eaaa888..0e586d5 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -353,6 +353,7 @@ distcom2.test \ distcom3.test \ distcom4.test \ distcom5.test \ +dist-hook-perms.test \ distcom-subdir.test \ distdir.test \ distlinks.test \ -- 1.7.9 --------------080709020005020809080800-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 12:57:04 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 17:57:04 +0000 Received: from localhost ([127.0.0.1]:54439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0zOB-0005p3-Bn for submit@debbugs.gnu.org; Fri, 24 Feb 2012 12:57:04 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:25412 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0zO5-0005oU-Ax for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 12:56:59 -0500 Received: from unknown (HELO sms-zimbra-mta-01.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 24 Feb 2012 12:53:39 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTP id D225F17F47; Fri, 24 Feb 2012 12:53:39 -0500 (EST) Received: from sms-zimbra-mta-01.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-01.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JuR+h-Zm2AjO; Fri, 24 Feb 2012 12:53:39 -0500 (EST) Received: from mail.ellipticsemi.com (mail.elliptictech.com [209.217.122.41]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTPSA id 93D3617F45; Fri, 24 Feb 2012 12:53:38 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Fri, 24 Feb 2012 12:53:38 -0500 (EST) Date: Fri, 24 Feb 2012 12:53:38 -0500 From: Nick Bowler To: Stefano Lattarini Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120224175338.GA28076@elliptictech.com> References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F47CAE3.8030600@gmail.com> Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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.9 (-) On 2012-02-24 18:37 +0100, Stefano Lattarini wrote: [...] > On 02/24/2012 08:09 AM, Nick Bowler wrote: > > Automake should at least add user write permissions to all files in > > distdir prior to running dist-hook (and hence prior to generating the > > distribution tarball). > > I disagree; in case the user wants to change the permission of the distributed > files from the ones that they have in the builddir/srcdir, he can do so in the > dist-hook already, with full control (I've just added a tiny test to verify > this behaviour, see attached patch). So we don't need to change the automake > behaviour in this respect (but a documentation improvement might be nice, in > case someone feels like writing it). In that case, the manual should include a note that you should not expect "make dist" to work properly with a read-only source tree. Distcheck should also refrain from testing this. As I mentioned in my original mail, "make distcheck" currently attempts to run "make dist" with a read-only source tree, and it is causing failures in my package because of the broken permissions. Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 13:22:21 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 18:22:21 +0000 Received: from localhost ([127.0.0.1]:54457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0zme-0006U6-Hq for submit@debbugs.gnu.org; Fri, 24 Feb 2012 13:22:21 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]:56473) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S0zmb-0006Ts-RG for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 13:22:19 -0500 Received: by wgbdt14 with SMTP id dt14so2195361wgb.15 for <10878@debbugs.gnu.org>; Fri, 24 Feb 2012 10:19:36 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.180.107.68 as permitted sender) client-ip=10.180.107.68; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.180.107.68 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.180.107.68]) by 10.180.107.68 with SMTP id ha4mr7511946wib.9.1330107576953 (num_hops = 1); Fri, 24 Feb 2012 10:19:36 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=WjxuR3yhg80fxpyvH+q4XL453fQVwwoqC/ySEoeq3cE=; b=FeOQTdle1ywVUoz9O759ce6I4ke+VEKQuF872hs86SduUbpvAvD4WaJbGEItOGZIFP EuUv5tVTrx9y93ZhjI15yYuCE6faHS+Chw7kRZL8AWsQrxL3Yivglynt6KX/W85qgvdP ACgtSW882L/J+21Unz7U3WHOsAha6/zDE2il4= Received: by 10.180.107.68 with SMTP id ha4mr6045252wib.9.1330107576838; Fri, 24 Feb 2012 10:19:36 -0800 (PST) Received: from [87.2.97.83] (host83-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.83]) by mx.google.com with ESMTPS id gf3sm5138808wib.6.2012.02.24.10.19.34 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 10:19:35 -0800 (PST) Message-ID: <4F47D4B4.5020703@gmail.com> Date: Fri, 24 Feb 2012 19:19:32 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> In-Reply-To: <20120224175338.GA28076@elliptictech.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 (--) On 02/24/2012 06:53 PM, Nick Bowler wrote: > On 2012-02-24 18:37 +0100, Stefano Lattarini wrote: > [...] >> On 02/24/2012 08:09 AM, Nick Bowler wrote: >>> Automake should at least add user write permissions to all files in >>> distdir prior to running dist-hook (and hence prior to generating the >>> distribution tarball). >> >> I disagree; in case the user wants to change the permission of the distributed >> files from the ones that they have in the builddir/srcdir, he can do so in the >> dist-hook already, with full control (I've just added a tiny test to verify >> this behaviour, see attached patch). So we don't need to change the automake >> behaviour in this respect (but a documentation improvement might be nice, in >> case someone feels like writing it). > > In that case, the manual should include a note that you should not > expect "make dist" to work properly with a read-only source tree. > But it's the package that expects its distributed files to be writable that is assuming too much; if such package wants its expectation to safely hold, it should add something like this in its 'dist-hook': find $(distdir) -exec chmod u+w '{}' ';' > Distcheck should also refrain from testing this. > Nope; distcheck testing that the distributed package builds correctly with a read-only source tree is a feature, not a bug, since the GCS require this. If you don't care about this requirment, than you need to provide a 'distcheck-hook' that renders your source directory writable before it gets used by "distcheck" (I'll update my patch to have it test also such usage). > As I mentioned in my original mail, "make distcheck" currently attempts > to run "make dist" with a read-only source tree, > As it should do. > and it is causing failures in my package because of the broken > permissions. > HTH, Stefano From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 13:37:25 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 18:37:25 +0000 Received: from localhost ([127.0.0.1]:54477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S101F-0007eD-4I for submit@debbugs.gnu.org; Fri, 24 Feb 2012 13:37:25 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:63509 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S101C-0007dz-I6 for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 13:37:23 -0500 Received: from unknown (HELO sms-zimbra-mta-02.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 24 Feb 2012 13:34:41 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTP id 6EC6687C04; Fri, 24 Feb 2012 13:34:41 -0500 (EST) Received: from sms-zimbra-mta-02.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-02.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iaSbnPPF+Laj; Fri, 24 Feb 2012 13:34:40 -0500 (EST) Received: from mail.ellipticsemi.com (mail.elliptictech.com [209.217.122.41]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTPSA id BA07B87C02; Fri, 24 Feb 2012 13:34:37 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Fri, 24 Feb 2012 13:34:38 -0500 (EST) Date: Fri, 24 Feb 2012 13:34:36 -0500 From: Nick Bowler To: Stefano Lattarini Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120224183436.GA3989@elliptictech.com> References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F47D4B4.5020703@gmail.com> Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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.9 (-) On 2012-02-24 19:19 +0100, Stefano Lattarini wrote: > On 02/24/2012 06:53 PM, Nick Bowler wrote: > > On 2012-02-24 18:37 +0100, Stefano Lattarini wrote: > > [...] > >> On 02/24/2012 08:09 AM, Nick Bowler wrote: > >>> Automake should at least add user write permissions to all files in > >>> distdir prior to running dist-hook (and hence prior to generating the > >>> distribution tarball). > >> > >> I disagree; in case the user wants to change the permission of the distributed > >> files from the ones that they have in the builddir/srcdir, he can do so in the > >> dist-hook already, with full control (I've just added a tiny test to verify > >> this behaviour, see attached patch). So we don't need to change the automake > >> behaviour in this respect (but a documentation improvement might be nice, in > >> case someone feels like writing it). > > > > In that case, the manual should include a note that you should not > > expect "make dist" to work properly with a read-only source tree. > > But it's the package that expects its distributed files to be writable > that is assuming too much; if such package wants its expectation to > safely hold, it should add something like this in its 'dist-hook': > > find $(distdir) -exec chmod u+w '{}' ';' So I've done this now, but note that this is actually harder than you make it out to be. If the package adds prerequisites to the dist-hook target (I find it is generally good practice for -hook and -local targets to use prerequisites with commands instead of putting commands directly in those targets) to the dist-hook target, one would want the permissions to be fixed *before* executing the prerequisite targets. But this cannot be done by simply adding things directly to the dist-hook target. > > Distcheck should also refrain from testing this. > > Nope; distcheck testing that the distributed package builds correctly with > a read-only source tree is a feature, not a bug, since the GCS require this. I'm not talking about building the package, which absolutely should work from a read-only source tree. I'm talking about creating a distribution tarball, with "make dist": something only package maintainers (that's me!) will generally do. As it stands, "make dist" currently does not work properly from a read-only source tree. The tarball generated by my minimal example (an empty Makefile.am!) is clearly broken, and I would not want to be caught distributing such a thing. Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:12:51 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 19:12:51 +0000 Received: from localhost ([127.0.0.1]:54508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10ZW-0000oW-DE for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:12:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:25651) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10ZT-0000oJ-JK for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 14:12:48 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1OJA8sE019760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Feb 2012 14:10:08 -0500 Received: from [10.3.113.113] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1OJA71U018825; Fri, 24 Feb 2012 14:10:07 -0500 Message-ID: <4F47E08F.9040809@redhat.com> Date: Fri, 24 Feb 2012 12:10:07 -0700 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120209 Thunderbird/10.0.1 MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> In-Reply-To: <20120224183436.GA3989@elliptictech.com> X-Enigmail-Version: 1.3.5 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig6848726195DF77E3E68DCCB4" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, 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: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6848726195DF77E3E68DCCB4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/24/2012 11:34 AM, Nick Bowler wrote: >> But it's the package that expects its distributed files to be writable= >> that is assuming too much; if such package wants its expectation to >> safely hold, it should add something like this in its 'dist-hook': >> >> find $(distdir) -exec chmod u+w '{}' ';' I agree. >=20 > I'm not talking about building the package, which absolutely should wor= k > from a read-only source tree. I'm talking about creating a distributio= n > tarball, with "make dist": something only package maintainers (that's > me!) will generally do. That's where we are arguing that you are wrong. The GNU Coding Standards requires that _anyone_ can run 'make dist', and not just 'package maintainers'. That's the whole point of software freedom: You, as a recipient of the tarball, should be just as free to redistribute your modifications (including rebuilding a tarball) as the upstream maintainer you got the package from, even if you are starting from your (possibly read-only) copy of the expanded tarball. Which is _why_ 'make distcheck' intentionally checks that 'make dist' from a read-only source tarball will accurately create a tarball. This is a _feature_ of automake's 'make distcheck'. If you want to guarantee that the generated tarball has certain permissions, then you, as the package author, must add something in your dist-hook to guarantee it, since automake cannot know which files you _need_ to leave writable. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig6848726195DF77E3E68DCCB4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPR+CPAAoJEKeha0olJ0NqDasH+QENH1Raazsw/HiFUb7o/XtU IB4lp59Nmrv241fVCeBRigTwxEbfbT5FW1eiTPbPUF5K7Zrxywb95xVHuVPlF2L9 q6fMMIyQGvKaKyYYiuFgBkcL6cSA0/zosw6pUt2Sl3Zpqlyku+l3K71CO8bMNJHU Lon6rqHqfiNjeD63or8Y37Slh0qfrG8VVlvozVIpMMS6gz+zY0kF48scBSc5m6Ih KBAVmtSRCm1a4wROJa4No2dJnGPjlqXnUqvptgTnCddME/HhlyPK4ycpD7w9dtxp 8IW2wO4exbayet/VMpZTqErpLJt8LmA0KoyOvM3Rqv7Fu2JL5Ec2cKvV2BBwFBU= =cFOc -----END PGP SIGNATURE----- --------------enig6848726195DF77E3E68DCCB4-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:28:18 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 19:28:18 +0000 Received: from localhost ([127.0.0.1]:54517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10oT-0001AA-T3 for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:28:18 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:46895) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10oP-00019w-KQ for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 14:28:15 -0500 Received: by eekc41 with SMTP id c41so1547344eek.3 for <10878@debbugs.gnu.org>; Fri, 24 Feb 2012 11:25:32 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.2.78 as permitted sender) client-ip=10.213.2.78; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.2.78 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.213.2.78]) by 10.213.2.78 with SMTP id 14mr1156941ebi.67.1330111532330 (num_hops = 1); Fri, 24 Feb 2012 11:25:32 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=HsjY3jxQYDKnc/hvHHIduayJLtRYTbS2Mtuo/msHfnY=; b=BY2GklzvRs0U6g/TG7MwQrQyk0gDCmDzZ5KRvY8QwhBWGQlYPAVE6x9L3JO/5pMluH SczVUxwZN2pS6rjPQ/bu/FmN7pQ0QwQ83TL3eJGGAYSpvEQ84yJLF2zMwF0cZYx0BLvG 1aU/9p2TAGjqyp5TsrqxRYp0mG8Gqjo7QcajM= Received: by 10.213.2.78 with SMTP id 14mr861815ebi.67.1330111532209; Fri, 24 Feb 2012 11:25:32 -0800 (PST) Received: from [87.2.97.83] (host83-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.83]) by mx.google.com with ESMTPS id o49sm21430329eeb.7.2012.02.24.11.25.30 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 11:25:31 -0800 (PST) Message-ID: <4F47E428.7040306@gmail.com> Date: Fri, 24 Feb 2012 20:25:28 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> In-Reply-To: <20120224183436.GA3989@elliptictech.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 (--) On 02/24/2012 07:34 PM, Nick Bowler wrote: > > On 2012-02-24 19:19 +0100, Stefano Lattarini wrote: >> >> But it's the package that expects its distributed files to be writable >> that is assuming too much; if such package wants its expectation to >> safely hold, it should add something like this in its 'dist-hook': >> >> find $(distdir) -exec chmod u+w '{}' ';' > > So I've done this now, but note that this is actually harder than you > make it out to be. > True, but only a little ... > If the package adds prerequisites to the dist-hook target ... [SNIP] > ... you can do this: make-distdir-writable: find $(distdir) -exec chmod u+w '{}' ';' dist_hook_prereqs = foo bar dist-hook: $(dist_hook_prereqs) $(dist_hook_prereqs): make-distdir-writable > (I find it is generally good practice for -hook and -local > targets to use prerequisites with commands instead of putting commands > directly in those targets) > JFTR, I agree. > to the dist-hook target, one would want the > permissions to be fixed *before* executing the prerequisite targets. > But this cannot be done by simply adding things directly to the > dist-hook target. > >>> Distcheck should also refrain from testing this. >> >> Nope; distcheck testing that the distributed package builds correctly with >> a read-only source tree is a feature, not a bug, since the GCS require this. > > I'm not talking about building the package, which absolutely should work > from a read-only source tree. I'm talking about creating a distribution > tarball, > But the distribution tarball created by automake *won't* have write permissions stripped (assuming they were present in the first place, of course). > with "make dist": something only package maintainers (that's > me!) will generally do. > > As it stands, "make dist" currently does not work properly from a > read-only source tree. > I honestly don't see why not; if you don't want to put readonly files in the distributed tarball, don't create the tarball from a readonly srcdir. It's not like automake is removing the write permissions itslef (now, that would quite be a bug!); it's you who have removed it before creating the tarball: % tar xf test-1.0.tar.gz % chmod -R a-w test-1.0 # <-- !HERE! % mkdir build && cd build % ../test-1.0/configure && make dist % tar tvf test-1.0.tar.gz To stress this again: if *you* had removed the executable bit from your test scripts, would you blame it on automake if "make distcheck" stopped working? I don't think so. > The tarball generated by my minimal example (an empty Makefile.am!) is > clearly broken, and I would not want to be caught distributing such a thing. > > Cheers, Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:37:37 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 19:37:37 +0000 Received: from localhost ([127.0.0.1]:54530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10xU-0001O2-6y for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:37:36 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:6087 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10xR-0001Np-9G for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 14:37:34 -0500 Received: from unknown (HELO sms-zimbra-mta-01.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 24 Feb 2012 14:34:52 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTP id 345A717F48; Fri, 24 Feb 2012 14:34:52 -0500 (EST) Received: from sms-zimbra-mta-01.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-01.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y3qjcgQay7G5; Fri, 24 Feb 2012 14:34:51 -0500 (EST) Received: from mail.ellipticsemi.com (dsl-67-204-24-19.acanac.net [67.204.24.19]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTPSA id 977DF17F47; Fri, 24 Feb 2012 14:34:50 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Fri, 24 Feb 2012 14:34:50 -0500 (EST) Date: Fri, 24 Feb 2012 14:34:49 -0500 From: Nick Bowler To: Eric Blake Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120224193449.GA8140@elliptictech.com> References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E08F.9040809@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F47E08F.9040809@redhat.com> Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, 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: -1.9 (-) On 2012-02-24 12:10 -0700, Eric Blake wrote: > On 02/24/2012 11:34 AM, Nick Bowler wrote: > >> But it's the package that expects its distributed files to be writable > >> that is assuming too much; if such package wants its expectation to > >> safely hold, it should add something like this in its 'dist-hook': > >> > >> find $(distdir) -exec chmod u+w '{}' ';' > > I agree. > > > > > I'm not talking about building the package, which absolutely should work > > from a read-only source tree. I'm talking about creating a distribution > > tarball, with "make dist": something only package maintainers (that's > > me!) will generally do. > > That's where we are arguing that you are wrong. The GNU Coding > Standards requires that _anyone_ can run 'make dist', and not just > 'package maintainers'. OK, but I was responding to a part of Stefano's message (which you elided) which said "... *builds* correctly with a read-only source tree" (emphasis added). Regardless, I cannot find where this supposed GCS requirement for "make dist" (or even ordinary builds, for that matter) to work on read-only source trees comes from. Do you have a reference? > That's the whole point of software freedom: You, as a recipient of the > tarball, should be just as free to redistribute your modifications > (including rebuilding a tarball) as the upstream maintainer you got > the package from, even if you are starting from your (possibly > read-only) copy of the expanded tarball. If someone is redistributing modifications, then presumably they have a writable source tree in order to create their modifications in the first place. They can then run "make dist" from the modified tree. When the files in a tarball are read-only, however, users who want to modify source files are presented with a totally gratuitous (and frustrating!) extra step. I also didn't say anything about any "upstream maintainer": when someone is distributing a modified version, then they are for all intents and purposes a maintainer of their own version. People creating a distribution tarball from modified sources can reasonably expect to require extra tools or setup over and above what's required to merely build the package. For example, they will probably need to have GNU Automake installed. > Which is _why_ 'make distcheck' intentionally checks that 'make dist' > from a read-only source tarball will accurately create a tarball. It checks that it creates a tarball, but as I mentioned in another paragraph (which you elided), it does not check that the tarball is accurate. In my original example, "make distcheck" failed to notice that the generated tarball was wrong: i.e., it was not the same as the original tarball it was testing. > This is a _feature_ of automake's 'make distcheck'. If you want to > guarantee that the generated tarball has certain permissions, then > you, as the package author, must add something in your dist-hook to > guarantee it, since automake cannot know which files you _need_ to > leave writable. The answer is: all of them! Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:37:56 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 19:37:56 +0000 Received: from localhost ([127.0.0.1]:54533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10xo-0001OX-3P for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:37:56 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:48097) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S10xk-0001OJ-My for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 14:37:54 -0500 Received: by eekc41 with SMTP id c41so1552223eek.3 for <10878@debbugs.gnu.org>; Fri, 24 Feb 2012 11:35:11 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.194.136 as permitted sender) client-ip=10.14.194.136; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.194.136 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.194.136]) by 10.14.194.136 with SMTP id m8mr2196753een.97.1330112111966 (num_hops = 1); Fri, 24 Feb 2012 11:35:11 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=Zzwr+NTihI0XvxxvwPaJ60hCSt/3GnyMYx2ekFIckKA=; b=NQgH+XWLct6wgfxluVMDa0lYtUovBnhgs4al82/uSryEfqU3+tSoVIrDJed6tNSgd7 /jFQaoszt0jfFzGxo0aFex4MbmpseTsF+W+8oB14s4sCADnZ6DMRbC13uKLUpK8C4RDD S7DHHVwjwtfk/AshK2UqKN57rz0hUGukI/n6A= Received: by 10.14.194.136 with SMTP id m8mr1651825een.97.1330112111845; Fri, 24 Feb 2012 11:35:11 -0800 (PST) Received: from [87.2.97.83] (host83-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.83]) by mx.google.com with ESMTPS id w60sm21559773eeb.4.2012.02.24.11.35.08 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 11:35:09 -0800 (PST) Message-ID: <4F47E66A.5060402@gmail.com> Date: Fri, 24 Feb 2012 20:35:06 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> In-Reply-To: <4F47E428.7040306@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 (--) On 02/24/2012 08:25 PM, Stefano Lattarini wrote: > (I'll update my patch to have it test also such usage). > And here it is the updated patch. I will push it shortly if there is no objection. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:41:57 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 19:41:57 +0000 Received: from localhost ([127.0.0.1]:54543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S111g-0001X4-JG for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:41:57 -0500 Received: from mail-ey0-f172.google.com ([209.85.215.172]:34186) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S111c-0001Wo-HA for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 14:41:54 -0500 Received: by eaal12 with SMTP id l12so1568885eaa.3 for <10878@debbugs.gnu.org>; Fri, 24 Feb 2012 11:39:11 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.95.208 as permitted sender) client-ip=10.14.95.208; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.95.208 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.95.208]) by 10.14.95.208 with SMTP id p56mr2186180eef.129.1330112351572 (num_hops = 1); Fri, 24 Feb 2012 11:39:11 -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:cc:subject:references :in-reply-to:content-type; bh=QbQw9DfAbz7C9bA6RzfLBt7ParZXcnasbYC9X56pTO0=; b=rvwGiCqdUJ8oOPEmUaAaH2GR6rsbevj4/rVBVN140erkFzA37aPZZQ75qjZqlC4VXQ 3a93JZkZ0V54CMQ0ON/PdV5fLISHtFKvGdYKDaljUs9Ud22aaLM7v7HbBJZc1roIDhIX v+ZJOdxJ8nXf3xeV8fSnhnWO3xH4OEmQFMXu0= Received: by 10.14.95.208 with SMTP id p56mr1640068eef.129.1330112351504; Fri, 24 Feb 2012 11:39:11 -0800 (PST) Received: from [87.2.97.83] (host83-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.83]) by mx.google.com with ESMTPS id v51sm21617867eef.2.2012.02.24.11.39.09 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 11:39:10 -0800 (PST) Message-ID: <4F47E75A.2090809@gmail.com> Date: Fri, 24 Feb 2012 20:39:06 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <4F47E66A.5060402@gmail.com> In-Reply-To: <4F47E66A.5060402@gmail.com> Content-Type: multipart/mixed; boundary="------------090508060603000803000301" X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 a multi-part message in MIME format. --------------090508060603000803000301 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 02/24/2012 08:35 PM, Stefano Lattarini wrote: > On 02/24/2012 08:25 PM, Stefano Lattarini wrote: >> (I'll update my patch to have it test also such usage). >> > And here it is the updated patch. I will push it shortly if there is > no objection. > Maybe it would have been nice actually attaching the patch ... ;-) Sorry for the confusion, Stefano --------------090508060603000803000301 Content-Type: text/x-diff; name="0001-coverage-dist-hook-and-distcheck-hook-can-modify-fil.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-coverage-dist-hook-and-distcheck-hook-can-modify-fil.pa"; filename*1="tch" >From 8f6a79c2a4ff5557142b552c96cfa171e43f52ab Mon Sep 17 00:00:00 2001 Message-Id: <8f6a79c2a4ff5557142b552c96cfa171e43f52ab.1330112034.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Fri, 24 Feb 2012 18:34:04 +0100 Subject: [PATCH] coverage: dist-hook and distcheck-hook can modify file permission See automake bug#10878. * tests/dist-hook-perms.test: New test, checking that the user can use the 'dist-hook' target to modify permissions of distributed files before putting them in the distribution tarball. * tests/distcheck-writable-srcdir.test: New test, checking that the user can use 'distcheck-hook' to ensure his packages is built by "make distcheck" with a writable srcdir. This goes against the GNU Coding Standards, but some package authors might not care about them too much, and it's nice to support their use case too. * tests/list-of-tests.mk: Add them. --- tests/distcheck-writable-srcdir.test | 48 +++++++++++++++++++++++++++ tests/disthook-perms.test | 59 ++++++++++++++++++++++++++++++++++ tests/list-of-tests.mk | 2 + 3 files changed, 109 insertions(+), 0 deletions(-) create mode 100755 tests/distcheck-writable-srcdir.test create mode 100755 tests/disthook-perms.test diff --git a/tests/distcheck-writable-srcdir.test b/tests/distcheck-writable-srcdir.test new file mode 100755 index 0000000..bbc50f4 --- /dev/null +++ b/tests/distcheck-writable-srcdir.test @@ -0,0 +1,48 @@ +#! /bin/sh +# Copyright (C) 2012 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 the user abuse 'distcheck-hook' to ensure his packages +# is built by "make distcheck" with a writable srcdir. This goes +# against the GNU Coding Standards, but some package authors might +# not care about them too much, and it's nice to support their use +# case too (since it doesn't cost us anything but this test). +# See automake bug#10878. + +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +EXTRA_DIST = old +distcheck-hook: + find $(distdir) -exec chmod u+w '{}' ';' +check-local: + test -f $(srcdir)/old + test ! -f $(srcdir)/new + test ! -r $(srcdir)/new +## Don't do this in real life, or I'll kill you. + echo foo > $(srcdir)/old + echo bar > $(srcdir)/new +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF +./configure +: > old +$MAKE distcheck + +: diff --git a/tests/disthook-perms.test b/tests/disthook-perms.test new file mode 100755 index 0000000..a5f0acb --- /dev/null +++ b/tests/disthook-perms.test @@ -0,0 +1,59 @@ +#! /bin/sh +# Copyright (C) 2012 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 the user can use the 'dist-hook' target to modify +# permissions of distributed files before putting them in the +# distribution tarball. See automake bug#10878. + +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +EXTRA_DIST = write execute +dist-hook: + chmod u+w $(distdir)/write + chmod u+x $(distdir)/execute +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure + +echo Will be clobbered > write +cat > execute <<'END' +#!/bin/sh +echo I run successfully +END + +chmod a-w write +chmod a-x execute + +$MAKE +$MAKE dist + +test -f $distdir.tar.gz +gzip -dc $distdir.tar.gz | tar xvf - + +cd $distdir +echo clobber clobber > write +cat write | grep 'clobber clobber' +./execute +./execute | grep 'I run successfully' + +: diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index eaaa888..e6c87c4 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -353,6 +353,7 @@ distcom2.test \ distcom3.test \ distcom4.test \ distcom5.test \ +dist-hook-perms.test \ distcom-subdir.test \ distdir.test \ distlinks.test \ @@ -363,6 +364,7 @@ distcheck-configure-flags-am.test \ distcheck-configure-flags-subpkg.test \ distcheck-hook.test \ distcheck-hook2.test \ +distcheck-writable-srcdir.test \ distcheck-missing-m4.test \ distcheck-outdated-m4.test \ distcheck-override-infodir.test \ -- 1.7.9 --------------090508060603000803000301-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 14:51:04 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 19:51:04 +0000 Received: from localhost ([127.0.0.1]:54559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S11AU-0001kT-KZ for submit@debbugs.gnu.org; Fri, 24 Feb 2012 14:51:03 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:34885) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S11AQ-0001k0-Gi for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 14:51:00 -0500 Received: by eekc41 with SMTP id c41so1558425eek.3 for <10878@debbugs.gnu.org>; Fri, 24 Feb 2012 11:48:17 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.202.130 as permitted sender) client-ip=10.14.202.130; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.202.130 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.202.130]) by 10.14.202.130 with SMTP id d2mr2255654eeo.83.1330112897673 (num_hops = 1); Fri, 24 Feb 2012 11:48:17 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=ArMpCBJSRp7jCF3dmATikDn+rJzr1bwiRxoVU3Kwv+0=; b=xYIsFpybtpMA4QTNPuRh2l2cK8J73FcFDo1HsvOVipihq6vNihrpNileff01VXlAvr tmsI0UsKsfJNXoOFlJGFXCbxhDyC1n4qoONUpz5aYRbta9FEVd4TPhd4I3FtrH+e7WCb a7/1cnGn9HK/PiUF1bmuwr9gSoannZ+J0oNLQ= Received: by 10.14.202.130 with SMTP id d2mr1677398eeo.83.1330112897582; Fri, 24 Feb 2012 11:48:17 -0800 (PST) Received: from [87.2.97.83] (host83-97-dynamic.2-87-r.retail.telecomitalia.it. [87.2.97.83]) by mx.google.com with ESMTPS id r5sm9315803eef.6.2012.02.24.11.48.15 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 11:48:16 -0800 (PST) Message-ID: <4F47E97D.4010007@gmail.com> Date: Fri, 24 Feb 2012 20:48:13 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E08F.9040809@redhat.com> <20120224193449.GA8140@elliptictech.com> In-Reply-To: <20120224193449.GA8140@elliptictech.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 (--) On 02/24/2012 08:34 PM, Nick Bowler wrote: > > On 2012-02-24 12:10 -0700, Eric Blake wrote: > > [BIG SNIP] > >> Which is _why_ 'make distcheck' intentionally checks that 'make dist' >> from a read-only source tarball will accurately create a tarball. > > It checks that it creates a tarball, but as I mentioned in another > paragraph (which you elided), it does not check that the tarball is > accurate. > Well, it tries at least, by checking common symptoms for inaccuracy (failure to build with a read-only source tree, "make distclean" leaving files in the build tree, "make dist" failing from an extracted tarball, ...). Of course, it cannot be perfect, and there are tons of subtle potential breakages it won't catch; but IMHO it does a good work overall. > In my original example, "make distcheck" failed to notice that > the generated tarball was wrong: i.e., it was not the same as the > original tarball it was testing. > How so? Honest question, that doesn't seem clear from your descriptions and explanations so far. >> This is a _feature_ of automake's 'make distcheck'. If you want to >> guarantee that the generated tarball has certain permissions, then >> you, as the package author, must add something in your dist-hook to >> guarantee it, since automake cannot know which files you _need_ to >> leave writable. > > The answer is: all of them! > In light of our discussion so far, implementing this would seems like a gratuitous modification to me. Let me explain why. Both the existing behaviour and the one you propose are non-broken and have their merits, and both would be quite easy to implement on a per-project basis if the other behaviour were the default. Given this consideration, for the sake of simplicity and backward-compatibility, I simply prefer to leave the pre-existing behaviour in place. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 15:17:53 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 20:17:53 +0000 Received: from localhost ([127.0.0.1]:54578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S11aR-0002MW-FL for submit@debbugs.gnu.org; Fri, 24 Feb 2012 15:17:52 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:37267 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S11aN-0002MG-Kl for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 15:17:50 -0500 Received: from unknown (HELO sms-zimbra-mta-02.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 24 Feb 2012 15:15:06 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTP id ED2904C07C; Fri, 24 Feb 2012 15:15:05 -0500 (EST) Received: from sms-zimbra-mta-02.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-02.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xQU1oHwrP-C1; Fri, 24 Feb 2012 15:15:04 -0500 (EST) Received: from mail.ellipticsemi.com (mail.elliptictech.com [209.217.122.41]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTPSA id CD75187BFE; Fri, 24 Feb 2012 15:15:02 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Fri, 24 Feb 2012 15:15:02 -0500 (EST) Date: Fri, 24 Feb 2012 15:15:02 -0500 From: Nick Bowler To: Stefano Lattarini Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120224201502.GA8267@elliptictech.com> References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F47E428.7040306@gmail.com> Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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.9 (-) On 2012-02-24 20:25 +0100, Stefano Lattarini wrote: > On 02/24/2012 07:34 PM, Nick Bowler wrote: > > > > On 2012-02-24 19:19 +0100, Stefano Lattarini wrote: > >> > >> But it's the package that expects its distributed files to be writable > >> that is assuming too much; if such package wants its expectation to > >> safely hold, it should add something like this in its 'dist-hook': > >> > >> find $(distdir) -exec chmod u+w '{}' ';' > > > > So I've done this now, but note that this is actually harder than you > > make it out to be. > > > True, but only a little ... > > > If the package adds prerequisites to the dist-hook target ... [SNIP] > > > ... you can do this: > > make-distdir-writable: > find $(distdir) -exec chmod u+w '{}' ';' > dist_hook_prereqs = foo bar > dist-hook: $(dist_hook_prereqs) > $(dist_hook_prereqs): make-distdir-writable Yes, this is more or less what I did. The annoying thing is that now one needs to embed knowledge about either "make-distdir-writable" or "dist_hook_prereqs" into multiple locations in the makefile. > > (I find it is generally good practice for -hook and -local > > targets to use prerequisites with commands instead of putting commands > > directly in those targets) > > > JFTR, I agree. Interestingly, I find no mention at all of this trick in the automake manual. I'm sure I read about it in _some_ manual, I wonder which it was? > >>> Distcheck should also refrain from testing this. [...] > > As it stands, "make dist" currently does not work properly from a > > read-only source tree. > > I honestly don't see why not; if you don't want to put readonly files in > the distributed tarball, don't create the tarball from a readonly srcdir. > It's not like automake is removing the write permissions itslef (now, > that would quite be a bug!); it's you who have removed it before creating > the tarball: > > % tar xf test-1.0.tar.gz > % chmod -R a-w test-1.0 # <-- !HERE! So I agree that, in the example I posted, it was a direct consequence of my actions. When I first posted I assumed that non-user-writable files in tarballs was universally undesirable, so I only tried to demonstrate that. Clearly that is not the case, and people really do want to include read-only files in their tarballs. I think such policy decisions belong in dist-hook rather than according to whatever the current state of the source tree happens to be, but I guess it can't be changed now without introducing regressions. So let's actually put some stuff in Makefile.am to demonstrate something closer to the problem I'm having. % cat >Makefile.am <<'EOF' EXTRA_DIST = foo dist-hook: echo bar > $(distdir)/foo EOF % cat >foo <<'EOF' EOF % autoreconf -is % ./configure && make distcheck [...] make \ top_distdir="test-1.0" distdir="test-1.0" \ dist-hook make[2]: Entering directory `/tmp/testcase/test-1.0/_build' echo bar > test-1.0/foo /bin/sh: test-1.0/foo: Permission denied > % mkdir build && cd build > % ../test-1.0/configure && make dist > % tar tvf test-1.0.tar.gz This was just a minimal example. The real problem is that "make distcheck" does something isomorphic to the above, and expects it to work. If your dist-hook modifies distdir, then it does not work (my particular issue was actually way more specific than the above: the dist-hook would actually work properly most of the time. It only failed when srcdir was read-only and distdir was on a certain NFS mount on my laptop...). > To stress this again: if *you* had removed the executable bit from your > test scripts, would you blame it on automake if "make distcheck" stopped > working? I don't think so. No, but if "make distcheck" was doing the removal, as is the case here, then I *would* blame automake. (Aside: I actually ran into the exact problem of executable bits being stripped by a different build system, but I digress). Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 15:38:53 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 20:38:53 +0000 Received: from localhost ([127.0.0.1]:54591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S11um-0002qU-HT for submit@debbugs.gnu.org; Fri, 24 Feb 2012 15:38:52 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:46102 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S11uj-0002qE-Iw for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 15:38:50 -0500 Received: from unknown (HELO sms-zimbra-mta-02.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 24 Feb 2012 15:36:08 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTP id 524BB87BFE; Fri, 24 Feb 2012 15:36:08 -0500 (EST) Received: from sms-zimbra-mta-02.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-02.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3q0g37tKqEFR; Fri, 24 Feb 2012 15:36:02 -0500 (EST) Received: from mail.ellipticsemi.com (dsl-67-204-24-19.acanac.net [67.204.24.19]) by sms-zimbra-mta-02.sms.scalar.ca (Postfix) with ESMTPSA id 39C6B4C080; Fri, 24 Feb 2012 15:36:01 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Fri, 24 Feb 2012 15:36:01 -0500 (EST) Date: Fri, 24 Feb 2012 15:36:00 -0500 From: Nick Bowler To: Stefano Lattarini Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120224203600.GB8267@elliptictech.com> References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <4F47E66A.5060402@gmail.com> <4F47E75A.2090809@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F47E75A.2090809@gmail.com> Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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.9 (-) On 2012-02-24 20:39 +0100, Stefano Lattarini wrote: > On 02/24/2012 08:35 PM, Stefano Lattarini wrote: > > On 02/24/2012 08:25 PM, Stefano Lattarini wrote: > >> (I'll update my patch to have it test also such usage). > >> > > And here it is the updated patch. I will push it shortly if there is > > no objection. > > > Maybe it would have been nice actually attaching the patch ... ;-) > > Sorry for the confusion, > Stefano > From 8f6a79c2a4ff5557142b552c96cfa171e43f52ab Mon Sep 17 00:00:00 2001 > Message-Id: <8f6a79c2a4ff5557142b552c96cfa171e43f52ab.1330112034.git.stefano.lattarini@gmail.com> > From: Stefano Lattarini > Date: Fri, 24 Feb 2012 18:34:04 +0100 > Subject: [PATCH] coverage: dist-hook and distcheck-hook can modify file > permission > > See automake bug#10878. > > * tests/dist-hook-perms.test: New test, checking that the user can > use the 'dist-hook' target to modify permissions of distributed > files before putting them in the distribution tarball. > * tests/distcheck-writable-srcdir.test: New test, checking that the > user can use 'distcheck-hook' to ensure his packages is built by > "make distcheck" with a writable srcdir. This goes against the GNU > Coding Standards, but some package authors might not care about > them too much, and it's nice to support their use case too. FWIW, I really do care about being able to build the package from a read-only srcdir, and I absolutely want to make sure it works. So it's great that distcheck tests this. I would even be happy for "make dist" to work in this scenario, and it does with a hook to fix up the permissions (modulo the increased maintainence burden described elsethread), so I suppose I'll just have to stick with that. I use the rule that no part of the build should write to srcdir, ever: so it should be possible to do a successful VPATH build with a maintainer-cleaned, read-only srcdir. I believe this actually goes above and beyond what Automake provides. The exception to this is during initial bootstrap after checkout from git, which must write to srcdir for obvious reasons. (Aside: I just tested this and discovered that there was a source file missing from the distribution that distcheck didn't notice because only maintainer-clean builds failed. Oops!) Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 18:14:31 2012 Received: (at 10878) by debbugs.gnu.org; 24 Feb 2012 23:14:31 +0000 Received: from localhost ([127.0.0.1]:54682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S14LP-0006N1-13 for submit@debbugs.gnu.org; Fri, 24 Feb 2012 18:14:31 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:41499) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S14LL-0006Mm-S3 for 10878@debbugs.gnu.org; Fri, 24 Feb 2012 18:14:29 -0500 Received: by eekc41 with SMTP id c41so1641661eek.3 for <10878@debbugs.gnu.org>; Fri, 24 Feb 2012 15:11:45 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.95.202 as permitted sender) client-ip=10.14.95.202; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.95.202 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.95.202]) by 10.14.95.202 with SMTP id p50mr2514878eef.78.1330125105864 (num_hops = 1); Fri, 24 Feb 2012 15:11:45 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=64imp8//glUfKKeafPJUy5tZLshqnBpcZDQx/XEFXtc=; b=F39CtKHuDzV6tOiHfzxsZKSnumLe6QUxaE8sDMLNZ9WljUjkoswgsOOxqSsVqNg0Z/ +HWV/6SHdteYRiDXxCXuOhdA5/uJwIGskkLvNF690WY6BFAy0FF3zNsKfs2btS2Cx6xu npLnC0aqcyXyYQRZmjZW/f5G9lUHytP0Kj5xc= Received: by 10.14.95.202 with SMTP id p50mr1872188eef.78.1330125105619; Fri, 24 Feb 2012 15:11:45 -0800 (PST) Received: from [87.4.96.199] (host199-96-dynamic.4-87-r.retail.telecomitalia.it. [87.4.96.199]) by mx.google.com with ESMTPS id u9sm23616933eem.11.2012.02.24.15.11.42 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 15:11:44 -0800 (PST) Message-ID: <4F481926.2080405@gmail.com> Date: Sat, 25 Feb 2012 00:11:34 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <20120224201502.GA8267@elliptictech.com> In-Reply-To: <20120224201502.GA8267@elliptictech.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 (--) On 02/24/2012 09:15 PM, Nick Bowler wrote: > > On 2012-02-24 20:25 +0100, Stefano Lattarini wrote: > >> On 02/24/2012 07:34 PM, Nick Bowler wrote: >> >>> (I find it is generally good practice for -hook and -local >>> targets to use prerequisites with commands instead of putting commands >>> directly in those targets) >>> >> JFTR, I agree. > > Interestingly, I find no mention at all of this trick in the automake > manual. > Because it's not a trick, but a matter of preference :-) Preference that we apparently share, but which doesn't necessarily need not to be shared by other people. > I'm sure I read about it in _some_ manual, I wonder which it was? > No idea here, sorry. > So let's actually put some stuff in Makefile.am to demonstrate something > closer to the problem I'm having. > > % cat >Makefile.am <<'EOF' > EXTRA_DIST = foo > > dist-hook: > echo bar > $(distdir)/foo > EOF > > % cat >foo <<'EOF' > EOF > > % autoreconf -is > % ./configure && make distcheck > [...] > make \ > top_distdir="test-1.0" distdir="test-1.0" \ > dist-hook > make[2]: Entering directory `/tmp/testcase/test-1.0/_build' > echo bar > test-1.0/foo > /bin/sh: test-1.0/foo: Permission denied > Ah, this is a better example. Indeed we have a problem here (at the very least a documentation one). I'm thus re-opening this bug report. >> To stress this again: if *you* had removed the executable bit from your >> test scripts, would you blame it on automake if "make distcheck" stopped >> working? I don't think so. > > No, but if "make distcheck" was doing the removal, as is the case here, > then I *would* blame automake. > Fair enough. Maybe we should explicitly document the "make distcheck" behaviour in more details (including your example) ... Thanks, Stefano From unknown Sat Aug 16 15:54:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: Did not alter fixed versions and reopened. Date: Fri, 24 Feb 2012 23:15:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # Did not alter fixed versions and reopened. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 18:14:34 2012 Received: (at control) by debbugs.gnu.org; 24 Feb 2012 23:14:34 +0000 Received: from localhost ([127.0.0.1]:54685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S14LR-0006NE-Bi for submit@debbugs.gnu.org; Fri, 24 Feb 2012 18:14:33 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:49362) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S14LP-0006Mr-HU for control@debbugs.gnu.org; Fri, 24 Feb 2012 18:14:32 -0500 Received: by eekc41 with SMTP id c41so1641677eek.3 for ; Fri, 24 Feb 2012 15:11:49 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.100.80 as permitted sender) client-ip=10.14.100.80; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.100.80 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.100.80]) by 10.14.100.80 with SMTP id y56mr2610944eef.68.1330125109978 (num_hops = 1); Fri, 24 Feb 2012 15:11:49 -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=wom09Jd5b1MsU5lF83dAwxQ1ROw+qtBN/cQZSOHfBq8=; b=LHe+zljlq+rwif2+/pfuIjTGXUdiq9q8pjZxZfOV9y1+tkSFv8tKQFWJ5PGnBB/wSg 65i7OJ55CEXMyTC+i970cbFw2KFfkb/yB7aihfcAEY4/dKfWxpBXcfWAw0LbSG3YAozb OqHTKpKGMYgXu/L3hldXePhqnMnuMyY328ZJ8= Received: by 10.14.100.80 with SMTP id y56mr1941779eef.68.1330125109912; Fri, 24 Feb 2012 15:11:49 -0800 (PST) Received: from [87.4.96.199] (host199-96-dynamic.4-87-r.retail.telecomitalia.it. [87.4.96.199]) by mx.google.com with ESMTPS id u9sm23619372eem.11.2012.02.24.15.11.48 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 15:11:48 -0800 (PST) Message-ID: <4F481933.2070205@gmail.com> Date: Sat, 25 Feb 2012 00:11:47 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: 10878 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) 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: -2.6 (--) reopen 10878 tags 10878 - wontfix severity 10878 thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 24 18:15:01 2012 Received: (at control) by debbugs.gnu.org; 24 Feb 2012 23:15:01 +0000 Received: from localhost ([127.0.0.1]:54688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S14Ls-0006Nv-16 for submit@debbugs.gnu.org; Fri, 24 Feb 2012 18:15:01 -0500 Received: from mail-ey0-f172.google.com ([209.85.215.172]:36527) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S14Lp-0006Ni-Ug for control@debbugs.gnu.org; Fri, 24 Feb 2012 18:14:58 -0500 Received: by eaal12 with SMTP id l12so1656588eaa.3 for ; Fri, 24 Feb 2012 15:12:16 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.99.1 as permitted sender) client-ip=10.14.99.1; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.99.1 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.99.1]) by 10.14.99.1 with SMTP id w1mr2622818eef.49.1330125136286 (num_hops = 1); Fri, 24 Feb 2012 15:12:16 -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=wEyWzYV5Mqz8H707ChQojagibjenW7AzJxHCgriinBE=; b=SjIcz9X6Eq7JpCK+260IPV2lO2oa3NjDMx2hm0vrjYXvTjQEh9gFd8QyjnqTCSmMCm FJGfDYjx3A0gU1vvLHk3JQvZU7/LlzFsohd2raap6KE+z8w9l4AGJoVm6HtUaTnCQdtF p0raxyfZ6KX6oJ2iJghkZOx2aTXcM6Gkv/kRA= Received: by 10.14.99.1 with SMTP id w1mr1945425eef.49.1330125136217; Fri, 24 Feb 2012 15:12:16 -0800 (PST) Received: from [87.4.96.199] (host199-96-dynamic.4-87-r.retail.telecomitalia.it. [87.4.96.199]) by mx.google.com with ESMTPS id o49sm23660052eeb.7.2012.02.24.15.12.13 (version=SSLv3 cipher=OTHER); Fri, 24 Feb 2012 15:12:14 -0800 (PST) Message-ID: <4F48194C.7060703@gmail.com> Date: Sat, 25 Feb 2012 00:12:12 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: x Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) 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: -2.6 (--) severity 10878 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 07:44:17 2012 Received: (at 10878) by debbugs.gnu.org; 25 Feb 2012 12:44:17 +0000 Received: from localhost ([127.0.0.1]:55252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1Gz2-0006Wl-Tw for submit@debbugs.gnu.org; Sat, 25 Feb 2012 07:44:17 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:38494) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1Gz0-0006We-Ab for 10878@debbugs.gnu.org; Sat, 25 Feb 2012 07:44:15 -0500 Received: by eeke51 with SMTP id e51so170251eek.3 for <10878@debbugs.gnu.org>; Sat, 25 Feb 2012 04:41:34 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.186.12 as permitted sender) client-ip=10.14.186.12; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.186.12 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.186.12]) by 10.14.186.12 with SMTP id v12mr3749322eem.31.1330173694146 (num_hops = 1); Sat, 25 Feb 2012 04:41:34 -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:cc:subject:references :in-reply-to:content-type; bh=bwjdlk60A6PdDxGWpbiMZ+46X//VItTLLa+bnySGwSU=; b=ctigTFi29/H3pTOotXxd9eqM4brqh0GyRnwjlNQbdFLmK1w2+IjoKCbAIRWUBonXvM Kf8HrEKTdnyTkkb1EH10rotXWg+RNoY8HsYR2rYdiEXE3TUVNavXLm/vntiqta8R55jS uGPdbPofRqx7HlA/gsLBRcOirljq0O6djr3LA= Received: by 10.14.186.12 with SMTP id v12mr2820849eem.31.1330173694084; Sat, 25 Feb 2012 04:41:34 -0800 (PST) Received: from [82.54.101.22] (host22-101-dynamic.54-82-r.retail.telecomitalia.it. [82.54.101.22]) by mx.google.com with ESMTPS id w60sm31085797eeb.4.2012.02.25.04.41.31 (version=SSLv3 cipher=OTHER); Sat, 25 Feb 2012 04:41:32 -0800 (PST) Message-ID: <4F48D6FA.7030407@gmail.com> Date: Sat, 25 Feb 2012 13:41:30 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <20120224201502.GA8267@elliptictech.com> <4F481926.2080405@gmail.com> In-Reply-To: <4F481926.2080405@gmail.com> Content-Type: multipart/mixed; boundary="------------070501040602070808070406" X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 a multi-part message in MIME format. --------------070501040602070808070406 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 02/25/2012 12:11 AM, Stefano Lattarini wrote: > > Ah, this is a better example. Indeed we have a problem here (at the very > least a documentation one). > As a first step, the attached patch should improve the existing documentation on "make distcheck" a little. I will apply soonish to master if there is no objection. Regards, Stefano --------------070501040602070808070406 Content-Type: text/x-diff; name="0001-docs-improve-make-distcheck-documentation.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-docs-improve-make-distcheck-documentation.patch" >From 5f132d00e1f9cbd03432d834204d12cd8f638529 Mon Sep 17 00:00:00 2001 Message-Id: <5f132d00e1f9cbd03432d834204d12cd8f638529.1330173587.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Sat, 25 Feb 2012 11:11:33 +0100 Subject: [PATCH] docs: improve "make distcheck" documentation * doc/automake.texi (Checking the Distribution): The fact that "make distcheck" uses a read-only srcdir wasn't documented clearly enough here. Fix that. Since we are at it, be more explicit about the steps undertaken by "make distcheck", and re-organize this section a bit. Motivated by the discussion on automake bug#10878. (distcleancheck): Rename this node (in the "FAQ" section) ... (Errors with distclean): ... to this. Add a proper "FIXME" comment. --- doc/automake.texi | 56 ++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 39 insertions(+), 17 deletions(-) diff --git a/doc/automake.texi b/doc/automake.texi index 8dcbc18..c2c2a21 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -374,7 +374,7 @@ Frequently Asked Questions about Automake * maintainer-mode:: missing and AM_MAINTAINER_MODE * Wildcards:: Why doesn't Automake support wildcards? * Limitations on File Names:: Limitations on source and installed file names -* distcleancheck:: Files left in build directory after distclean +* Errors with distclean:: Files left in build directory after distclean * Flag Variables Ordering:: CFLAGS vs.@: AM_CFLAGS vs.@: mumble_CFLAGS * Renamed Objects:: Why are object files sometimes renamed? * Per-Object Flags:: How to simulate per-object flags? @@ -8468,20 +8468,32 @@ dist} was run, not to any sub-packages involved. @section Checking the Distribution @cindex @samp{make distcheck} -@cindex @samp{make distcleancheck} -@vindex distcleancheck_listfiles -@cindex @samp{make distuninstallcheck} -@vindex distuninstallcheck_listfiles - @trindex distcheck -Automake also generates a @code{distcheck} rule that can be of help to -ensure that a given distribution will actually work. @code{distcheck} -makes a distribution, then tries to do a @code{VPATH} build -(@pxref{VPATH Builds}), run the test suite, and finally make another -tarball to ensure the distribution is self-contained. +Automake also generates a @code{distcheck} rule that can be of help +to ensure that a given distribution will actually work. Simplifying +a bit, we can say this rule first makes a distribution, and then, +@emph{operating from it}, takes the following steps: +@itemize +@item +tries to do a @code{VPATH} build (@pxref{VPATH Builds}), with the +@code{srcdir} and all its content made @emph{read-only}; +@item +runs the test suite (with @command{make check}) on this fresh build; +@item +installs the package in a temporary directory (with @command{make +install}), and tries runs the test suite on the resulting installation +(with @command{make installcheck}); +@item +checks that the package can be correctly uninstalled (by @command{make +uninstall}) and cleaned (by @code{make distclean}); +@item +finally, makes another tarball to ensure the distribution is +self-contained. +@end itemize @vindex AM_DISTCHECK_CONFIGURE_FLAGS @vindex DISTCHECK_CONFIGURE_FLAGS +@subheading DISTCHECK_CONFIGURE_FLAGS Building the package involves running @samp{./configure}. If you need to supply additional flags to @command{configure}, define them in the @code{AM_DISTCHECK_CONFIGURE_FLAGS} variable in your top-level @@ -8505,6 +8517,7 @@ installcheck} was wrongly assuming it could blindly test "@command{m4}", rather than the just-installed "@command{gm4}". @trindex distcheck-hook +@subheading distcheck-hook If the @code{distcheck-hook} rule is defined in your top-level @file{Makefile.am}, then it will be invoked by @code{distcheck} after the new distribution has been unpacked, but before the unpacked copy @@ -8517,9 +8530,12 @@ are not honored in a subpackage @file{Makefile.am}, but the flags from @code{AM_DISTCHECK_CONFIGURE_FLAGS} and @code{DISTCHECK_CONFIGURE_FLAGS} are passed down to the @command{configure} script of the subpackage. +@cindex @samp{make distcleancheck} @trindex distcleancheck @vindex DISTCLEANFILES @vindex distcleancheck_listfiles + +@subheading distcleancheck Speaking of potential distribution errors, @code{distcheck} also ensures that the @code{distclean} rule actually removes all built files. This is done by running @samp{make distcleancheck} at the end of @@ -8557,9 +8573,14 @@ your Makefiles cause some distributed files to be rebuilt when the user build the package. (Think about the user missing the tool required to build the file; or if the required tool is built by your package, consider the cross-compilation case where it can't be run.) There is -an entry in the FAQ about this (@pxref{distcleancheck}), make sure you -read it before playing with @code{distcleancheck_listfiles}. +an entry in the FAQ about this (@pxref{Errors with distclean}), make +sure you read it before playing with @code{distcleancheck_listfiles}. +@cindex @samp{make distuninstallcheck} +@trindex distuninstallcheck +@vindex distuninstallcheck_listfiles + +@subheading distuninstallcheck @code{distcheck} also checks that the @code{uninstall} rule works properly, both for ordinary and @code{DESTDIR} builds. It does this by invoking @samp{make uninstall}, and then it checks the install tree @@ -11586,7 +11607,7 @@ lists. * maintainer-mode:: missing and AM_MAINTAINER_MODE * Wildcards:: Why doesn't Automake support wildcards? * Limitations on File Names:: Limitations on source and installed file names -* distcleancheck:: Files left in build directory after distclean +* Errors with distclean:: Files left in build directory after distclean * Flag Variables Ordering:: CFLAGS vs.@: AM_CFLAGS vs.@: mumble_CFLAGS * Renamed Objects:: Why are object files sometimes renamed? * Per-Object Flags:: How to simulate per-object flags? @@ -11981,13 +12002,14 @@ differ only in case (e.g., @file{makefile} and @file{Makefile}). Nowadays it is no longer worth worrying about the 8.3 limits of DOS file systems. -@node distcleancheck -@section Files left in build directory after distclean +@c FIXME This should probably be moved in the "Checking the Distribution" +@c FIXME section... +@node Errors with distclean +@section Errors with distclean @cindex @code{distclean}, diagnostic @cindex @samp{make distclean}, diagnostic @cindex dependencies and distributed files @trindex distclean -@trindex distcleancheck This is a diagnostic you might encounter while running @samp{make distcheck}. -- 1.7.9 --------------070501040602070808070406-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 07:51:36 2012 Received: (at 10878) by debbugs.gnu.org; 25 Feb 2012 12:51:36 +0000 Received: from localhost ([127.0.0.1]:55257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1H68-0006gs-3F for submit@debbugs.gnu.org; Sat, 25 Feb 2012 07:51:36 -0500 Received: from mail-ey0-f172.google.com ([209.85.215.172]:61411) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1H64-0006gc-Og for 10878@debbugs.gnu.org; Sat, 25 Feb 2012 07:51:33 -0500 Received: by eaal12 with SMTP id l12so1912887eaa.3 for <10878@debbugs.gnu.org>; Sat, 25 Feb 2012 04:48:52 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.3.196 as permitted sender) client-ip=10.213.3.196; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.3.196 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.213.3.196]) by 10.213.3.196 with SMTP id 4mr1881928ebo.120.1330174132370 (num_hops = 1); Sat, 25 Feb 2012 04:48:52 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=0Ey1b+rRdXPsyu0ORf6x7JlxgRZJbKX9Tch9oWXja1k=; b=Wdhrt3kl9+y5J1EcV3MMOtxFPFLhIFvFXIygz6kQEHa5TxaGdStJMyAFBt4S9RDdig f4NjAGDShqGXcVIkX9YUH9QavrmzqSdHyBO6nCSeidIKMjPe2ZRzME9+1BvCiRQVOWIM RaM7po5vEC8DpU2+Z1KNaBmHnC+5cgbPUsWzg= Received: by 10.213.3.196 with SMTP id 4mr1417827ebo.120.1330174132258; Sat, 25 Feb 2012 04:48:52 -0800 (PST) Received: from [82.54.101.22] (host22-101-dynamic.54-82-r.retail.telecomitalia.it. [82.54.101.22]) by mx.google.com with ESMTPS id u9sm31093480eem.11.2012.02.25.04.48.50 (version=SSLv3 cipher=OTHER); Sat, 25 Feb 2012 04:48:51 -0800 (PST) Message-ID: <4F48D8B0.6010808@gmail.com> Date: Sat, 25 Feb 2012 13:48:48 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <4F47E66A.5060402@gmail.com> <4F47E75A.2090809@gmail.com> <20120224203600.GB8267@elliptictech.com> In-Reply-To: <20120224203600.GB8267@elliptictech.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 (--) On 02/24/2012 09:36 PM, Nick Bowler wrote: > > I use the rule that no part of the build should write to srcdir, ever: > so it should be possible to do a successful VPATH build with a > maintainer-cleaned, read-only srcdir. > Note that automake does not honour this expectation (for example, distributed info files are generated in the srcdir). Such a policy of "always place generated but distributed files in the $(srcdir)" might become more common and even advised in the future, due to subtle breakages that might be triggered by having an outdated version of a generated file in srcdir and a "more fresh" one in the builddir; for a real-world example of such a breakage, see: and following messages. > I believe this actually goes above and beyond what Automake provides. > True, especially in light of the above. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 08:42:17 2012 Received: (at 10878) by debbugs.gnu.org; 25 Feb 2012 13:42:17 +0000 Received: from localhost ([127.0.0.1]:55279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1HtA-0007u9-Dz for submit@debbugs.gnu.org; Sat, 25 Feb 2012 08:42:17 -0500 Received: from mail-ey0-f172.google.com ([209.85.215.172]:49000) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1Ht6-0007tz-L1 for 10878@debbugs.gnu.org; Sat, 25 Feb 2012 08:42:14 -0500 Received: by eaal12 with SMTP id l12so1935061eaa.3 for <10878@debbugs.gnu.org>; Sat, 25 Feb 2012 05:39:32 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.37.203 as permitted sender) client-ip=10.14.37.203; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.37.203 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.37.203]) by 10.14.37.203 with SMTP id y51mr3870735eea.61.1330177172143 (num_hops = 1); Sat, 25 Feb 2012 05:39:32 -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:cc:subject:references :in-reply-to:content-type; bh=F/t5gDHkkGaVP3GybNhsqvhjaEVYBSfJNtYU3PYVIdY=; b=vjgSsdv2IqJB44F8+NVoW/zOE2McV9ILF0bObL+C4Sdq+6VThCIzVj00mFKWYtJZJO 8E5afg2Vz4zJO8ObF+mSVC9EqZFd+BfsgXlecABfp/F5VuJ5cstB4Z7Wn63icio9QUdi z+4nwBKDt8wZEN4d0QmDq0VnpIFdIsOpzLs/c= Received: by 10.14.37.203 with SMTP id y51mr2909526eea.61.1330177172061; Sat, 25 Feb 2012 05:39:32 -0800 (PST) Received: from [82.54.101.22] (host22-101-dynamic.54-82-r.retail.telecomitalia.it. [82.54.101.22]) by mx.google.com with ESMTPS id n52sm31658390eea.5.2012.02.25.05.39.29 (version=SSLv3 cipher=OTHER); Sat, 25 Feb 2012 05:39:31 -0800 (PST) Message-ID: <4F48E48F.9080704@gmail.com> Date: Sat, 25 Feb 2012 14:39:27 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <20120224201502.GA8267@elliptictech.com> <4F481926.2080405@gmail.com> <4F48D6FA.7030407@gmail.com> In-Reply-To: <4F48D6FA.7030407@gmail.com> Content-Type: multipart/mixed; boundary="------------080700080409000409060902" X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 a multi-part message in MIME format. --------------080700080409000409060902 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 02/25/2012 01:41 PM, Stefano Lattarini wrote: > On 02/25/2012 12:11 AM, Stefano Lattarini wrote: >> >> Ah, this is a better example. Indeed we have a problem here (at the very >> least a documentation one). >> > As a first step, the attached patch should improve the existing documentation > on "make distcheck" a little. I will apply soonish to master if there is no > objection. > And here is the documentation about the fact that a dist-hook should be ready to deal with read-only files. I will apply the attached patch soonish to master if there is no objection. Regards, Stefano --------------080700080409000409060902 Content-Type: text/x-diff; name="0001-docs-improve-make-distcheck-documentation.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-docs-improve-make-distcheck-documentation.patch" >From 0b8158dc67dfd23d00cbe67218ef78a0e889df86 Mon Sep 17 00:00:00 2001 Message-Id: <0b8158dc67dfd23d00cbe67218ef78a0e889df86.1330177127.git.stefano.lattarini@gmail.com> From: Stefano Lattarini Date: Sat, 25 Feb 2012 14:38:22 +0100 Subject: [PATCH] docs: improve "make distcheck" documentation * doc/automake.texi (The dist Hook): Explicitly document the fact that the dist-hook should account for the case where the source tree is read-only, mostly for the benefit of distcheck. Since we are at it, do some minor unrelated rewordings, and remove obsolescent advice. Motivated by the discussion on automake bug#10878. * tests/disthook-perms.test: Renamed ... * tests/disthook.test: ... to this, and extended. * tests/list-of-tests.mk: Adjust. --- doc/automake.texi | 28 +++++++++----- tests/{disthook-perms.test => disthook.test} | 50 ++++++++++++++++++------- tests/list-of-tests.mk | 2 +- 3 files changed, 55 insertions(+), 25 deletions(-) rename tests/{disthook-perms.test => disthook.test} (55%) diff --git a/doc/automake.texi b/doc/automake.texi index c2c2a21..36e9882 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -8420,24 +8420,32 @@ nodist_foo_SOURCES = do-not-distribute.c Occasionally it is useful to be able to change the distribution before it is packaged up. If the @code{dist-hook} rule exists, it is run -after the distribution directory is filled, but before the actual tar -(or shar) file is created. One way to use this is for distributing -files in subdirectories for which a new @file{Makefile.am} is overkill: +after the distribution directory is filled, but before the actual +distribution archives are created. One way to use this is for +removing unnecessary files that get recursively included by specifying +a directory in @code{EXTRA_DIST}: @example +EXTRA_DIST = doc dist-hook: - mkdir $(distdir)/random - cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random + rm -rf `find $(distdir)/doc -type d -name .svn` @end example -Another way to use this is for removing unnecessary files that get -recursively included by specifying a directory in EXTRA_DIST: +@noindent +Note that the @code{dist-hook} recipe shouldn't assume that the +regular files in the distribution directory are writable; this +might not be the case if one is packaging from a read-only source +tree, or when a @code{make distcheck} is being done. So, if the +@code{dist-hook} wants to modify the content of an existing file +in the distribution directory, it should explicitly ensure to make +it readable first: @example -EXTRA_DIST = doc - +EXTRA_DIST = README dist-hook: - rm -rf `find $(distdir)/doc -type d -name .svn` + chmod u+w $(distdir)/README + echo >> README + echo "Distribution date: `date`" >> README @end example @vindex distdir diff --git a/tests/disthook-perms.test b/tests/disthook.test similarity index 55% rename from tests/disthook-perms.test rename to tests/disthook.test index a5f0acb..d5afe83 100755 --- a/tests/disthook-perms.test +++ b/tests/disthook.test @@ -14,19 +14,32 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check that the user can use the 'dist-hook' target to modify -# permissions of distributed files before putting them in the -# distribution tarball. See automake bug#10878. +# Check that 'dist-hook' works. See automake bug#10878. . ./defs || Exit 1 echo AC_OUTPUT >> configure.ac cat > Makefile.am <<'END' -EXTRA_DIST = write execute +EXTRA_DIST = write execute removed dir dist-hook: chmod u+w $(distdir)/write chmod u+x $(distdir)/execute + rm -f $(distdir)/removed $(distdir)/dir/bad + : > dir/good2 + echo all is ok > write +## Sanity check. + echo ok > $(srcdir)/../disthook-run +check-local: + test "`cat $(srcdir)/write`" = "all is ok" + test -f $(srcdir)/dir/good1 + test -f $(srcdir)/dir/good2 + test ! -f $(srcdir)/dir/bad + test ! -r $(srcdir)/dir/bad + $(srcdir)/execute + $(srcdir)/execute | grep 'I run successfully' +## Sanity check. + echo ok > $(srcdir)/../distcheck-run END $ACLOCAL @@ -34,8 +47,10 @@ $AUTOMAKE $AUTOCONF ./configure - -echo Will be clobbered > write +mkdir dir +: > dir/good1 +echo will be clobbered > write +: > bad cat > execute <<'END' #!/bin/sh echo I run successfully @@ -44,16 +59,23 @@ END chmod a-w write chmod a-x execute -$MAKE -$MAKE dist - -test -f $distdir.tar.gz -gzip -dc $distdir.tar.gz | tar xvf - - +$MAKE distdir +test -f disthook-run +test ! -f distcheck-run cd $distdir -echo clobber clobber > write -cat write | grep 'clobber clobber' +test "`cat write`" = "all is ok" +test -f dir/good1 +test -f dir/good2 +test ! -f dir/bad +test ! -r dir/bad ./execute ./execute | grep 'I run successfully' +cd .. + +rm -f disthook-run + +$MAKE distcheck +test -f disthook-run +test -f distcheck-ok : diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index 5507ee5..89cff2f 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -355,7 +355,7 @@ distcom4.test \ distcom5.test \ distcom-subdir.test \ distdir.test \ -disthook-perms.test \ +disthook.test \ distlinks.test \ distlinksbrk.test \ distname.test \ -- 1.7.9 --------------080700080409000409060902-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 12:44:31 2012 Received: (at 10878) by debbugs.gnu.org; 25 Feb 2012 17:44:32 +0000 Received: from localhost ([127.0.0.1]:56399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1LfZ-0005EA-1A for submit@debbugs.gnu.org; Sat, 25 Feb 2012 12:44:30 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:35818) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1LfT-0005Dv-CG for 10878@debbugs.gnu.org; Sat, 25 Feb 2012 12:44:24 -0500 Received: by eeke51 with SMTP id e51so321224eek.3 for <10878@debbugs.gnu.org>; Sat, 25 Feb 2012 09:41:41 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.95.205 as permitted sender) client-ip=10.14.95.205; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.14.95.205 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.14.95.205]) by 10.14.95.205 with SMTP id p53mr4250990eef.80.1330191701588 (num_hops = 1); Sat, 25 Feb 2012 09:41:41 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=URYhDek58AGLXCp6B9YDc/268tGkGurGMVwIzm2FUYI=; b=thD2k7RHXKMRvHeY3GL+SblNTtpPaFRN1XL7pxPbkxr7eoAcNnkLrRxZDdWjNae/YB pkQ/ydu6nbicuGpoq1/gIQHpsYllW26mICXkd1Iwg+/uZVXTDclHToWBQrukzxNEuqtE EII7eoHZUgsVn/ts1crVWqJa4JV5DyHvTOZBo= Received: by 10.14.95.205 with SMTP id p53mr3179043eef.80.1330191701466; Sat, 25 Feb 2012 09:41:41 -0800 (PST) Received: from [87.4.96.204] (host204-96-dynamic.4-87-r.retail.telecomitalia.it. [87.4.96.204]) by mx.google.com with ESMTPS id v51sm34120403eef.2.2012.02.25.09.41.38 (version=SSLv3 cipher=OTHER); Sat, 25 Feb 2012 09:41:40 -0800 (PST) Message-ID: <4F491D49.4070508@gmail.com> Date: Sat, 25 Feb 2012 18:41:29 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <20120224150938.GA22342@elliptictech.com> <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <20120224201502.GA8267@elliptictech.com> <4F481926.2080405@gmail.com> <4F48D6FA.7030407@gmail.com> In-Reply-To: <4F48D6FA.7030407@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 (--) On 02/25/2012 01:41 PM, Stefano Lattarini wrote: > On 02/25/2012 12:11 AM, Stefano Lattarini wrote: >> >> Ah, this is a better example. Indeed we have a problem here (at the very >> least a documentation one). >> > As a first step, the attached patch should improve the existing documentation > on "make distcheck" a little. I will apply soonish to master if there is no > objection. > Pushed now. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 13:12:52 2012 Received: (at 10878) by debbugs.gnu.org; 25 Feb 2012 18:12:52 +0000 Received: from localhost ([127.0.0.1]:56403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1M70-0005rN-Q2 for submit@debbugs.gnu.org; Sat, 25 Feb 2012 13:12:51 -0500 Received: from mx.scalarmail.ca ([98.158.95.75]:62739 helo=ironport-01.sms.scalar.ca) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1M6y-0005rG-GY for 10878@debbugs.gnu.org; Sat, 25 Feb 2012 13:12:49 -0500 Received: from unknown (HELO sms-zimbra-mta-01.sms.scalar.ca) ([192.168.32.56]) by ironport-01.sms.scalar.ca with ESMTP; 25 Feb 2012 13:10:07 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTP id C7EF017F49; Sat, 25 Feb 2012 13:10:06 -0500 (EST) Received: from sms-zimbra-mta-01.sms.scalar.ca ([127.0.0.1]) by localhost (sms-zimbra-mta-01.sms.scalar.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D1efJaQniF9h; Sat, 25 Feb 2012 13:10:05 -0500 (EST) Received: from mail.ellipticsemi.com (mail.elliptictech.com [209.217.122.41]) by sms-zimbra-mta-01.sms.scalar.ca (Postfix) with ESMTPSA id 0AEDD17F47; Sat, 25 Feb 2012 13:10:04 -0500 (EST) Received: by mail.ellipticsemi.com (nbSMTP-1.00) for uid 550 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) nbowler@mail.ellipticsemi.com; Sat, 25 Feb 2012 13:10:04 -0500 (EST) Date: Sat, 25 Feb 2012 13:10:03 -0500 From: Nick Bowler To: Stefano Lattarini Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball Message-ID: <20120225181002.GA22494@elliptictech.com> References: <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <20120224201502.GA8267@elliptictech.com> <4F481926.2080405@gmail.com> <4F48D6FA.7030407@gmail.com> <4F48E48F.9080704@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F48E48F.9080704@gmail.com> Organization: Elliptic Technologies Inc. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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.9 (-) Hi Stefano, One comment below: On 2012-02-25 14:39 +0100, Stefano Lattarini wrote: [...] > And here is the documentation about the fact that a dist-hook should be ready > to deal with read-only files. I will apply the attached patch soonish to master > if there is no objection. [...] > +@noindent > +Note that the @code{dist-hook} recipe shouldn't assume that the > +regular files in the distribution directory are writable; this > +might not be the case if one is packaging from a read-only source > +tree, or when a @code{make distcheck} is being done. So, if the > +@code{dist-hook} wants to modify the content of an existing file > +in the distribution directory, it should explicitly ensure to make > +it readable first: ^^^^^^^^ writable I also would drop the words "ensure to". Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/) From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 25 14:28:47 2012 Received: (at 10878) by debbugs.gnu.org; 25 Feb 2012 19:28:47 +0000 Received: from localhost ([127.0.0.1]:56423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1NIT-0007ab-3m for submit@debbugs.gnu.org; Sat, 25 Feb 2012 14:28:46 -0500 Received: from mail-ey0-f172.google.com ([209.85.215.172]:39566) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1NIP-0007aS-27 for 10878@debbugs.gnu.org; Sat, 25 Feb 2012 14:28:42 -0500 Received: by eaal12 with SMTP id l12so2106094eaa.3 for <10878@debbugs.gnu.org>; Sat, 25 Feb 2012 11:25:59 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.9.73 as permitted sender) client-ip=10.213.9.73; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefano.lattarini@gmail.com designates 10.213.9.73 as permitted sender) smtp.mail=stefano.lattarini@gmail.com; dkim=pass header.i=stefano.lattarini@gmail.com Received: from mr.google.com ([10.213.9.73]) by 10.213.9.73 with SMTP id k9mr2160055ebk.96.1330197959193 (num_hops = 1); Sat, 25 Feb 2012 11:25:59 -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:cc:subject:references :in-reply-to:content-type; bh=n5S2lHgdJqyWmd5ibI96tsxUBImAFLDLtDAEpP6tp6Q=; b=Re6pcjOvsP45KhRmzB3KigY0/9WHqG1BQ1ShdJgSa/H23UYqX8jKRbMLJwOcP2/Tus bfK3vhYNUwiDg5mGcEPGYXf9a/m2i11r8sTPJhbK1Vg4Ri0A532L2R0F6OZRH9fEe9an CoPBzKvcSdYrFwZ7NO9Udrb87qfU69H0CAUfU= Received: by 10.213.9.73 with SMTP id k9mr1617221ebk.96.1330197959105; Sat, 25 Feb 2012 11:25:59 -0800 (PST) Received: from [87.4.96.204] (host204-96-dynamic.4-87-r.retail.telecomitalia.it. [87.4.96.204]) by mx.google.com with ESMTPS id u11sm27837351eeb.1.2012.02.25.11.25.56 (version=SSLv3 cipher=OTHER); Sat, 25 Feb 2012 11:25:58 -0800 (PST) Message-ID: <4F4935C2.9030102@gmail.com> Date: Sat, 25 Feb 2012 20:25:54 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <20120224201502.GA8267@elliptictech.com> <4F481926.2080405@gmail.com> <4F48D6FA.7030407@gmail.com> <4F48E48F.9080704@gmail.com> <20120225181002.GA22494@elliptictech.com> In-Reply-To: <20120225181002.GA22494@elliptictech.com> Content-Type: multipart/mixed; boundary="------------000309040206090001090703" X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 a multi-part message in MIME format. --------------000309040206090001090703 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 02/25/2012 07:10 PM, Nick Bowler wrote: > Hi Stefano, > Hi Nick, and thanks for all the feedback. > One comment below: > > On 2012-02-25 14:39 +0100, Stefano Lattarini wrote: > [...] >> And here is the documentation about the fact that a dist-hook should be ready >> to deal with read-only files. I will apply the attached patch soonish to master >> if there is no objection. > [...] >> +@noindent >> +Note that the @code{dist-hook} recipe shouldn't assume that the >> +regular files in the distribution directory are writable; this >> +might not be the case if one is packaging from a read-only source >> +tree, or when a @code{make distcheck} is being done. So, if the >> +@code{dist-hook} wants to modify the content of an existing file >> +in the distribution directory, it should explicitly ensure to make >> +it readable first: > ^^^^^^^^ > writable > > I also would drop the words "ensure to". > Good catches. I've fixed that, started doing a couple of other improvements, and finally basically re-wrote the patch (hopefully in a better way). The new version of the patch, that I've pushed, is attached. This should settle the issue, so I'll close this report by tomorrow if there are no further objection. Thanks, Stefano --------------000309040206090001090703 Content-Type: text/x-diff; name="0001-docs-improve-dist-hook-documentation.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-docs-improve-dist-hook-documentation.patch" >From e64729023df43c192f7e67c6c17549d68604a8e6 Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini Date: Sat, 25 Feb 2012 14:38:22 +0100 Subject: [PATCH] docs: improve 'dist-hook' documentation * doc/automake.texi (The dist Hook): Explicitly document the fact that the dist-hook should account for the case where the source tree is read-only, mostly for the benefit of distcheck. Since we are at it, do some minor unrelated rewordings, and remove obsolescent advice. Motivated by the discussion on automake bug#10878. * tests/disthook-perms.test: Renamed ... * tests/disthook.test: ... to this, and extended. * tests/list-of-tests.mk: Adjust. --- doc/automake.texi | 35 ++++++++++++------ tests/disthook-perms.test | 59 ------------------------------ tests/disthook.test | 89 +++++++++++++++++++++++++++++++++++++++++++++ tests/list-of-tests.mk | 2 +- 4 files changed, 113 insertions(+), 72 deletions(-) delete mode 100755 tests/disthook-perms.test create mode 100755 tests/disthook.test diff --git a/doc/automake.texi b/doc/automake.texi index c2c2a21..3bb365b 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -8420,24 +8420,35 @@ nodist_foo_SOURCES = do-not-distribute.c Occasionally it is useful to be able to change the distribution before it is packaged up. If the @code{dist-hook} rule exists, it is run -after the distribution directory is filled, but before the actual tar -(or shar) file is created. One way to use this is for distributing -files in subdirectories for which a new @file{Makefile.am} is overkill: +after the distribution directory is filled, but before the actual +distribution archives are created. One way to use this is for +removing unnecessary files that get recursively included by specifying +a directory in @code{EXTRA_DIST}: @example +EXTRA_DIST = doc dist-hook: - mkdir $(distdir)/random - cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random + rm -rf `find $(distdir)/doc -type d -name .svn` @end example -Another way to use this is for removing unnecessary files that get -recursively included by specifying a directory in EXTRA_DIST: - -@example -EXTRA_DIST = doc - +@c The caveates described here should be documented in 'disthook.test'. +@noindent +Note that the @code{dist-hook} recipe shouldn't assume that the regular +files in the distribution directory are writable; this might not be the +case if one is packaging from a read-only source tree, or when a +@code{make distcheck} is being done. For similar reasons, the recipe +shouldn't assume that the subdirectories put into the distribution +directory as effect of having them listed in @code{EXTRA_DIST} are +writable. So, if the @code{dist-hook} recipe wants to modify the +content of an existing file (or @code{EXTRA_DIST} subdirectory) in the +distribution directory, it should explicitly to make it writable first: + +@example +EXTRA_DIST = README doc dist-hook: - rm -rf `find $(distdir)/doc -type d -name .svn` + chmod u+w $(distdir)/README $(distdir)/doc + echo "Distribution date: `date`" >> README + rm -f $(distdir)/doc/HACKING @end example @vindex distdir diff --git a/tests/disthook-perms.test b/tests/disthook-perms.test deleted file mode 100755 index a5f0acb..0000000 --- a/tests/disthook-perms.test +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/sh -# Copyright (C) 2012 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 the user can use the 'dist-hook' target to modify -# permissions of distributed files before putting them in the -# distribution tarball. See automake bug#10878. - -. ./defs || Exit 1 - -echo AC_OUTPUT >> configure.ac - -cat > Makefile.am <<'END' -EXTRA_DIST = write execute -dist-hook: - chmod u+w $(distdir)/write - chmod u+x $(distdir)/execute -END - -$ACLOCAL -$AUTOMAKE -$AUTOCONF - -./configure - -echo Will be clobbered > write -cat > execute <<'END' -#!/bin/sh -echo I run successfully -END - -chmod a-w write -chmod a-x execute - -$MAKE -$MAKE dist - -test -f $distdir.tar.gz -gzip -dc $distdir.tar.gz | tar xvf - - -cd $distdir -echo clobber clobber > write -cat write | grep 'clobber clobber' -./execute -./execute | grep 'I run successfully' - -: diff --git a/tests/disthook.test b/tests/disthook.test new file mode 100755 index 0000000..9804e99 --- /dev/null +++ b/tests/disthook.test @@ -0,0 +1,89 @@ +#! /bin/sh +# Copyright (C) 2012 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 'dist-hook' works. See automake bug#10878. + +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am <<'END' +EXTRA_DIST = write execute removed doc + +removed: + echo I will be deleted > $@ +DISTCLEANFILES = removed + +dist-hook: + chmod u+w $(distdir)/write $(distdir)/doc + chmod u+x $(distdir)/execute + rm -f $(distdir)/removed + rm -f $(distdir)/doc/HACKING + rm -f $(distdir)/doc/RELEASE-DATE + date > $(distdir)/doc/RELEASE-DATE + echo all is ok > $(distdir)/write + +check-local: + ls -l $(srcdir) $(srcdir)/doc + test "`cat $(srcdir)/write`" = "all is ok" + test -f $(srcdir)/doc/README + test -f $(srcdir)/doc/RELEASE-DATE + test ! -f $(srcdir)/removed + test ! -r $(srcdir)/removed + test ! -f $(srcdir)/doc/HACKING + test ! -r $(srcdir)/doc/HACKING + $(srcdir)/execute + $(srcdir)/execute | grep 'I run successfully' +## Sanity check. + echo ok > $(srcdir)/../distcheck-run +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure +mkdir doc +: > doc/README +: > doc/HACKING +echo will be clobbered > write +cat > execute <<'END' +#!/bin/sh +echo I run successfully +END + +chmod a-w write +chmod a-x execute + +$MAKE distdir +ls -l $distdir $distdir/doc +cd $distdir +test "`cat write`" = "all is ok" +test ! -f removed +test ! -r removed +test -f doc/README +test -f doc/RELEASE-DATE +test ! -f doc/HACING +test ! -r doc/HACING +./execute +./execute | grep 'I run successfully' +cd .. + + +$MAKE distcheck +test -f distcheck-run + +: diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index 5507ee5..89cff2f 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -355,7 +355,7 @@ distcom4.test \ distcom5.test \ distcom-subdir.test \ distdir.test \ -disthook-perms.test \ +disthook.test \ distlinks.test \ distlinksbrk.test \ distname.test \ -- 1.7.9 --------------000309040206090001090703-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 26 04:36:53 2012 Received: (at 10878) by debbugs.gnu.org; 26 Feb 2012 09:36:53 +0000 Received: from localhost ([127.0.0.1]:56745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1aXF-0002gx-HA for submit@debbugs.gnu.org; Sun, 26 Feb 2012 04:36:53 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:63118) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S1aXD-0002gl-GA; Sun, 26 Feb 2012 04:36:52 -0500 Received: by eeke51 with SMTP id e51so604882eek.3 for ; Sun, 26 Feb 2012 01:34:06 -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:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=lCHed+j8GRyxPzA3oIH/qYJ3FRGVNrdWdzQJFCKwX6Q=; b=H/hDZ4PMYQkteVMAAKCai1pYMs1Rl6sqfD1NC6j5fjeiB5DCR46j3kPgKCNmZjJOEa I89+DthdpjPlpwk6U1Og8Pvaa6/F1yMpqcOuZjUKzNpaG5Kwz0qLMw5SOWxA5asrTL7h h3T0Y1FQ2WDXB+Xepu8spKpShM0oBl9F0zXIs= Received: by 10.14.131.145 with SMTP id m17mr4086753eei.115.1330248846273; Sun, 26 Feb 2012 01:34:06 -0800 (PST) Received: from [82.56.37.181] (host181-37-dynamic.56-82-r.retail.telecomitalia.it. [82.56.37.181]) by mx.google.com with ESMTPS id s48sm42778092eem.0.2012.02.26.01.34.03 (version=SSLv3 cipher=OTHER); Sun, 26 Feb 2012 01:34:05 -0800 (PST) Message-ID: <4F49FC8A.1090004@gmail.com> Date: Sun, 26 Feb 2012 10:34:02 +0100 From: Stefano Lattarini MIME-Version: 1.0 To: Nick Bowler Subject: Re: bug#10878: "make dist" with read-only srcdir generates read-only tarball References: <4F47B706.20408@redhat.com> <4F47CAE3.8030600@gmail.com> <20120224175338.GA28076@elliptictech.com> <4F47D4B4.5020703@gmail.com> <20120224183436.GA3989@elliptictech.com> <4F47E428.7040306@gmail.com> <20120224201502.GA8267@elliptictech.com> <4F481926.2080405@gmail.com> <4F48D6FA.7030407@gmail.com> <4F48E48F.9080704@gmail.com> <20120225181002.GA22494@elliptictech.com> <4F4935C2.9030102@gmail.com> In-Reply-To: <4F4935C2.9030102@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10878 Cc: 10878@debbugs.gnu.org, Eric Blake , 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 10878 patch close 10878 thanks On 02/25/2012 08:25 PM, Stefano Lattarini wrote: > > I'll close this report by tomorrow if there are no further objection. > Bug closed. Thanks, Stefano From unknown Sat Aug 16 15:54:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 Mar 2012 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