Bug #91927 8.0.12 no longer builds with Mac brew-installed ICU
Submitted: 8 Aug 2018 5:14 Modified: 8 Aug 2018 20:55
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.12 OS:MacOS (10.13.6)
Assigned to: CPU Architecture:Any
Tags: icu, regression

[8 Aug 2018 5:14] Laurynas Biveinis
Description:
8.0.11 built fine, 8.0.12 does not.

cmake ../mysql-8.0.12 -DBUILD_CONFIG=mysql_release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_DOWNLOADS=ON -DWITH_SSL=/usr/local/opt/openssl/ -DDOWNLOAD_BOOST=ON -DWITH_BOOST=~/percona/mysql-boost/ -DWITH_AUTHENTICATION_LDAP=ON -DWITH_SYSTEM_LIBS=ON -DWITH_ICU=/usr/local/opt/icu4c -DWITH_DEBUG=ON -DWITH_INNODB_EXTRA_DEBUG=ON
...
make
...
/Users/laurynas/percona/mysql-8.0.12/plugin/x/src/xpl_regex.cc:56:3: error: unknown type name 'UnicodeString'; did you mean 'icu_62::UnicodeString'?
  UnicodeString value_as_utf8{icu::UnicodeString::fromUTF8(value)};
  ^~~~~~~~~~~~~
  icu_62::UnicodeString
/usr/local/opt/icu4c/include/unicode/unistr.h:286:20: note: 'icu_62::UnicodeString' declared here
class U_COMMON_API UnicodeString : public Replaceable
                   ^
1 error generated.
make[2]: *** [plugin/x/CMakeFiles/mysqlx.dir/src/xpl_regex.cc.o] Error 1

How to repeat:
See above
[8 Aug 2018 5:15] Laurynas Biveinis
$ brew info icu4c
icu4c: stable 62.1 (bottled) [keg-only]
C/C++ and Java libraries for Unicode and globalization
http://site.icu-project.org/
/usr/local/Cellar/icu4c/62.1 (250 files, 67.3MB)
  Poured from bottle on 2018-06-22 at 14:43:00
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/icu4c.rb
...
[8 Aug 2018 7:20] Terje Røsten
Hi!

Thanks for report!

Can you try the following patch:

iff --git a/plugin/x/src/xpl_regex.cc b/plugin/x/src/xpl_regex.cc
index eefb14d78b7..a77a807459c 100644
--- a/plugin/x/src/xpl_regex.cc
+++ b/plugin/x/src/xpl_regex.cc
@@ -53,7 +53,7 @@ bool xpl::Regex::match(const char *value) const {
    * and parse the text patter each time that xpl::Regex::match
    * is called.
    */
-  UnicodeString value_as_utf8{icu::UnicodeString::fromUTF8(value)};
+  icu::UnicodeString value_as_utf8{icu::UnicodeString::fromUTF8(value)};
   std::unique_ptr regexp{
       m_pattern->matcher(value_as_utf8, match_status)};
[8 Aug 2018 7:44] Laurynas Biveinis
Thanks - with the patch the build is successful
[8 Aug 2018 20:55] Terje Røsten
Thanks for confirmation, patch will be included in next release.