Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magma does not build using make #114

Open
fabianfrz opened this issue Oct 31, 2017 · 4 comments
Open

Magma does not build using make #114

fabianfrz opened this issue Oct 31, 2017 · 4 comments

Comments

@fabianfrz
Copy link
Contributor

Error Message:

Finished zlib-build at 07:25:27  on 2017-10-31
Finished openssl-build at 07:30:56  on 2017-10-31


mysql-build failed at 07:33:03  on 2017-10-31




build failed at 07:33:03  on 2017-10-31




all failed at 07:33:03  on 2017-10-31


make: *** [Makefile:444: magmad.so] Fehler 1

Output of yaourt (package manager):

2 extra/libmariadbclient 10.1.28-1 [installed]
    MariaDB client libraries
3 extra/mariadb 10.1.28-1 [installed]
    Fast SQL database server, drop-in replacement for MySQL
4 extra/mariadb-clients 10.1.28-1 [installed]
    MariaDB client tools

Version of the Code: 11.10. 2017
OS: Arch Linux (up to date)

@ghost
Copy link

ghost commented Nov 24, 2017

|yum install -y zlib-devel try it on CentOS 7 or make sure you have zlib-devel
so might need mysql-devel ??
Finished zlib-build at 04:49:43 PM on 11/24/2017
Finished openssl-build at 04:53:39 PM on 11/24/2017

@fabianfrz
Copy link
Contributor Author

The headers exist:

# ls /usr/include/mysql/
auth_dialog_client.h          my_config.h                   my_xml.h                      service_my_snprintf.h
big_endian.h                  my_dbug.h                     plugin_audit.h                service_progress_report.h
byte_order_generic.h          my_decimal_limits.h           plugin_auth_common.h          services.h
byte_order_generic_x86_64.h   my_dir.h                      plugin_auth.h                 service_sha1.h
byte_order_generic_x86.h      my_getopt.h                   plugin_encryption.h           service_sha2.h
client_plugin.h               my_global.h                   plugin_ftparser.h             service_thd_alloc.h
decimal.h                     my_list.h                     plugin.h                      service_thd_autoinc.h
errmsg.h                      my_net.h                      plugin_password_validation.h  service_thd_error_context.h
handler_ername.h              my_pthread.h                  private/                      service_thd_rnd.h
handler_state.h               mysql_com.h                   psi/                          service_thd_specifics.h
keycache.h                    mysql_com_server.h            service_base64.h              service_thd_timezone.h
little_endian.h               mysqld_ername.h               service_debug_sync.h          service_thd_wait.h
ma_dyncol.h                   mysqld_error.h                service_encryption.h          service_wsrep.h
m_ctype.h                     mysql_embed.h                 service_encryption_scheme.h   sql_common.h
m_string.h                    mysql.h                       service_kill_statement.h      sql_state.h
my_alloc.h                    mysql_time.h                  service_logger.h              sslopt-case.h
my_attribute.h                mysql_version.h               service_md5.h                 sslopt-longopts.h
my_byteorder.h                my_sys.h                      service_my_crypt.h            sslopt-vars.h
my_compiler.h                 my_valgrind.h                 service_my_print_error.h      typelib.h

I am on Arch Linux - there are no -devel packages (all packages include the lib/tool, headers and the stuff for linking)

@gwoplock
Copy link
Contributor

gwoplock commented Apr 11, 2018

it appears the issue is stemming from this

manager.c: In function 'mysql_manager_connect':
../include/my_net.h:113:71: warning: passing argument 5 of 'gethostbyname_r' from incompatible pointer type [-Wincompatible-pointer-types]
 #define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
                                                                   ^
manager.c:131:10: note: in expansion of macro 'my_gethostbyname_r'
 hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
      ^~~~~~~~~~~~~~~~~~
In file included from manager.c:46:0:
/usr/include/netdb.h:178:12: note: expected 'struct hostent ** restrict' but argument is of type 'int *'
 extern int gethostbyname_r (const char *__restrict __name,
        ^~~~~~~~~~~~~~~
In file included from manager.c:30:0:
../include/my_net.h:113:39: error: too few arguments to function 'gethostbyname_r'
 #define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E))
                                   ^
manager.c:131:10: note: in expansion of macro 'my_gethostbyname_r'
     hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
          ^~~~~~~~~~~~~~~~~~
In file included from manager.c:46:0:
/usr/include/netdb.h:178:12: note: declared here
 extern int gethostbyname_r (const char *__restrict __name,
            ^~~~~~~~~~~~~~~
make[3]: *** [Makefile:654: manager.lo] Error 1

``

If I had to guess there is a small api change from the version of Linux Centos 6 uses to Linux 4.16 or whatever your on.

@ladar
Copy link
Member

ladar commented Apr 11, 2018

It appears the bundled version of MySQL is incompatible with the gethostbyname_r function on your system. If you can figure out how to fix this issue, without breaking compatibility on other systems, we can add a patch to the lib/patches/mysql/ folder which fixes the MySQL code, so it will work with the new interface. It could be something as simple as casting the offending type, but I don't know for sure. You could also add logic to the build script so the patch is only applied when necessary.

Technically speaking, the a full version of MySQL v5.1.73 is bundled, but only the client library is used by magma. The system bundled version is used for the server daemon. If the build error is in the daemon, and not the client library, reconfiguring the build options to only compile the client library could circumvent the issue. The reason I haven't done this already is so the bundled daemon code can be used to run the client library unit tests.

The other option is dropping the source tarball for a newer MySQL version into lib/archives/ and then updating the magma/dev/scripts/builders/build.lib.params.sh to reflect the version change. If you take this route, you'll probably need to comment out lines 936 and 937 in the magma/dev/scripts/builders/build.lib.sh script, as the bundled patch won't work properly on the newer version. You may need to tweak other flags and settings as well.

Also note. Newer versions of MariaDB and MySQL won't accept the magma schema by default. They consider the default DATE and DATETIME values of '0000-00-00' and '0000-00-00 00:00:00' invalid. This issue can be worked around with a my.cnf setting which allows those values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants