Bug 197232 - databases/mariadb100-server: fix build of TokuDB storage engine
Summary: databases/mariadb100-server: fix build of TokuDB storage engine
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bernard Spil
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-01 04:22 UTC by Jim Riggs
Modified: 2018-01-12 06:24 UTC (History)
2 users (show)

See Also:
brnrd: maintainer-feedback+


Attachments
TokuDB patch (3.96 KB, patch)
2015-02-01 04:22 UTC, Jim Riggs
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Riggs 2015-02-01 04:22:06 UTC
Created attachment 152428 [details]
TokuDB patch

The cmake configuration currently skips TokuDB, as it only checks for a Linux x86_64 system. The attached patch fixes that and corrects a couple of other issues required to get Toku to build properly. I will be submitting these patches upstream too, but it would be nice to get them into the port in the meantime. I have been successfully using the resulting ha_tokudb.so plugin with MariaDB on 10.1-RELEASE without issue.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-01 04:22:06 UTC
Maintainer CC'd
Comment 2 Bernard Spil freebsd_committer freebsd_triage 2015-02-01 19:27:34 UTC
Hi Jim,

Thanks for the patch! Ran into an issue when I compiled after the patch was applied.

In file included from /usr/ports/databases/mariadb100-server/work/mariadb-10.0.16/storage/tokudb/ft-index/util/context.cc:94:
In file included from /usr/ports/databases/mariadb100-server/work/mariadb-10.0.16/storage/tokudb/ft-index/util/context.h:96:
/usr/ports/databases/mariadb100-server/work/mariadb-10.0.16/storage/tokudb/ft-index/buildheader/db.h:323:1: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
struct __toku_db_lsn {
^
1 error generated.
storage/tokudb/ft-index/util/CMakeFiles/util_static.dir/build.make:54: recipe for target 'storage/tokudb/ft-index/util/CMakeFiles/util_static.dir/context.cc.o' failed
gmake[4]: *** [storage/tokudb/ft-index/util/CMakeFiles/util_static.dir/context.cc.o] Error 1

Any clues? It'll take some time before I can dig deeper.
Comment 3 Jim Riggs 2015-02-01 20:55:55 UTC
(In reply to Bernard Spil from comment #2)

:-( I created that patch against 10.0.15. Let me try it again with 10.0.16.
Comment 4 Jim Riggs 2015-02-01 21:21:38 UTC
(In reply to Jim Riggs from comment #3)

I just tested it with 10.0.16, and the build was successful. I realized, though, that I am on 10.0-RELEASE, not 10.1. What are you using? I guess I'll upgrade and try again. :-\

FreeBSD packagebuild 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: Tue Jul  8 06:37:44 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
Comment 5 Bernard Spil freebsd_committer freebsd_triage 2015-02-02 10:13:46 UTC
Hi Jim, Built it on 10.1. Looking at the error with C++11 it may well be the newer version clang in 10.1 (which also breaks OQGraph, Groonga and i386 builds)
Comment 6 Jim Riggs 2015-02-02 13:20:29 UTC
The clang bump is indeed the issue. Once I fixed the first error that you found (it has been fixed upstream by Tokutek), that led to another and another and another. I am about 4 or 5 deep right now. I'm not sure if correcting all of these as one-offs is the answer, or if the port should just build with GCC (which I also hate to do). :-(
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2015-08-13 13:43:33 UTC
Over to new maintainer.
Comment 8 Bernard Spil freebsd_committer freebsd_triage 2015-08-15 15:04:59 UTC
TokuDB build depends on bash (for no good reason)

--- storage/tokudb/ft-index/buildheader/CMakeLists.txt.orig     2015-08-15 16:04:13.242031814 +0200
+++ storage/tokudb/ft-index/buildheader/CMakeLists.txt  2015-08-15 16:04:38.983329912 +0200
@@ -1,6 +1,6 @@
 set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "")

-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/bash
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/sh
 out=$1; shift
 exec \"$@\" >$out")

@@ -8,7 +8,7 @@ add_executable(make_tdb make_tdb.cc)
 set_property(TARGET make_tdb APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
 add_custom_command(
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db.h"
-  COMMAND bash runcat.sh "${CMAKE_CURRENT_BINARY_DIR}/db.h" $<TARGET_FILE:make_tdb>
+  COMMAND sh runcat.sh "${CMAKE_CURRENT_BINARY_DIR}/db.h" $<TARGET_FILE:make_tdb>
   DEPENDS make_tdb)
 add_custom_target(install_tdb_h DEPENDS
   "${CMAKE_CURRENT_BINARY_DIR}/db.h")
@@ -26,4 +26,4 @@ if (NOT DEFINED MYSQL_PROJECT_NAME_DOCST
     DESTINATION include
     COMPONENT tokukv_headers
     )
-endif ()
\ No newline at end of file
+endif ()
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-01-14 21:57:53 UTC
A commit references this bug:

Author: brnrd
Date: Sat Jan 14 21:57:34 UTC 2017
New revision: 431497
URL: https://svnweb.freebsd.org/changeset/ports/431497

Log:
  databases/mariadb100-server: Update to 10.0.29

   - Update to 10.0.29
   - Update mariadb100-client
   - Update patches
   - Regen patches with makepatch
   - Pet portlint
   - Add MROONGA liblz4 dependency
   - Fix MROONGA liblz4 linking
   - rm erroneously installed files

  PR:             197232, 204014, 215901
  MFH:            2017Q1
  Security:       22373c43-d728-11e6-a9a5-b499baebfeaf

Changes:
  head/databases/mariadb100-client/Makefile
  head/databases/mariadb100-client/files/patch-CMakeLists.txt
  head/databases/mariadb100-client/files/patch-client_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-extra_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-include_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-include_my__compare.h
  head/databases/mariadb100-client/files/patch-include_my_compare.h
  head/databases/mariadb100-client/files/patch-libmysql_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-libservices_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-man_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-mysys_my__default.c
  head/databases/mariadb100-client/files/patch-mysys_my_default.c
  head/databases/mariadb100-client/files/patch-pcre_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-scripts_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-scripts_mysql__config.sh
  head/databases/mariadb100-client/files/patch-scripts_mysql_config.sh
  head/databases/mariadb100-client/files/patch-sql_CMakeLists.txt
  head/databases/mariadb100-client/files/patch-support-files_CMakeLists.txt
  head/databases/mariadb100-server/Makefile
  head/databases/mariadb100-server/distinfo
  head/databases/mariadb100-server/files/patch-extra_CMakeLists.txt
  head/databases/mariadb100-server/files/patch-mysys_my__default.c
  head/databases/mariadb100-server/files/patch-scripts_mysqld__safe.sh
  head/databases/mariadb100-server/files/patch-storage_tokudb_PerconaFT_ft_CMakeLists.txt
  head/databases/mariadb100-server/files/patch-support-files_CMakeLists.txt
  head/databases/mariadb100-server/pkg-plist
Comment 10 Bernard Spil freebsd_committer freebsd_triage 2017-01-14 21:58:43 UTC
TokuDB now builds fine in my poudriere jails.
Comment 11 commit-hook freebsd_committer freebsd_triage 2017-01-15 20:26:25 UTC
A commit references this bug:

Author: brnrd
Date: Sun Jan 15 20:25:31 UTC 2017
New revision: 431598
URL: https://svnweb.freebsd.org/changeset/ports/431598

Log:
  MFH: r431497

  databases/mariadb100-server: Update to 10.0.29

   - Update to 10.0.29
   - Update mariadb100-client
   - Update patches
   - Regen patches with makepatch
   - Pet portlint
   - Add MROONGA liblz4 dependency
   - Fix MROONGA liblz4 linking
   - rm erroneously installed files

  PR:             197232, 204014, 215901
  Security:       22373c43-d728-11e6-a9a5-b499baebfeaf

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/databases/mariadb100-client/Makefile
  branches/2017Q1/databases/mariadb100-client/files/patch-CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-client_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-extra_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-include_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-include_my__compare.h
  branches/2017Q1/databases/mariadb100-client/files/patch-include_my_compare.h
  branches/2017Q1/databases/mariadb100-client/files/patch-libmysql_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-libservices_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-man_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-mysys_my__default.c
  branches/2017Q1/databases/mariadb100-client/files/patch-mysys_my_default.c
  branches/2017Q1/databases/mariadb100-client/files/patch-pcre_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-scripts_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-scripts_mysql__config.sh
  branches/2017Q1/databases/mariadb100-client/files/patch-scripts_mysql_config.sh
  branches/2017Q1/databases/mariadb100-client/files/patch-sql_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-client/files/patch-support-files_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-server/Makefile
  branches/2017Q1/databases/mariadb100-server/distinfo
  branches/2017Q1/databases/mariadb100-server/files/patch-extra_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-server/files/patch-mysys_my__default.c
  branches/2017Q1/databases/mariadb100-server/files/patch-scripts_mysqld__safe.sh
  branches/2017Q1/databases/mariadb100-server/files/patch-storage_tokudb_PerconaFT_ft_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-server/files/patch-support-files_CMakeLists.txt
  branches/2017Q1/databases/mariadb100-server/pkg-plist
Comment 12 Michael McConville 2018-01-12 06:24:39 UTC
I and another user found that this is still a problem for mariadb102-server (and, IIRC, mariadb101-server as well).

It fails with the following:

    ===>   Registering installation for mariadb102-server-10.2.11_1
    pkg-static: Unable to access file /usr/ports/databases/mariadb102-server/work/stage/usr/local/bin/tokuft_logprint:No such file or directory
    pkg-static: Unable to access file /usr/ports/databases/mariadb102-server/work/stage/usr/local/bin/tokuftdump:No such file or directory
    pkg-static: Unable to access file /usr/ports/databases/mariadb102-server/work/stage/usr/local/lib/mysql/plugin/ha_tokudb.so:No such file or directory
    pkg-static: Unable to access file /usr/ports/databases/mariadb102-server/work/stage/usr/local/share/doc/mysql/README.md:No such file or directory
    *** Error code 74
     
    Stop.
    make[2]: stopped in /usr/ports/databases/mariadb102-server
    *** Error code 1
     
    Stop.
    make[1]: stopped in /usr/ports/databases/mariadb102-server
    *** Error code 1
     
    Stop.

Which suggests to me that it's suffering from the same problem that the above patch fixed. However, the above patch doesn't apply cleanly to the ports tree. Is anyone more familiar with these ports and projects willing to check it out?

Thanks for your time,
Mike