Bug 207675 - databases/mariadb101-server - unbreak OQGRAPH option
Summary: databases/mariadb101-server - unbreak OQGRAPH option
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: needs-qa, patch
Depends on:
Blocks: 199601
  Show dependency treegraph
 
Reported: 2016-03-03 11:43 UTC by Don Lewis
Modified: 2016-03-27 22:49 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (brnrd)


Attachments
patch to fix OQGRAPH build failures (6.06 KB, patch)
2016-03-03 11:43 UTC, Don Lewis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer 2016-03-03 11:43:04 UTC
Created attachment 167680 [details]
patch to fix OQGRAPH build failures

mariadb101-server does not build if the OQGRAPH option is enabled for a couple of reasons.  One is the https://mariadb.atlassian.net/browse/MDEV-8051 when building with clang.  Switching to gcc to build is undesirable because linking an application built with g++ (which links to libstdc++) with any other C++ code compiled with clang (which links to libc++) causes the application to immediately crash on startup.  The issue appears to be problems in the namespace usage of the code that interfaces mariadb with the boost graph library.  The attached patches to storage/oqgraph/oqgraph_shim.h and storage/oqgraph/graphcore.cc to fix this problem.  The oqgraph_shim.h also conditionally used some boost typedefs that were introduced in boost 1.46.1, but removed in boost 1.49.  This also broke the build with clang.  This patch disables the use of these typedefs when using boost 1.49 or newer.

The other build problem is caused by trying to link to the static libJudy.a library instead of the dynamic libJudy.so library.  This appears to have caused a linker failure when mariadb was building a shared library because the object files in libJudy.a were not compiled with the -fPIC option.  The cause of this problem is in the FreeBSD port changes to cmake/ssl.cmake.  The upstream default is to statically link the SSL libraries.  This was done by reversing the library suffix list in ssl.cmake before doing the the library search, and then reversing the suffix list again to restore the original order.  The FreeBSD port patched this file to disable the first reversal so that the dynamic libraries would be found first, but neglected to disable the second reversal, which then left the suffix list in the wrong order, causing libJudy.a to be found first.  Disabling the second reversal fixes this problem.

The final change in the attached patch removes the gcc stuff from the port Makefile and gets rid of a portlint "fatal" error.

With these changes, the OQGRAPH now also builds correctly with boost 1.55 and boost 1.60.

My build testing did find a build problem with the default GSSAPI_BASE option on FreeBSD 9.3, which I did not try to fix.  I was able to successfully build with GSSAPI_HEIMDAL on FreeBSD 9.3.  I am using the base openssl.
Comment 1 Don Lewis freebsd_committer 2016-03-14 23:33:40 UTC
I've also sent the boost-related part of this patch upstream.
Comment 2 Bernard Spil freebsd_committer 2016-03-26 15:25:25 UTC
Building with 10.1.13 I run into the following error

> /usr/ports/databases/mariadb101-server/work/mariadb-10.1.13/storage/oqgraph/graphcore.cc:488:12: error: no member named 'find_vertex' in namespace 'boost'; did you mean simply 'find_vertex'?
>     return ::boost::find_vertex(id, g);
>            ^~~~~~~~~~~~~~~~~~~~
>            find_vertex
> /usr/ports/databases/mariadb101-server/work/mariadb-10.1.13/storage/oqgraph/graphcore.cc:486:18: note: 'find_vertex' declared here
>   oqgraph_share::find_vertex(VertexID id) const
>                  ^
> /usr/ports/databases/mariadb101-server/work/mariadb-10.1.13/storage/oqgraph/graphcore.cc:488:12: error: too many arguments to function call, expected 1, have 2; did you mean 'oqgraph3::find_vertex'?
>     return ::boost::find_vertex(id, g);
>            ^~~~~~~~~~~~~~~~~~~~
>            oqgraph3::find_vertex
> /usr/ports/databases/mariadb101-server/work/mariadb-10.1.13/storage/oqgraph/oqgraph_shim.h:480:3: note: 'oqgraph3::find_vertex' declared here
>   find_vertex(oqgraph3::vertex_id id, const oqgraph3::graph& g)
>   ^
> [ 91%] Building CXX object storage/oqgraph/CMakeFiles/oqgraph.dir/oqgraph_shim.cc.o
> 2 warnings and 2 errors generated.
> --- storage/oqgraph/CMakeFiles/oqgraph.dir/graphcore.cc.o ---
> *** [storage/oqgraph/CMakeFiles/oqgraph.dir/graphcore.cc.o] Error code 1
> 
> make[4]: stopped in /usr/ports/databases/mariadb101-server/work/mariadb-10.1.13
> 2 warnings generated.
> 2 warnings generated.
> A failure has been detected in another branch of the parallel make
> 
> make[4]: stopped in /usr/ports/databases/mariadb101-server/work/mariadb-10.1.13

