Subject: bug#10878: "make dist" with read-only srcdir generates read-only tarball

From: Nick Bowler <[email-masked]>
Date: Fri, 24 Feb 2012 15:36:00 -0500

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: <8f6a79c2a[email-masked]>
> From: Stefano Lattarini <[email-masked]>
> 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/)