Issue 13385 - new flex breaks OOo build (in transex3 and connectivity)
Summary: new flex breaks OOo build (in transex3 and connectivity)
Status: CLOSED FIXED
Alias: None
Product: Internationalization
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.3
Hardware: All All
: P1 (highest) Trivial (vote)
Target Milestone: ---
Assignee: foskey
QA Contact: issues@l10n
URL: http://people.debian.org/~rene/ooo-fl...
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-14 00:54 UTC by rene
Modified: 2013-08-07 15:01 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Buildlog excerpt for transex3 (62 bytes, text/plain)
2003-04-14 00:59 UTC, rene
no flags Details
flex input file (OOo 1.0.3) (60 bytes, text/plain)
2003-04-14 01:00 UTC, rene
no flags Details
flex output with the old flex (68 bytes, text/plain)
2003-04-14 01:01 UTC, rene
no flags Details
flex output with the new flex (68 bytes, text/plain)
2003-04-14 01:02 UTC, rene
no flags Details
unified diff between old and new flex output (56 bytes, patch)
2003-04-14 01:03 UTC, rene
no flags Details | Diff
Patch to work around shortcoming in new debian flex. (908 bytes, patch)
2003-04-15 13:01 UTC, foskey
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description rene 2003-04-14 00:54:55 UTC
flex 2.5.31 (which entered Debian unstable a few days ago) breaks building of 
OpenOffice.org (among other packages like XFree86 and binutils). 
 
Manoj Srivastava - the Debian flex maintainer has written an explanation in this 
posting: 
http://lists.debian.org/debian-openoffice/2003/debian-openoffice-200304/msg00065.html 
 
So we might not get a "fixed" flex and need to fix OOo itself. 
 
I am going to attach the relevant buildlog excerpt, the .l file and the .c files with the old 
and the new flex together with a diff between them to this issue. 
 
This bug holds OpenOffice.org back in unstable, so we hope that it can be fixed soon..
Comment 1 rene 2003-04-14 00:59:11 UTC
Created attachment 5632 [details]
Buildlog excerpt for transex3
Comment 2 rene 2003-04-14 01:00:14 UTC
Created attachment 5633 [details]
flex input file (OOo 1.0.3)
Comment 3 rene 2003-04-14 01:01:18 UTC
Created attachment 5634 [details]
flex output with the old flex
Comment 4 rene 2003-04-14 01:02:19 UTC
Created attachment 5635 [details]
flex output with the new flex
Comment 5 rene 2003-04-14 01:03:38 UTC
Created attachment 5636 [details]
unified diff between old and new flex output
Comment 6 rene 2003-04-14 01:46:38 UTC
Since it seems I am too dumb (or too tired) to attach these files correctly 
and not getting an attachment with the path to my files on my laptop, 
all these files can be found under 
 
  http://people.debian.org/~rene/ooo-flex-error/ 
Comment 7 chris 2003-04-14 09:06:31 UTC
Confirming.  Installing flex 2.5.31 on a system which otherwise builds
OOo correctly breaks the build.
Comment 8 foskey 2003-04-15 13:01:32 UTC
Created attachment 5680 [details]
Patch to work around shortcoming in new debian flex.
Comment 9 foskey 2003-04-15 15:51:01 UTC
We have a break in connectivity now.  The new flex is defining
YY_FLUSH_BUFFER and then undefining it at the end of it's internal
processing.  Here are the messages.

In file included from
../../unxlngi4.pro/inc/com/sun/star/beans/XPropertySetInfo.hpp:20,
                 from
../../unxlngi4.pro/inc/com/sun/star/beans/XPropertySet.hpp:32,
                 from ../../inc/connectivity/sqlnode.hxx:71,
                 from ../inc/internalnode.hxx:65,
                 from ../../unxlngi4.pro/misc/sqlflex.cxx:1809:
/data3/office/solver/644/unxlngi4.pro/inc/com/sun/star/uno/Sequence.hxx:
In function `const com::sun::star::uno::Type& getCppuType(const
com::sun::star::uno::Sequence<E>*)':
/data3/office/solver/644/unxlngi4.pro/inc/com/sun/star/uno/Sequence.hxx:230:
warning: `typename com::sun::star::uno::Sequence<E>::ElementType' is
implicitly a typename
/data3/office/solver/644/unxlngi4.pro/inc/com/sun/star/uno/Sequence.hxx:230:
warning: implicit typename is deprecated, please see the documentation
for details
../../unxlngi4.pro/misc/sqlflex.cxx: In function `sal_Int32
gatherString(long int, long int)':
../../unxlngi4.pro/misc/sqlflex.cxx:3805: `yytext_ptr' undeclared
(first use this function)
../../unxlngi4.pro/misc/sqlflex.cxx:3805: (Each undeclared identifier
is reported only once for each function it appears in.)
../../unxlngi4.pro/misc/sqlflex.cxx: In member function `virtual void
connectivity::OSQLScanner::SQLyyerror(sal_Char*)':
../../unxlngi4.pro/misc/sqlflex.cxx:4055: `YY_FLUSH_BUFFER' undeclared
(first use this function)
dmake:  Error code 1, while making '../../unxlngi4.pro/slo/sqlflex.obj'
Comment 10 rene 2003-04-15 16:42:08 UTC
I just talked with Manoj about the connectivity break (gave him a link
to this issue):