Any clues?
Comment 3 Bernard Spil freebsd_committer 2016-03-26 15:31:38 UTC
Sorry Don, partial patch applied.
Comment 4 Bernard Spil freebsd_committer 2016-03-26 21:04:23 UTC
This has been added in D5751 Update to 10.1.13
Comment 5 commit-hook freebsd_committer 2016-03-27 20:58:00 UTC
A commit references this bug:

Author: brnrd
Date: Sun Mar 27 20:57:54 UTC 2016
New revision: 412011
URL: https://svnweb.freebsd.org/changeset/ports/412011

Log:
  databases/mariadb101-{server,client}: Update to 10.1.13

    - Update to version 10.1.13
    - Make GSSAPI plugin optional [2]
    - Remove patches that are merged upstream
    - Re-generate patches that required fuzzing
    - Server
      - Fix OQGraph build failure [1]
      - Install server gssapi plugin only
      - Don't install gssapi libs/files that were moved to -client
      - Add license and readme file for TokuDB
      - Add tokuft_logprint and tokuftdump binaries
    - Client
      - Install client gssapi plugin
      - Enable PLIST_SUB for optional gssapi plugin
      - Add new plugins and ini file
      - Remove taocrypt patch, we don't build bundled SSL

  PR:		207675 [1], 207883 [2]
  Reviewed by:	feld (mentor)
  Approved by:	feld (mentor)
  Differential Revision:	D5751

Changes:
  head/databases/mariadb101-client/Makefile
  head/databases/mariadb101-client/files/patch-CMakeLists.txt
  head/databases/mariadb101-client/files/patch-cmake_jemalloc.cmake
  head/databases/mariadb101-client/files/patch-cmake_ssl.cmake
  head/databases/mariadb101-client/files/patch-extra_yassl_taocrypt_src_integer.cpp
  head/databases/mariadb101-client/files/patch-include_my__compare.h
  head/databases/mariadb101-client/files/patch-include_my_compare.h
  head/databases/mariadb101-client/files/patch-include_mysql_service__encryption.h
  head/databases/mariadb101-client/files/patch-mysys_my__default.c
  head/databases/mariadb101-client/files/patch-mysys_my_default.c
  head/databases/mariadb101-client/files/patch-scripts_CMakeLists.txt
  head/databases/mariadb101-client/files/patch-scripts_mysql__config.sh
  head/databases/mariadb101-client/files/patch-scripts_mysql_config.sh
  head/databases/mariadb101-client/pkg-plist
  head/databases/mariadb101-server/Makefile
  head/databases/mariadb101-server/distinfo
  head/databases/mariadb101-server/files/patch-CMakeLists.txt
  head/databases/mariadb101-server/files/patch-cmake_jemalloc.cmake
  head/databases/mariadb101-server/files/patch-cmake_ssl.cmake
  head/databases/mariadb101-server/files/patch-extra_CMakeLists.txt
  head/databases/mariadb101-server/files/patch-include_mysql_service__encryption.h
  head/databases/mariadb101-server/files/patch-mysys_my__default.c
  head/databases/mariadb101-server/files/patch-pcre_CMakeLists.txt
  head/databases/mariadb101-server/files/patch-plugin_auth__gssapi_gssapi__server.cc
  head/databases/mariadb101-server/files/patch-sql_sys__vars.cc
  head/databases/mariadb101-server/files/patch-storage_oqgraph_graphcore.cc
  head/databases/mariadb101-server/files/patch-storage_oqgraph_oqgraph__shim.h
  head/databases/mariadb101-server/files/patch-storage_tokudb_CMakeLists.txt
  head/databases/mariadb101-server/files/patch-storage_tokudb_PerconaFT_CMakeLists.txt
  head/databases/mariadb101-server/files/patch-storage_tokudb_PerconaFT_buildheader_CMakeLists.txt
  head/databases/mariadb101-server/files/patch-storage_tokudb_PerconaFT_cmake__modules_TokuFeatureDetection.cmake
  head/databases/mariadb101-server/files/patch-support-files_CMakeLists.txt
  head/databases/mariadb101-server/pkg-plist