Issue 109791 - [cws sb118] system-cppunit
Summary: [cws sb118] system-cppunit
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.3
Assignee: rene
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 21:07 UTC by rene
Modified: 2010-06-28 15:51 UTC (History)
3 users (show)

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


Attachments
patch (6.60 KB, patch)
2010-03-03 21:08 UTC, rene
no flags Details | Diff
new patch with typo fixes and adding the other makefiles (25.10 KB, patch)
2010-03-03 23:15 UTC, rene
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description rene 2010-03-03 21:07:27 UTC
as $SUBJECT says. No idea why not done when switching cppunit to a normal
cppunit, but anyway...
Comment 1 rene 2010-03-03 21:08:29 UTC
Created attachment 68134 [details]
patch
Comment 2 Stephan Bergmann 2010-03-03 21:30:33 UTC
@rene:  A few things come to mind:
1  libs.mk CPPUNITLIB:  For one, shouldn't the check for SYSTEM_CPPUNIT come before the check for WNT 
(so that WNT could, at least in principle, also use SYSTEM_CPPUNIT)?  For another, the "+=" in "CPPUNITLIB 
+= $(CPPUNIT_LIBS)" is probably a typo.  (And for a third, wouldn't it be better to replace CPPUNITLIB with 
CPPUNIT_LIBS everywhere and set it in libs.mk only if not SYSTEM_CPPUNIT?)
2  What looks odd is that only sal/cppunittester/makefile.mk mentions CPPUNIT_CFLAGS, not the other 
makefiles that reference cppunit.  (And again, wouldn't it be better if the CFLAGS+=CPPUNIT_CFLAGS 
would be unconditional, and CPPUNIT_CFLAGS were set empty for the non-SYSTEM_CPPUNIT case in some 
solenv/inc/*.mk?)
Comment 3 rene 2010-03-03 21:39:17 UTC
> 1  libs.mk CPPUNITLIB:  For one, shouldn't the check for SYSTEM_CPPUNIT come >
before the check for WN (so that WNT could, at least in principle, also use
SYSTEM_CPPUNIT)? 

no system-* will probably work on windows, nor would it make sense, so I
wouldn't bother

> For  another, the "+=" in "CPPUNITLIB  += $(CPPUNIT_LIBS)" is probably a typo.

Yes.

> (And for a third, wouldn't it be better to replace CPPUNITLIB with 
> CPPUNIT_LIBS everywhere and set it in libs.mk only if not SYSTEM_CPPUNIT?)

Wanted to do it minimal-invasive, but we can do, yes.

> 2  What looks odd is that only sal/cppunittester/makefile.mk mentions
> CPPUNIT_CFLAGS, not the other makefiles that reference cppunit.

I only noticed that one, will grep for the rest.
they are for example?

> (And again, wouldn't it be better if the CFLAGS+=CPPUNIT_CFLAGS 
> would be unconditional, and CPPUNIT_CFLAGS were set empty for the
> non-SYSTEM_CPPUNIT case in some  solenv/inc/*.mk?)

I don't think so, libs != includes, and we don't do that for any
other system-* either
Comment 4 rene 2010-03-03 21:46:01 UTC
> Wanted to do it minimal-invasive, but we can do, yes.

Besides that, we do that for other system-*, too (see the libxslt right below
cppunit), so for consistency we should do it like in the initial patch IMHO

> 2  What looks odd is that only sal/cppunittester/makefile.mk mentions
> CPPUNIT_CFLAGS, not the other makefiles that reference cppunit.

Do they need the includes (And it would for me either way as /usr/include is
a standard path and this /usr/include/cppunit/* is found anyway without -I);
cppunittester of course needs headers, the other occurances in sal are just
linkages afaics.
Comment 5 rene 2010-03-03 21:50:41 UTC
> Do they need the include

answer to myself: yes, sal/qa/rtl/*.cxx....
Comment 6 Stephan Bergmann 2010-03-03 21:53:07 UTC
"I only noticed that one, will grep for the rest. they are for example?": e.g., o3tl/qa/makefile.mk;  "Do they 
need the includes": yes, they do

"Wanted to do it minimal-invasive, but we can do, yes.", "I don't think so, libs != includes, and we don't do 
that for any other system-* either", "so for consistency we should do it like in the initial patch IMHO":  
True, we would start something new with this.  But IMO something much better than the current 
conventions (e.g., I would have loved to have CXX/LDFLAGS_STLPORT available in the new 
cppunit/makefile.mk, and had to re-engineer them from the solenv/inc/*.mk mess).  So, IMO, I would not 
mind deviating from old conventions here...
Comment 7 rene 2010-03-03 23:15:08 UTC
Created attachment 68135 [details]
new patch with typo fixes and adding the other makefiles
Comment 8 rene 2010-03-03 23:25:35 UTC
s/libwpd/cppunit/ in configure.in of course, will not attach a new file for just
that :-) .oO ( cut'n'waste )
Comment 9 rene 2010-03-03 23:33:19 UTC
sb: any objection to push it like it is (+/- stuff I will find, a build runs
currently) and do finetuning/improvements later?
Comment 10 Stephan Bergmann 2010-03-04 08:25:20 UTC
"any objection to push it like it is [...] and do finetuning/improvements
later?"  Fine with me.

Two further points:
1  CPPUNIT_CFLAGS should probably always only be added to CXXFLAGS, never to CFLAGS.
2  From what I had written down at
<http://wiki.services.openoffice.org/wiki/Test_Cleanup#CppUnit_1.12.1> a while
ago, "TODO: OOo configure --with-system-cppunit (only if also
--with-system-stl!); minimal required version?"  That is, configure should fail
for --with-system-cppunit/--without-system-stl combination.  I am not (yet) sure
what the minimal required version is, though.
Comment 11 rene 2010-03-04 08:37:40 UTC
> 1  CPPUNIT_CFLAGS should probably always only be added to CXXFLAGS, never to
> CFLAGS.

maybe, but CFLAGS works and is consistent with the rest.

> 2  From what I had written down at
> <http://wiki.services.openoffice.org/wiki/Test_Cleanup#CppUnit_1.12.1> a while
> ago, "TODO: OOo configure --with-system-cppunit (only if also
> --with-system-stl!); minimal required version?"

ARGH. Not again.

>  That is, configure should fail
> for --with-system-cppunit/--without-system-stl combination.  I am not (yet)
> sure what the minimal required version is, though.

Well, I guess we can just use 1.12, no? Shouldn't matter much as we didn't have
that flag before anywy.

Wrt STLport: no way, if you really have a STL conflict (like we ha(d/ve) with
graphite and mysqlc) apply a workaround like the one caolan did for graphite
already (see issue 106157);  it is bad to use system-cppunit on everything
except i386. Better all or none....
Comment 12 rene 2010-03-04 08:42:25 UTC
Ccing cmc
Comment 13 caolanm 2010-03-04 08:53:21 UTC
mumble, we should really consider dropping using stlport in OOo itself, and just
build it and bundle it as an extra into the install sets for compatibility with
existing 3rd party binary extensions. I think that'd probably work as I don't
think it would modify the public abi to build it against just libstdc++.
Comment 14 Stephan Bergmann 2010-03-04 09:16:39 UTC
>> 1  CPPUNIT_CFLAGS should probably always only be added to CXXFLAGS, never to
>> CFLAGS.
> 
> maybe, but CFLAGS works and is consistent with the rest.

Technically, CFLAGS works (as CFLAGS is added to C++ compilation in addition to
CXXFLAGS), but CXXFLAGS would be more correct.  Anyway, even if you want to keep
using CFLAGS for consistency, please clean up the places that now have both,
CFLAGS+=CPPUNIT_CFLAGS and CXXFLAGS+=CPPUNIT_CFLAGS.

>>  That is, configure should fail
>> for --with-system-cppunit/--without-system-stl combination.  I am not (yet)
>> sure what the minimal required version is, though.
> 
> Well, I guess we can just use 1.12, no? Shouldn't matter much as we didn't have
> that flag before anywy.

Probably good, yes.  If somebody ever has a need for a lower version, they can
check to modify this then.

> Wrt STLport: no way, if you really have a STL conflict (like we ha(d/ve) with
> graphite and mysqlc) apply a workaround like the one caolan did for graphite
> already (see issue 106157);  it is bad to use system-cppunit on everything
> except i386. Better all or none....

You unfortunately cannot work around that here.  The interface of CppUnit is
full of std-types, so the OOo test code calling CppUnit and CppUnit itself have
to use the same STL implementation.  However, the OOo test code also shall
access OOo code that has std-types in its respective interface, so those two
need to use the same STL implementation, too.

We can only improve things here when we eventually drop the STLport-requirement
(and become URE-incompatible on the affected platforms).
Comment 15 Stephan Bergmann 2010-03-04 09:33:23 UTC
@cmc:  Might work (problematic could be the ABIs of cppuhelper and salhelper,
incl. passing objects through void* and throwing std-based exceptions).  Anyway,
I would prefer moving that to another issue or thread.
Comment 16 rene 2010-03-04 09:41:00 UTC
> We can only improve things here when we eventually drop the STLport-requirement
> (and become URE-incompatible on the affected platforms).

one more reason we should have done it with 3.0.0 (major version which has other
structure because of the 3-layers anyway, why not breking this then) :-(
Comment 17 rene 2010-03-04 09:46:59 UTC
sb: ok, added the check :-(
Comment 18 Stephan Bergmann 2010-03-09 12:44:36 UTC
OK to set to FIXED, I assume (I want to pass CWS sb118 to QA soon)
Comment 19 Stephan Bergmann 2010-03-11 16:59:03 UTC
.
Comment 20 Martin Hollmichel 2010-06-28 15:51:12 UTC
close issue.