Bug #74241 mysql-workbench: FTBFS on kfreebsd, hurd, ppc64el, s390x
Submitted: 7 Oct 2014 3:10 Modified: 19 Oct 2014 22:01
Reporter: Dmitry Smirnov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:6.2.3 OS:Linux (Debian "unstable")
Assigned to: CPU Architecture:Any

[7 Oct 2014 3:10] Dmitry Smirnov
Description:
MySQL Workbench FTBFS on multiple architectures with the following errors:

~~~~
In file included from /var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/sqlide/sql_editor_be.h:40:0, 
                 from /var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/grt/editor_base.h:26, 
                 from /var/tmp/src/m-w/mysql-workbench-6.2.3/frontend/linux/linux_utilities/plugin_editor_base.cpp:18: 
/var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/grtsqlparser/mysql_parser_services.h:96:80: error: ‘db_mysql_RoutineRef’ does not name a type 
   virtual size_t parseRoutine(const parser::ParserContext::Ref &context, const db_mysql_RoutineRef &routine, const std::string &sql) = 0; 
                                                                                ^ 
In file included from /var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/sqlide/sql_editor_be.h:40:0, 
                 from /var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/grt/editor_base.h:26, 
                 from /var/tmp/src/m-w/mysql-workbench-6.2.3/frontend/linux/linux_utilities/plugin_editor_base.cpp:18: 
/var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/grtsqlparser/mysql_parser_services.h:97:81: error: ‘db_mysql_RoutineGroupRef’ does not name a type 
   virtual size_t parseRoutines(const parser::ParserContext::Ref &context, const db_mysql_RoutineGroupRef &group, const std::string &sql) = 0; 
                                                                                 ^ 
/var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/grtsqlparser/mysql_parser_services.h:98:72: error: ‘db_mysql_TriggerRef’ does not name a type 
   virtual size_t parseTrigger(const ParserContext::Ref &context, const db_mysql_TriggerRef &trigger, const std::string &sql) = 0; 
                                                                        ^ 
/var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/grtsqlparser/mysql_parser_services.h:99:77: error: ‘db_mysql_ViewRef’ does not name a type 
   virtual size_t parseView(const parser::ParserContext::Ref &context, const db_mysql_ViewRef &view, const std::string &sql) = 0; 
                                                                             ^ 
