autoconf
[Top][All Lists]
Advanced

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

Re: distcheck fails with autotest: autom4te: cannot open ../../tests/tes


From: Benoit SIGOURE
Subject: Re: distcheck fails with autotest: autom4te: cannot open ../../tests/testsuite.tmp: Permission denied
Date: Fri, 2 Nov 2007 21:07:47 +0100

On Nov 2, 2007, at 6:49 PM, Ralf Wildenhues wrote:

* Ralf Wildenhues wrote on Fri, Nov 02, 2007 at 05:08:32PM CET:
* Benoit SIGOURE wrote on Fri, Nov 02, 2007 at 03:07:23AM CET:

make[3]: Entering directory
`/Users/tsuna/svn/git/boost.m4/_build/boost-m4-test-0.1/_build/ tests'
/bin/sh
/Users/tsuna/svn/git/boost.m4/_build/boost-m4-test-0.1/build-aux/ missing
--run autom4te --language=autotest -I '../../tests'
../../tests/testsuite.at -o ../../tests/testsuite.tmp
autom4te: cannot open ../../tests/testsuite.tmp: Permission denied
make[3]: *** [../../tests/testsuite] Error 1

The rule is that no distributed files can depend on undistributed ones. So if you ship `testsuite', then ship package.m4 as well. If you ship
package.m4, then it should not depend on config.status or Makefile
(the manual shows an example where it depends on configure.ac only.)

Oh.  Current Autoconf code has that.  I didn't notice (but I see you
also did now):

| 2007-10-28  Jim Meyering  <address@hidden>
[...]
| * tests/Makefile.am ($(srcdir)/package.m4): Depend on Makefile, | not configure.ac, now that the version number changes automatically.

Yuck, that's ugly.  Should we have a VERSION file, changed by a commit
hook or something like that?

We need to find a way to handle this properly, but it's not trivial. It annoys me with Git when I commit something (say, in the manual) and then run `make', it will regenerate all the scripts and re-link all the builtins because the version number has changed. Maybe we should rather generate a new version number when it's really needed, not when a commit is made.


Hmm, distcheck is not even failing at this point:
[...]
| make[3]: Entering directory `/tmp/build/autoconf-2.61a-248-dc51- dirty/_build/tests'
| {                                       \
|           echo '# Signature of the current package.'; \
| echo 'm4_define([AT_PACKAGE_NAME], [GNU Autoconf])'; \
|           echo 'm4_define([AT_PACKAGE_TARNAME],   [autoconf])'; \
| echo 'm4_define([AT_PACKAGE_VERSION], [2.61a-248-dc51- dirty])'; \ | echo 'm4_define([AT_PACKAGE_STRING], [GNU Autoconf 2.61a-248-dc51-dirty])'; \ | echo 'm4_define([AT_PACKAGE_BUGREPORT], [bug- address@hidden)'; \
|         } >../../tests/package.m4
| /bin/sh: line 7: ../../tests/package.m4: Permission denied
| cd ../lib/autotest && make  autotest.m4f
| make[4]: Entering directory `/tmp/build/autoconf-2.61a-248-dc51- dirty/_build/lib/autotest'
| make[4]: `autotest.m4f' is up to date.
[... happily going on ...]

If I use a subshell for redirection, the shell exits nonzero:

$ touch a && chmod -w a
$ sh -c '{ echo foo; } > a'; echo $?
sh: a: Permission denied
0
$ sh -c '( echo foo; ) > a'; echo $?
sh: a: Permission denied
1

This is bash 3.1.17(1), but also happens with 3.2.0(2); not with pdksh.

Yes, that's the issue I stumbled on when copying/pasting stuff from Autoconf. It was late and I did not bother to think more about it. My system's /bin/sh is GNU bash, version 2.05b.0(1)-release (powerpc- apple-darwin8.0).
Should this bug be documented in the manual?

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 5d2b564..691f7d5 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -13494,6 +13494,7 @@ the @samp{x} into account later in the pipe.

 @table @asis
 @item @command{.}
address@hidden --------------
 @prindex @command{.}
 Use @command{.} only with regular files (use @samp{test -f}).  Bash
 2.03, for instance, chokes on @samp{. /dev/null}.  Also, remember that
@@ -13502,6 +13503,7 @@ you want to use @command{.} on a file @file {foo} in the current
 directory, you must use @samp{. ./foo}.

 @item @command{!}
address@hidden --------------
 @prindex @command{!}
 The Unix version 7 shell did not support
negating the exit status of commands with @command{!}, and this feature @@ -13528,6 +13530,19 @@ More generally, one can always rewrite @samp {! @var{command}} as:
 if @var{command}; then (exit 1); else :; fi
 @end example

address@hidden @address@hidden@}}
address@hidden --------------------
address@hidden @address@hidden@}}
+Some versions of GNU Bash so not properly set @samp{$?} if a redirection
+fails on a @address@hidden@}} block.
+
address@hidden
+$ sh -c '@{ echo foo; @} >/bad; echo $?'
+sh: line 1: /bad: Permission denied
+0
address@hidden example
+
+
 @item @command{break}
 @c ------------------
 @prindex @command{break}

Cheers,

--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory


Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

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