Re: Failure of `make.test'

2008-07-02 Thread Ludovic Courtès
Hi,

Stepan Kasal <[EMAIL PROTECTED]> writes:

> In short, I'd recommend that NixOS reconsider the patch.

I actually reached the same conclusion and posted that suggestion to the
Nix mailing list:

  http://thread.gmane.org/gmane.linux.distributions.nixos/662

We'll see what happens...

Thanks,
Ludovic.





Re: Failure of `make.test'

2008-07-02 Thread Stepan Kasal
Hello,

On Tue, Jul 01, 2008, Ludovic Courtès wrote:
> Yes, actually I had forgotten that NixOS' GNU Make package is modified
> to produce additional output suitable for the `nix-log2xml' tool.

> The extra output [*] is (1) one line per goal sent to stderr, and (2) an
> additional "\e[p" sequence to stdout when `-w' is used:

> [*] Patch available at:
> 
> https://svn.nixos.org/viewvc/nix/nixpkgs/trunk/pkgs/development/tools/build-managers/gnumake/log.patch?revision=10849&view=markup

well, this change sounds dangerous.  It's a common practice to parse the
output of make, and inserting invisible tty control sequences is not
friendly to that practice.

If you require such a dangerous feature, it should not be switched on
by default.  And since GNU make often adds -w automatically (see the
manual for details), binding that feature to -w amouts as swithing on
by default.

Here is what can easily happen:

At first, ./configure detects GNU make includes correctly.
But later on, a developer changes configure.ac.  The rules in
Automake-generated makefiles ensure that ./configure is run again.
But at that time, ./configure is called from make, perhaps from
recursive make, so it is called with -w sitched automatically on.

Consequently, the reconfigure would not detect the include directive,
automatic dependencies would be disabled.

It would be very hard to detect this bug, because it appear only
under certain conditions, and it regularly disappears each time
./configure is run explicitly from command line.

Actually it would take ages before the bug was _described_
accurately, not speaking about fixing it.

The net result would just be that the Nix community would spread the
rumour that the automatic rebuilds provided by autotools are not as
reliable as advertised.

Well, luckily, configure clears MAKEFLAGS= during its initialization.
So yes, the above horror is a fiction.  Yet I'm worried some variant
of it *could* happen in reality.

In short, I'd recommend that NixOS reconsider the patch.

Stepan




Re: Failure of `make.test'

2008-07-01 Thread Ludovic Courtès
Hi,

Ralf Wildenhues <[EMAIL PROTECTED]> writes:

> You could also write a patch letting automake/m4/make.m4 drop that extra
> output.  Or at least show us what it is.

The extra output [*] is (1) one line per goal sent to stderr, and (2) an
additional "\e[p" sequence to stdout when `-w' is used:

  $ a="`make -w -s -f confmf | grep -v 'ing directory'`"
  building am__doit
  $ echo "\`$a'"
  `done
  '
(1) doesn't hurt here, but (2) causes the test to fail.

I'm not sure whether we want the test to work around this.

Thanks,
Ludovic.

[*] Patch available at:

https://svn.nixos.org/viewvc/nix/nixpkgs/trunk/pkgs/development/tools/build-managers/gnumake/log.patch?revision=10849&view=markup





Re: Failure of `make.test'

2008-07-01 Thread Ralf Wildenhues
Hello Ludovic,

* Ludovic Courtès wrote on Tue, Jul 01, 2008 at 09:14:51PM CEST:
> Stepan Kasal <[EMAIL PROTECTED]> writes:
> 
> > You should report it to the vendor of your platform (NixOS).
> 
> Yes, actually I had forgotten that NixOS' GNU Make package is modified
> to produce additional output suitable for the `nix-log2xml' tool.  This
> is what the test is catching.

You could also write a patch letting automake/m4/make.m4 drop that extra
output.  Or at least show us what it is.

Cheers,
Ralf




Re: Failure of `make.test'

2008-07-01 Thread Ludovic Courtès
Hi,

Stepan Kasal <[EMAIL PROTECTED]> writes:

> It means that "make -w" behaves strange on your platform.  (Try
> replacing "make -w" with "make" at the top of the script; then the
> answer will be "GNU", right?)
>
> You should report it to the vendor of your platform (NixOS).

Yes, actually I had forgotten that NixOS' GNU Make package is modified
to produce additional output suitable for the `nix-log2xml' tool.  This
is what the test is catching.

Thanks, and sorry for the noise,
Ludovic.





Re: Failure of `make.test'

2008-07-01 Thread Stepan Kasal
Hello,

On Tue, Jul 01, 2008 at 05:39:27PM +0200, Ludovic Courtès wrote:
> >   to reproduce what the test does, try the following:
> 
> Unfortunately, I can't run it with the in-tree Automake, because
> `autoreconf' won't find $prefix/share/aclocal-1.10, for instance.  How
> can I make it use the in-tree files?

the build tree creates wrappers in the tests/ subdir and then defs
adds that to the beginning of PATH.

But it does not matter here, since:

> > Attached below please find a test similar to that pefofrmed by configure.
> > Could you please try it?  What is the output?
> 
> It displays "none".

It means that "make -w" behaves strange on your platform.  (Try
replacing "make -w" with "make" at the top of the script; then the
answer will be "GNU", right?)

You should report it to the vendor of your platform (NixOS).

OTOH, AFAIK, make -w is not used much, so it is quite probable that
this problem does not affect you in practical life at all.

Have a nice day,
Stepan




Re: Failure of `make.test'

2008-07-01 Thread Ludovic Courtès
Hi,

Stepan Kasal <[EMAIL PROTECTED]> writes:

>   to reproduce what the test does, try the following:

Unfortunately, I can't run it with the in-tree Automake, because
`autoreconf' won't find $prefix/share/aclocal-1.10, for instance.  How
can I make it use the in-tree files?

> Attached below please find a test similar to that pefofrmed by configure.
> Could you please try it?  What is the output?

It displays "none".

Thanks,
Ludovic.





Re: Failure of `make.test'

2008-07-01 Thread Stepan Kasal
Hello,
  to reproduce what the test does, try the following:

mkdir test.dir
cd test.dir
cat > configure.ac <<\EOF
AC_INIT(foo,0,np)
AM_INIT_AUTOMAKE(foreign)
AM_MAKE_INCLUDE
AC_OUTPUT(Makefile)
EOF
touch Makefile.am
autoreconf -i
MAKE='make -w' ./configure

In my case, the configure output contains (near the end):
checking for style of include used by make -w... GNU

But in your case, it will probably be:

> checking for style of include used by make -w... none

Attached below please find a test similar to that pefofrmed by configure.
Could you please try it?  What is the output?

Have a nice day,
Stepan

#!/bin/sh
am_make='make -w'
cat > confinc << 'END'
am__doit:; @echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
echo -n "checking for style of include used by $am_make... "
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = 
"done"; then
   am__include=include
   am__quote=
   _am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
   echo '.include "confinc"' > confmf
   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
  am__include=.include
  am__quote="\""
  _am_result=BSD
   fi
fi
echo "$_am_result"
rm -f confinc confmf