17:33 < Manoj> _rene_: yes, there are things available in the rules
section
               that are cleaned up before we get into the user section
               17:33 < infinity> con-fuse : I know. :)
[...]
17:33 < Manoj> _rene_: the actions, then, have these things available,
but now
               flex tries to avoid polluting the user namespace
[...]
17:34 < Manoj> _rene_: you understand this is needed, since now we can
have
               dozens of scanners in a program
[...]
17:35 < _rene_> Manoj: so how to fix that? :) (/me is totally
flex-incompetent)
[...]
17:35 < Manoj> _rene_: only use YY_FLUSH_BUFFER  in the action section?
17:35 < _rene_> Hmm
[...]
17:35 < Manoj> flex has 3 sections: definition, rules/action, and user
Comment 11 rene 2003-04-15 17:51:45 UTC
_Maybe_ this post is interesting too

http://lists.debian.org/debian-devel/2003/debian-devel-200304/msg01098.html
Comment 12 Dieter.Loeschky 2003-04-22 11:26:23 UTC
DL->NF: The new flex breaks the OOo build (at least in transex3).
Comment 13 nils.fuhrmann 2003-04-23 08:55:27 UTC
Ken, I'm not sure about the current state. You wrote "Patch to work
around shortcoming in new debian flex.". Does this mean there is no
more action for the transex3 problem required?
Comment 14 foskey 2003-04-23 11:33:19 UTC
I have currently downgraded and lockedout upgrades.

a) The transex3 patch is not applied.  It is very simple change ]] to 
] ].

b) The break in connectivity is unfixed.
Comment 15 foskey 2003-05-04 15:00:06 UTC
I don't have time to work on this.  I have currently locked down my
flex to a version before breakage.  Can you assign as appropriate to
get someone to work with this problem.  Ta Ken...
Comment 16 rene 2003-05-05 15:34:59 UTC
OK, here are important new information regarding this:

Manoj told me, that the new flex needs a more self-contained
rules section. So moving gather* into rules embedded into
%{ %} should work.

Well, the problem is that when you are doing that, flex 2.5.31
(which actually processed that sqlflex.l this time) generated nested
functions on which gcc obviously chokes.

I unfortunatly seems to have lost my build logs showing the errors
the compiler gave, but it seems a really grave bug in flex 2.5.31 and
upstream didn't react to bug reports of this kind in any way..

Well, Debian sid is proposed to get a flex-old deb being 2.5.4a again,
but this issue should be leaved open to get fixed if the new flex
did not generate bad code and the "moving into %{ %} sections of
the rules section" fix can be done.

Regards,

Rene
Comment 17 rene 2003-05-12 17:04:24 UTC
Hi, 
 
it seems that the fix (or a workaround) is much easier 
then we all have thought. 
 
The following fix (thanks to Jarno Elonen <elonen@iki.fi) 
fixes the failure in connectivity: 
 
--- oo_1.0.3_src/connectivity/source/parse/sqlflex.l    2003-05-09 
22:46:08.000000000 +0300 
+++ oo_1.0.3_src/connectivity/source/parse/sqlflex.l    2003-05-11 
12:04:59.000000000 +0300 
@@ -338,6 +338,20 @@ 
 
 %% 
 
+// Kludge around a bug (well, Posix incompatibility) in flex 2.5.x 
+// http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=189332 
+#if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5 
+ 
+  #ifndef YY_FLUSH_BUFFER 
+    #define YY_FLUSH_BUFFER SQLyy_flush_buffer(YY_CURRENT_BUFFER ) 
+  #endif 
+ 
+  #ifndef yytext_ptr 
+    #define yytext_ptr SQLyytext 
+  #endif 
+ 
+#endif 
+ 
 /* 
  * Read SQL string literal 
  * Valid strings: 
 
Regards, 
 
Rene 
Comment 18 foskey 2003-05-14 16:02:21 UTC
I have applied this bug and built Openoffice.org completely with the
new flex.  This looks OK to go.
Comment 19 foskey 2003-05-21 14:17:16 UTC
Implemented patches to allow this to compile cleanly on the beta2 tag.
Comment 20 nils.fuhrmann 2003-05-22 13:58:23 UTC
NF->OJ: The transex3 part is done. If I'm its your task, now.
Comment 21 ocke.janssen 2003-05-23 08:00:14 UTC
I've applied the patch for the current version (beta2).

Bye.

Ocke
Comment 22 foskey 2003-05-24 13:20:12 UTC
This has been built with old and new flex version,  closing issue.
Comment 23 foskey 2003-05-24 13:20:36 UTC
Verifying issue,  also built on other platforms.
Comment 24 foskey 2003-06-18 14:49:39 UTC
Closing.