GNU bug report logs - #11185
flex %option "never-interactive" breaks few tests on Solaris

Previous Next

Package: automake;

Reported by: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Date: Thu, 5 Apr 2012 13:42:02 UTC

Severity: minor

Tags: patch

Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11185 in the body.
You can then email your comments to 11185 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#11185; Package automake. (Thu, 05 Apr 2012 13:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefano Lattarini <stefano.lattarini <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Thu, 05 Apr 2012 13:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: bug-automake <at> gnu.org
Cc: Peter Rosin <peda <at> lysator.liu.se>
Subject: flex %option "never-interactive" breaks few tests on Solaris
Date: Thu, 05 Apr 2012 15:40:00 +0200
Severity: minor
thanks

Hello automakers, Peter.

The commit v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly state
that our lexers do not require unistd.h", has been causing at least
the tests 'lex-clean-cxx.test' and 'lex-depend-cxx.test' to break on
Solaris, where lex is not flex, and does not understand the directive
"%option never-interactive".

Any opinion on how to better fix this?  Is defining a dummy 'isatty'
function in our C++ sources enough to avoid the failures on MSYS?

Regards,
  Stefano




Information forwarded to bug-automake <at> gnu.org:
bug#11185; Package automake. (Thu, 05 Apr 2012 19:24:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Rosin <peda <at> lysator.liu.se>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: bug-automake <at> gnu.org
Subject: Re: flex %option "never-interactive" breaks few tests on Solaris
Date: Thu, 05 Apr 2012 21:22:50 +0200
On 2012-04-05 15:40, Stefano Lattarini wrote:
> Severity: minor
> thanks
> 
> Hello automakers, Peter.
> 
> The commit v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly state
> that our lexers do not require unistd.h", has been causing at least
> the tests 'lex-clean-cxx.test' and 'lex-depend-cxx.test' to break on
> Solaris, where lex is not flex, and does not understand the directive
> "%option never-interactive".
> 
> Any opinion on how to better fix this?  Is defining a dummy 'isatty'
> function in our C++ sources enough to avoid the failures on MSYS?

Yes, the test still passes with MSVC and the below patch.  I have little
time at the moment, so if this works elsewhere and if someone else can
wrap it all up with a decent commit message etc, that would probably be
fastest approach.

It does not work to add the isatty function down by yywrap, it probably
works if you add a forward declaration where I put the function, but
the function is so small that I thought that was pretty pointless.
However, I am *not* fluent in lex, so what do I know?

Cheers,
Peter

diff --git a/tests/lex-clean-cxx.test b/tests/lex-clean-cxx.test
index 9ff2dbc..32ab327 100755
--- a/tests/lex-clean-cxx.test
+++ b/tests/lex-clean-cxx.test
@@ -55,8 +55,11 @@ END
 cat > parsefoo.lxx << 'END'
 %{
 #define YY_NO_UNISTD_H 1
+int isatty (int fd)
+{
+  return 0;
+}
 %}
-%option never-interactive
 %%
 "GOOD"   return EOF;
 .






Information forwarded to bug-automake <at> gnu.org:
bug#11185; Package automake. (Fri, 06 Apr 2012 21:36:01 GMT) Full text and rfc822 format available.

Message #11 received at 11185 <at> debbugs.gnu.org (full text, mbox):

From: Roumen Petrov <bugtrack <at> roumenpetrov.info>
To: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Cc: Peter Rosin <peda <at> lysator.liu.se>, 11185 <at> debbugs.gnu.org
Subject: Re: bug#11185: flex %option "never-interactive" breaks few tests
	on Solaris
Date: Sat, 07 Apr 2012 00:34:28 +0300
Hi Stefano,

Stefano Lattarini wrote:
> Severity: minor
> thanks
>
> Hello automakers, Peter.
>
> The commit v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly state
> that our lexers do not require unistd.h", has been causing at least
> the tests 'lex-clean-cxx.test' and 'lex-depend-cxx.test' to break on
> Solaris, where lex is not flex, and does not understand the directive
> "%option never-interactive".
>
> Any opinion on how to better fix this?  Is defining a dummy 'isatty'
> function in our C++ sources enough to avoid the failures on MSYS?
Function isatty is defined in <io.h> .
May be you could define a dummy function.

> Regards,
>    Stefano

Roumen





Information forwarded to bug-automake <at> gnu.org:
bug#11185; Package automake. (Sun, 08 Apr 2012 22:15:01 GMT) Full text and rfc822 format available.

Message #14 received at 11185 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Roumen Petrov <bugtrack <at> roumenpetrov.info>
Cc: Peter Rosin <peda <at> lysator.liu.se>, 11185 <at> debbugs.gnu.org
Subject: Re: bug#11185: flex %option "never-interactive" breaks few tests
	on Solaris
Date: Mon, 09 Apr 2012 00:12:55 +0200
On 04/06/2012 11:34 PM, Roumen Petrov wrote:
> Hi Stefano,
>
Hi Roumen, sorry for the delay.

> Stefano Lattarini wrote:
>> Severity: minor
>> thanks
>>
>> Hello automakers, Peter.
>>
>> The commit v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly state
>> that our lexers do not require unistd.h", has been causing at least
>> the tests 'lex-clean-cxx.test' and 'lex-depend-cxx.test' to break on
>> Solaris, where lex is not flex, and does not understand the directive
>> "%option never-interactive".
>>
>> Any opinion on how to better fix this?  Is defining a dummy 'isatty'
>> function in our C++ sources enough to avoid the failures on MSYS?
> Function isatty is defined in <io.h> .
>
Which doesn't exist on most POSIX systems AFAIK, so trying to include it
would be problematic.

> May be you could define a dummy function.
>
I think this is the best solution, yes.  See my answer to Peter's message.

Regards,
  Stefano




Information forwarded to bug-automake <at> gnu.org:
bug#11185; Package automake. (Sun, 08 Apr 2012 22:25:01 GMT) Full text and rfc822 format available.

Message #17 received at 11185 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: Peter Rosin <peda <at> lysator.liu.se>
Cc: 11185 <at> debbugs.gnu.org,
	"automake-patches <at> gnu.org" <automake-patches <at> gnu.org>
Subject: Re: bug#11185: flex %option "never-interactive" breaks few tests
	on Solaris
Date: Mon, 09 Apr 2012 00:23:52 +0200
[Message part 1 (text/plain, inline)]
tags 11185 + patch
close 11185
thanks

On 04/05/2012 09:22 PM, Peter Rosin wrote:
> On 2012-04-05 15:40, Stefano Lattarini wrote:
>> Severity: minor
>> thanks
>>
>> Hello automakers, Peter.
>>
>> The commit v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly state
>> that our lexers do not require unistd.h", has been causing at least
>> the tests 'lex-clean-cxx.test' and 'lex-depend-cxx.test' to break on
>> Solaris, where lex is not flex, and does not understand the directive
>> "%option never-interactive".
>>
>> Any opinion on how to better fix this?  Is defining a dummy 'isatty'
>> function in our C++ sources enough to avoid the failures on MSYS?
> 
> Yes, the test still passes with MSVC and the below patch.
>
> [SNIP]
>
Thanks.  I've pushed the attached patch to master, which should fix the
problem.  I'm thus closing this bug report.

Regards,
  Stefano
[0001-tests-avoid-spurious-failures-with-non-flex-lex-prog.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 08 Apr 2012 22:25:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 11185 <at> debbugs.gnu.org and Stefano Lattarini <stefano.lattarini <at> gmail.com> Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 08 Apr 2012 22:25:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 May 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 124 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.