Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 666518 - app-text/sword-1.8.0 fails build with icu-61+ due to UnicodeString icu namespace error
Summary: app-text/sword-1.8.0 fails build with icu-61+ due to UnicodeString icu namesp...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Theology Herd (disbanded)
URL:
Whiteboard:
Keywords:
: 666564 (view as bug list)
Depends on:
Blocks: icu-61
  Show dependency tree
 
Reported: 2018-09-18 23:39 UTC by Duncan
Modified: 2018-10-11 21:14 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan 2018-09-18 23:39:36 UTC
From the icu-62.1 readme.html file (installed as /usr/share/doc/icu-62.1/html/readme.html), under Recommended Build Options:

>>>

* Namespace (ICU 61 and later): Since ICU 61, call sites need to qualify
ICU types explicitly, for example icu::UnicodeString, or do using
icu::UnicodeString; where appropriate. If your code relies on the
"using namespace icu;" that used to be in unicode/uversion.h, then you
need to update your code.
You could temporarily (until you have more time to update your code)
revert to the default "using" via -DU_USING_ICU_NAMESPACE=1 or by
modifying unicode/uversion.h:

<<<

Based on that, adding:

append-cxxflags -DU_USING_ICU_NAMESPACE=1

to the sword-1.8.0 ebuild allows it to build just fine.

(Tho while I was there, as I'm on gcc-8 I commented the append-cxxflags 
-std=c++14 line, and took the liberty of commenting the stripflags line as well.)

Without that, the build dies fairly early in the compile phase with this as the first error, so the trigger is pretty clearly the above icu change:


/bin/sh ../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../include  -I../include  -I/usr/include -DUSE_AUTOTOOLS -DUNIX -Dunix -D__unix__ -DSWICU_DATA=\"/usr/lib64/sword/1.8.0_icu_\"   -D_FTPLIB_NO_COMPAT  -Ofast -fPIC -DEXCLUDEBZIP2 -DEXCLUDEXZ -D_ICU_ -DCURLAVAILABLE  -DUSEXAPIAN  -Wno-address -Wno-nonnull-compare  -march=native -pipe -O2 -std=c++14 -ftemplate-depth=100 -c -o osisxhtml.lo `test -f '../src/modules/filters/osisxhtml.cpp' || echo './'`../src/modules/filters/osisxhtml.cpp
../src/modules/filters/utf8scsu.cpp: In member function 'virtual char sword::UTF8SCSU::processText(sword::SWBuf&, const sword::SWKey*, const sword::SWModule*)':
../src/modules/filters/utf8scsu.cpp:49:2: error: 'UnicodeString' was not declared in this scope
UnicodeString utf16Text(text.getRawData(), text.length(), utf8Conv, err);
^~~~~~~~~~~~~
../src/modules/filters/utf8scsu.cpp:49:2: note: suggested alternative:
In file included from ../include/utf8scsu.h:31,
from ../src/modules/filters/utf8scsu.cpp:25:
/include/unicode/unistr.h:286:20: note:   'icu::UnicodeString'
class U_COMMON_API UnicodeString : public Replaceable
^~~~~~~~~~~~~
../src/modules/filters/utf8scsu.cpp:51:16: error: 'utf16Text' was not declared in this scope
int32_t len = utf16Text.extract(text.getRawData(), text.size(), scsuConv, err);
^~~~~~~~~
make[1]: *** [Makefile:1622: utf8scsu.lo] Error 1
make[1]: *** Waiting for unfinished jobs....



Obviously appending the -D-flag is more a band-aid than a fix.  The fix would be a patch to fix the namespacing as appropriate and submit to sword-upstream if they've not already covered it and simply haven't released yet (1.8.0's still the latest on the homepage, I checked).  But the band-aid worked for me, for now.
Comment 1 Duncan 2018-09-19 00:49:20 UTC
(In reply to Duncan from comment #0)
> (1.8.0's still the latest on the homepage, I checked)

Actually, it's not announced on the main page (which still has the 1.8.0 announcement as the latest), but the current version download link points to 1.8.1.  So there's an apparently rather minor/technical-only bump of /some/ sort.  But downloading it and investigating the NEWS file simply points me at Changelog, and that doesn't appear to have anything listed from the approximately two-week gap between the 1.8.0 release in on 2017-12-23 and the 1.8.1 release on 2018-01-08, either.  So whatever the changes for 1.8.1 are it appears you have to actually check the svn logs to see them.

Update: Dredging the devel list archives I found the 1.8.1 announcement (well, a pointer to an HTML attachment that quoted it...), and apparently 1.8.1 is (at least primarily) bindings fixes including SWIG, and cmake scripts updates.  No mention of any icu-related updates.
Comment 2 Duncan 2018-09-19 01:02:43 UTC
Still dredging the devel list archive, I finally found some discussion of icu-61+ here (toward the bottom, icu 61.1 thread):

https://www.crosswire.org/pipermail/sword-devel/2018-April/thread.html

They don't mention the icu note I quoted but do say something (vague) about updating the autotools and cmake scripts to version-compare and add the necessary preprocessor macro.

So they're aware of the issue and will hopefully have it fixed by next release.  But that'd be too early to have it fixed in svn, and nothing later on-list I could find (I was working backward), so someone would have to go thru the commits to see upstream status.  Presumably fedora (rawhide anyway) has an rpm fix and note by now, however.
Comment 3 Duncan 2018-09-19 01:08:02 UTC
(In reply to Duncan from comment #2)
> Presumably fedora (rawhide anyway) has an rpm fix and note by now, however.

Yes.  See here from April 30 (2018) forward.  There's at least three icu-related  notations.


https://www.rpmfind.net/linux/RPM/fedora/devel/rawhide/x86_64/s/sword-1.8.1-8.fc29.i686.html
Comment 4 Andreas Sturmlechner gentoo-dev 2018-09-21 11:30:44 UTC
*** Bug 666564 has been marked as a duplicate of this bug. ***
Comment 5 Larry the Git Cow gentoo-dev 2018-10-11 00:05:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a486b6ed5e7ad6dfce634d0b2dc574bed81c825

commit 0a486b6ed5e7ad6dfce634d0b2dc574bed81c825
Author:     Chris Reffett <creffett@gentoo.org>
AuthorDate: 2018-10-11 00:03:45 +0000
Commit:     Chris Reffett <creffett@gentoo.org>
CommitDate: 2018-10-11 00:05:11 +0000

    app-text/sword: Version bump, fix ICU
    
    Bump to 1.8.1, add patch from Fedora to fix builds with ICU >= 62
    
    Bug: https://bugs.gentoo.org/666518
    Signed-off-by: Chris Reffett <creffett@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 app-text/sword/Manifest                            |   2 +-
 app-text/sword/files/sword-1.8.1-icu61.diff        | 138 +++++++++++++++++++++
 .../{sword-1.8.0.ebuild => sword-1.8.1.ebuild}     |   3 +-
 3 files changed, 141 insertions(+), 2 deletions(-)