automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nodist_noinst_SCRIPTS and `make distcheck`


From: fr33domlover
Subject: Re: nodist_noinst_SCRIPTS and `make distcheck`
Date: Mon, 20 Oct 2014 20:25:37 +0300

Hello Nick,

On 2014-10-20
Nick Bowler <address@hidden> wrote:

> 
> There are two related things that distcheck is testing here, and either
> one of them may be tripping you up.
> 
> First, distcheck is checking that users can run "make dist" from your
> tarball.

Indeed `make dist` succeeds.

> Second, distcheck is checking that all this works properly in VPATH
> builds (i.e., with srcdir != builddir).

I didn't try, but I assume it will work because the only problem is that
script, which IS present in the right place. The Makefile.am makes sure it will
be taken from $srcdir. The problem happens because `make distcheck` copies
files from the source repo into a new temporary srcdir.

> For the first point, in principle it is OK to have ChangeLog generated
> automatically from your VCS.  But you need to be careful that the
> distributed ChangeLog's prerequisites are present and that it is
> up-to-date, so that "make dist" from the tarball does not attempt to
> re-generate it (since obviously this process will not function).  One
> way to solve this is to sidestep it entirely with a dist-hook, which can
> test if you are building from VCS, then generate the ChangeLog as
> appropriate.  Something like this (untested):
> 
>   dist-hook: dist-create-changelog
>   dist-create-changelog:
>       if test -d "$(srcdir)/.git"; then \
>         : generate "$(distdir)/ChangeLog" here; \
>       fi
>   .PHONY: dist-create-changelog
> 
> Here we rely on the fact that Automake will automagically include
> ChangeLog in the tarball if it is present in srcdir.  You may want to
> also add a distcheck-hook to ensure that this actually happens.

This is exactly what I do :-)

And like I said, it does work.

> For the second point, if you are not routinely testing VPATH builds
> from your git tree at all, just be aware that distcheck may uncover bugs
> related to this feature.

It's going to be the first release, so I didn't try distcheck until now.

The line which generates the ChangeLog in the snippet above requires that script
to be present in $srcdir - but distcheck doesn't copy it to its temporary
srcdir, so it's not present.

The solution to the problem of .git not being present during distcheck may be:
In distcheck-hook, take it from the right place (i.e. $(srcdir)/../.git) and
then try to make the ChangeLog again. The thing about the script is, that while
I can do the same (pick the script from the original $srcdir), it would be
somewhat wrong design-wise - if a script is used for `make dist`, then `make
distcheck` should copy it into the temporary srcdir just like the source code.
While not installed nor distributed, the script is *used* during the process
and is therefore required.

How do I tell `make distcheck` to do that? I did try to have the ChangeLog
target depend on the script file, but then instead of being satisfied by it
(since the script file exists), it complains there's no target for it (but none
needed since it's a file and it already exists).

Is there a solution for this in automake?



If not, I'll take a look at the implementation of distcheck and see if anything
can be done about it (maybe some kind of variable(s) which means "files used
for inst/dist/both but are themselves nodist_noinst).


fr33domlover
PGP key ID: 937A67EF

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]