/var/tmp/src/m-w/mysql-workbench-6.2.3/backend/wbpublic/grtsqlparser/mysql_parser_services.h:102:90: error: ‘db_mysql_CatalogRef’ does not name a type 
   virtual size_t renameSchemaReferences(const parser::ParserContext::Ref &context, const db_mysql_CatalogRef &catalog, 
                                                                                          ^ 
frontend/linux/linux_utilities/CMakeFiles/linux_utilities.dir/build.make:126: recipe for target 'frontend/linux/linux_utilities/CMakeFiles/linux_utilities.dir/plugin_editor_base.cpp.o' failed 
~~~~

See full logs

 * https://buildd.debian.org/status/fetch.php?pkg=mysql-workbench&arch=hurd-i386&ver=6.2.3%2B...
 * https://buildd.debian.org/status/fetch.php?pkg=mysql-workbench&arch=kfreebsd-amd64&ver=6.2...
 * https://buildd.debian.org/status/fetch.php?pkg=mysql-workbench&arch=kfreebsd-i386&ver=6.2....
 * https://buildd.debian.org/status/fetch.php?pkg=mysql-workbench&arch=ppc64el&ver=6.2.3%2Bdf...
 * https://buildd.debian.org/status/fetch.php?pkg=mysql-workbench&arch=s390x&ver=6.2.3%2Bdfsg...

This is a regression from 6.1.7 which was building just fine on all architectures.

How to repeat:
Build M-W from source on Hurd, kFreeBSD, s390x or ppc64el.
[8 Oct 2014 20:11] Alfredo Kojima
Hi Dmitry,

In backend/wbpublic/grtsqlparser/mysql_parser_services.h there's a #ifdef __linux__ around line 27.
Can you remove that and see if it solves the problem?
[10 Oct 2014 13:33] Dmitry Smirnov
Yes, it is better, thank you. I had to made similar changes to other files as well:

~~~~
--- a/backend/wbpublic/grtsqlparser/mysql_parser_services.h
+++ b/backend/wbpublic/grtsqlparser/mysql_parser_services.h
@@ -23,11 +23,9 @@
 
 #include "mysql-parser-common.h"
 #include "grtdb/db_helpers.h"
 
-#ifdef __linux__
-  #include "grts/structs.db.mysql.h"
-#endif
+#include "grts/structs.db.mysql.h"
 
 class MySQLRecognizer;
 class MySQLSyntaxChecker;
 class MySQLScanner;
--- a/backend/wbprivate/sqlide/execute_routine_wizard.h
+++ b/backend/wbprivate/sqlide/execute_routine_wizard.h
@@ -20,11 +20,9 @@
 #pragma  once
 
 #include "mforms/form.h"
 
-#ifdef __linux__
 #include "grts/structs.db.mysql.h"
-#endif
 
 namespace mforms {
   class Button;
   class TextEntry;
--- a/modules/db.mysql.parser/src/mysql_parser_module.h
+++ b/modules/db.mysql.parser/src/mysql_parser_module.h
@@ -31,12 +31,10 @@
 
 #include "grtpp_module_cpp.h"
 #include "grtsqlparser/mysql_parser_services.h"
 
-#ifdef __linux__
   #include "grts/structs.db.mysql.h"
   #include "grts/structs.wrapper.h"
-#endif
 
 #define DOC_MYSQLPARSERSERVICESIMPL \
   "Parsing services for MySQL.\n"\
   "\n"\
~~~~

It fixed the problem on some architectures but two architectures (s390x, ppc64el) still FTBFS apparently due to different problem:

Here is build log fragment from s390x:

~~~~
[  7%] Building CXX object ext/scintilla/gtk/CMakeFiles/wbscintilla.dir/PlatGTK.cxx.o
cd /«BUILDDIR»/mysql-workbench-6.2.3+dfsg/obj-s390x-linux-gnu/ext/scintilla/gtk && /usr/bin/c++   -DGTK -DHAVE_PRCTL_H -DSCI_LEXER -DSCI_NAMESPACE -D__STDC_FORMAT_MACROS -Dwbscintilla_EXPORTS -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2  -fPIC -I/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/plugins/migration/copytable -I/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/base -I/usr/include/gtk-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/s390x-linux-gnu/glib-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/lib/s390x-linux-gnu/gtk-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/s390x-linux-gnu/sigc++-2.0/include -I/usr/include/glibmm-2.4 -I/usr/lib/s390x-linux-gnu/glibmm-2.4/include -I/usr/include/giomm-2.4 -I/usr/lib/s390x-linux-gnu/giomm-2.4/include -I/usr/include/atkmm-1.6 -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/pangomm-1.4 -I/usr/lib/s390x-linux-gnu/pangomm-1.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib/s390x-linux-gnu/gdkmm-2.4/include -I/usr/include/gtkmm-2.4 -I/usr/lib/s390x-linux-gnu/gtkmm-2.4/include -I/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/ext/scintilla/gtk/. -I/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/ext/scintilla/gtk/../include -I/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/ext/scintilla/gtk/../src -I/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/ext/scintilla/gtk/../lexlib    -Wno-missing-braces -Wno-missing-field-initializers -Wno-char-subscripts -o CMakeFiles/wbscintilla.dir/PlatGTK.cxx.o -c /«BUILDDIR»/mysql-workbench-6.2.3+dfsg/ext/scintilla/gtk/PlatGTK.cxx
In file included from /«BUILDDIR»/mysql-workbench-6.2.3+dfsg/backend/wbpublic/grt/tree_model.h:29:0,
                 from /«BUILDDIR»/mysql-workbench-6.2.3+dfsg/frontend/linux/linux_utilities/listmodel_wrapper.h:22,
                 from /«BUILDDIR»/mysql-workbench-6.2.3+dfsg/frontend/linux/linux_utilities/listmodel_wrapper.cpp:1:
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:636:5: error: 'grt::Ref<grt::internal::Integer>::Ref(ssize_t)' cannot be overloaded
     Ref(ssize_t value)
     ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:629:5: error: with 'grt::Ref<grt::internal::Integer>::Ref(long int)'
     Ref(long int value)
     ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:671:17: error: 'bool grt::Ref<grt::internal::Integer>::operator==(ssize_t) const' cannot be overloaded
     inline bool operator==(ssize_t v) const
                 ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:664:17: error: with 'bool grt::Ref<grt::internal::Integer>::operator==(long int) const'
     inline bool operator==(long int v) const
                 ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:697:17: error: 'bool grt::Ref<grt::internal::Integer>::operator!=(ssize_t) const' cannot be overloaded
     inline bool operator!=(ssize_t v) const
                 ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:689:17: error: with 'bool grt::Ref<grt::internal::Integer>::operator!=(long int) const'
     inline bool operator!=(long int v) const
                 ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h: In member function 'void grt::DictRef::gset(const string&, int)':
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:1804:40: error: call of overloaded 'Ref(int&)' is ambiguous
       content().set(k, IntegerRef(value));
                                        ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:1804:40: note: candidates are:
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:642:5: note: grt::Ref<grt::internal::Integer>::Ref(size_t)
     Ref(size_t value)
     ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:629:5: note: grt::Ref<grt::internal::Integer>::Ref(long int)
     Ref(long int value)
     ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:616:14: note: grt::Ref<grt::internal::Integer>::Ref(grt::internal::Integer*) <near match>
     explicit Ref(internal::Integer *ptr)
              ^
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:616:14: note:   no known conversion for argument 1 from 'int' to 'grt::internal::Integer*'
/«BUILDDIR»/mysql-workbench-6.2.3+dfsg/library/grt/src/grtpp.h:612:5: note: grt::Ref<grt::internal::Integer>::Ref(const grt::Ref<grt::internal::Integer>&)
     Ref(const Ref &value)
     ^
make[4]: *** [frontend/linux/linux_utilities/CMakeFiles/linux_utilities.dir/listmodel_wrapper.cpp.o] Error 1
~~~~

See full logs:

 * https://buildd.debian.org/status/fetch.php?pkg=mysql-workbench&arch=s390x&ver=6.2.3%2Bdfsg...
 * https://buildd.debian.org/status/fetch.php?pkg=mysql-workbench&arch=ppc64el&ver=6.2.3%2Bdf...

Thanks.
[10 Oct 2014 16:08] Marcin Szalowicz
Hi Dmitry,
can you please tell me how the ssize_t and size_t is defined on that platform?
[13 Oct 2014 7:06] Mike Lischke
Neither of these platforms are supported by MySQL Workbench. See the list of supported platforms here: http://www.mysql.com/support/supportedplatforms/workbench.html.
[13 Oct 2014 8:00] Dmitry Smirnov
> [10 Oct 16:08] Marcin Szalowicz
> Hi Dmitry,
> can you please tell me how the ssize_t and size_t is defined on that platform?

Sorry, I have no idea. I don't even have access to those architectures.
All I know is that M-W 6.1.7 was building successfully:

    https://buildd.debian.org/status/package.php?p=mysql-workbench&suite=jessie

> [13 Oct 7:06] Mike Lischke
> Neither of these platforms are supported by MySQL Workbench.
> See the list of supported platforms here:
> http://www.mysql.com/support/supportedplatforms/workbench.html.

Let's not confuse platform (e.g. GNU/Linux) with hardware architecture.
Besides we're talking about downstream binary packages that may not be "supported" at all because they are built from sources.

Closest to Debian on the list of supported platforms is Ubuntu which uses Debian downstream packaging of MySQL Workbench.
[13 Oct 2014 8:04] Dmitry Smirnov
I beg you to reconsider "won't fix". Because M-W 6.1.7 built successfully in the past on s390x, current release 6.2.3 will not migrate to soon-to-be-released Debian "jessie" until this problem is fixed. Unfortunately opportunity window for inclusion of 6.2.3 is closing fast -- there are less than two weeks left until "freeze"...
[13 Oct 2014 15:07] Mike Lischke
These are small fixes, so why not, ok. We just cannot guarantee that we will not introduce other incompatible changes in the future.
[13 Oct 2014 15:54] Mike Lischke
Dmitry, I'm not sure we can create a new release in that short period of time. Can you simply replace the 

#ifdef __linux__

lines by

#if !defined(_WIN32) && !defined(__APPLE__)

? That should solve your problem at hand.
[13 Oct 2014 16:33] Dmitry Smirnov
I already removed "#ifdef __linux__" as per one of my previous comments. The only remaining one is in line 53 of file "library/forms/mforms/toolbar.h" but is looks unrelated to FTBFS on s390x...
[19 Oct 2014 22:01] Dmitry Smirnov
In addition to the above patch commenting "#ifdef __linux__" the following hunk from Marcin Szalowicz fixes the problem:

~~~~
--- a/library/grt/src/grtpp.h
+++ b/library/grt/src/grtpp.h
@@ -551,9 +551,9 @@
   #endif
 #else
   #define DEFINE_SSIZE_T_FUNCTIONS
 
-  #ifdef __x86_64__
+  #if __LP64__
   #define DEFINE_INT_FUNCTIONS
   #endif
 
   #ifdef __APPLE__
~~~~

MySQL Workbench 6.2.3 now builds successfully on all architectures.
Thanks very much.
[20 Oct 2014 6:37] Mike Lischke
Dmitry, thanks for your feedback. I'm glad the build works fine now.
[6 Nov 2014 3:48] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.2.4 release, and here's the changelog entry:

Compiling MySQL Workbench would fail on Hurd, kFreeBSD, s390x, and ppc64el
systems.

Thank you for the bug report.