tokudb differences when merging with MariaDB

Bug #1510092 reported by Sergei Golubchik on 2015-10-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Tomislav Plavcic
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
Medium
Tomislav Plavcic

Bug Description

I'll just put everything in one bug report :)

1. storage/tokudb/PerconaFT/cmake_modules/FindValgrind.cmake

I've changed

- find_package_handle_standard_args(VALGRIND DEFAULT_MSG
+ find_package_handle_standard_args(Valgrind DEFAULT_MSG

with the comment "correct the package name in FindValgrind.cmake (for find_package(... REQUIRED) to work)"

2. storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake

I've commented out

- LIST(REMOVE_DUPLICATES OSLIBS)
+ #LIST(REMOVE_DUPLICATES OSLIBS)

with the comment

  Libraries must be specified in the specific order,
  REMOVE_DUPLICATES cannot be used, because it destroys this order.
  (when OSLIBS contains "-lpthread -ljemalloc -lpthread", REMOVE_DUPLICATES
  makes it "-lpthread -ljemalloc". But a thread library *must* be *after* jemalloc)

3. storage/tokudb/PerconaFT/cmake_modules/TokuSetupCTest.cmake

    execute_process(
      COMMAND which ${filename}
      RESULT_VARIABLE res
+ ERROR_QUIET
      OUTPUT_VARIABLE full_filename
      OUTPUT_STRIP_TRAILING_WHITESPACE)

with the comment "'which' might print errors to stderr, they are not important, shut them up"

  execute_process(
    COMMAND hostname
    OUTPUT_VARIABLE fullhostname
    OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} ${fullhostname})
+ string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} "${fullhostname}")

"MDEV-5124 cmake failure when fullhostname is not resolved

expand fullhostname inside the string, to have an empty string, not nothing,
when fullhostname is not defined"

- configure_file(CTestCustom.cmake . @ONLY)
+ configure_file(CTestCustom.cmake.in CTestCustom.cmake @ONLY)

"don't configure_file into itself (with input=output)"
also CTestCustom.cmake must be renamed to CTestCustom.cmake.in

4. storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake

- if (NOT DEFINED LIBJEMALLOC)
+ if (CMAKE_PROJECT_NAME STREQUAL TokuDB)

this code (forcing libjemalloc) should only be used when PerconaFT is compiled as an independent project. When it's inside the Percona Server, the top-level CMakeLists.txt makes these server-wide decisions, not individual engine.

- list(APPEND xz_configure_opts CC=${CMAKE_C_COMPILER})
+ list(APPEND xz_configure_opts "CC=${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")

"Fixed tokudb with ccache build failure."

ExternalProject_Add(build_lzma
    PREFIX xz
    DOWNLOAD_COMMAND
        cp -a "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
    CONFIGURE_COMMAND
        "<SOURCE_DIR>/configure" ${xz_configure_opts}
        "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
+ "--libdir=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz/lib"
    BUILD_COMMAND
        ${SUBMAKE_COMMAND} -C src/liblzma
    INSTALL_COMMAND
        ${SUBMAKE_COMMAND} -C src/liblzma install
)

That was needed on SuSE where libtool put the library in <...>/xz/lib64 and the code below (in the same cmake file) was not able to find it.

5. storage/tokudb/PerconaFT/ft/tests/CMakeLists.txt

another one of

- add_executable(${test} ${test})
+ add_executable(${test} ${test}.cc)

6. storage/tokudb/PerconaFT/locktree/tests/CMakeLists.txt

- add_executable(${base} ${base})
+ add_executable(${base} ${base}.cc)

7. storage/tokudb/PerconaFT/portability/tests/CMakeLists.txt

- add_executable(${test} ${test})
+ add_executable(${test} ${test}.cc)

8. storage/tokudb/PerconaFT/src/CMakeLists.txt

- target_link_libraries(${LIBTOKUDB} LINK_PUBLIC z)
+ target_link_libraries(${LIBTOKUDB} LINK_PUBLIC ${ZLIB_LIBRARY} )

tokudb should respect server-global zlib settings and link with bundled zlib, if user has selected that configuration

9. storage/tokudb/PerconaFT/src/tests/CMakeLists.txt

- add_executable(test-5138.tdb test-5138)
+ add_executable(test-5138.tdb test-5138.cc)

and

- add_executable(${base}.tdb ${base})
+ add_executable(${base}.tdb ${base}.cc)

10. storage/tokudb/PerconaFT/tools/CMakeLists.txt

- add_executable(${tool} ${tool})
+ add_executable(${tool} ${tool}.cc)

and

- install(TARGETS tokuftdump DESTINATION bin COMPONENT tokukv_tools)
- install(TARGETS tokuft_logprint DESTINATION bin COMPONENT tokukv_tools)
+ install(TARGETS tokuftdump DESTINATION ${INSTALL_BINDIR} COMPONENT Server)
+ install(TARGETS tokuft_logprint DESTINATION ${INSTALL_BINDIR} COMPONENT Server)

The DESTINATION should follow server-wide settings from install_layout.cmake. But you might not care about the correct COMPONENT here, if you don't use components at all in your cmake files.

11. storage/tokudb/PerconaFT/util/tests/CMakeLists.txt

- add_executable(${test} ${test})
+ add_executable(${test} ${test}.cc)

12. storage/tokudb/PerconaFT/CMakeLists.txt

  cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)

this command automatically does cmake_policy(VERSION 2.8.8) which removes all cmake_policy() settings that were done in the root CMakeLists.txt. In particular cmake starts issuing warnings about policies CMP0022 and CMP0045.

As a fix this line can be either removed or wrapped in "if (CMAKE_PROJECT_NAME STREQUAL TokuDB)"

===
that's all

tags: added: tokudb
description: updated
description: updated
description: updated
description: updated
description: updated
Tomislav Plavcic (tplavcic) wrote :

Thank you Sergei for contribution!
We'll check your proposed changes (this and in other open tickets) and merge them if ok.

Tomislav Plavcic (tplavcic) wrote :

PR: https://github.com/percona/PerconaFT/pull/340
For these three things I have opened Jira ticket BLD-361 since there are other project that depend on this.
#4 (first thing only), #8, #10 (second thing only)
So they will probably not be changed soon.

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1663

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers