Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6016

Packaging error with cmake 2.8.12 and greater.

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.36, 10.0.10
    • 5.5.37, 10.0.11
    • None
    • Windows 7 x64, cmake 2.8.12.2

    Description

      When building --target package the build process completes but then errors out while trying to package the zip file. The error is due to missing .pdb files.
      This is not really a bug with mariadb as it's part of cmake but will stop mariadb from building. From my understanding this is due to cmake as of 2.8.12 will not build .pdb files for static libraries (see http://public.kitware.com/Bug/view.php?id=14600 )

      I've attached the output of the errors in the building of the zip file. Also attached is a .diff file that alters the cmake/install_macros.cmake file

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova added a comment - - edited

            The attached workaround was suggested by Wlad. He also had additional thoughts on the subject, I hope he will comment with those.

            Meanwhile, here is a free translation of his notes:

            In future users won't be able to debug static libraries (client adn embedded), and apparently cmake isn't going to fix it.

            If somebody complains, we can modify compile flags from /Zi to /Z7 (see http://bazaar.launchpad.net/~maria-captains/maria/10.0/view/head:/cmake/os/Windows.cmake ). With /Z7, debuginfo will be inside the static library, in .obj files ( http://msdn.microsoft.com/en-us/library/958x11bc.aspx ), and pdb won't be needed.

            elenst Elena Stepanova added a comment - - edited The attached workaround was suggested by Wlad. He also had additional thoughts on the subject, I hope he will comment with those. Meanwhile, here is a free translation of his notes: In future users won't be able to debug static libraries (client adn embedded), and apparently cmake isn't going to fix it. If somebody complains, we can modify compile flags from /Zi to /Z7 (see http://bazaar.launchpad.net/~maria-captains/maria/10.0/view/head:/cmake/os/Windows.cmake ). With /Z7, debuginfo will be inside the static library, in .obj files ( http://msdn.microsoft.com/en-us/library/958x11bc.aspx ), and pdb won't be needed.
            elenst Elena Stepanova added a comment - - edited

            I checked the provided patch on 5.5 tree with VS 11 / cmake 2.8.12.1, and also tried it in a test tree in buildbot to check there are no problems with older VS/cmake. Now pushed into 5.5 tree which will be merged up later.

            elenst Elena Stepanova added a comment - - edited I checked the provided patch on 5.5 tree with VS 11 / cmake 2.8.12.1, and also tried it in a test tree in buildbot to check there are no problems with older VS/cmake. Now pushed into 5.5 tree which will be merged up later.
            wlad Vladislav Vaintroub added a comment - - edited

            I tested the mentioned change for debuginfo format from /Zi to /Z7, and it seems to work well. The noticable change is that static libraries will be bigger in size (this of course applies to the libraries themselves, not to programs they link to). So I conclude, if the size of embedded library = 300M does not bother too many people, /Z7 should be quite ok. The whole patch is below.

            === modified file 'cmake/os/Windows.cmake'
            --- cmake/os/Windows.cmake	2011-06-30 15:46:53 +0000
            +++ cmake/os/Windows.cmake	2014-04-04 06:02:17 +0000
            @@ -71,13 +71,15 @@
                SET(CMAKE_{type}_LINKER_FLAGS_RELEASE "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /debug")
               ENDFOREACH()
               
            -  # Force static runtime libraries
            +  # Force static runtime libraries. 
            +  # Force /Z7 instead of default /Zi to have debug symbols in static libraries.
               FOREACH(flag 
                CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO 
                CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT 
                CMAKE_CXX_FLAGS_RELEASE  CMAKE_CXX_FLAGS_RELWITHDEBINFO
                CMAKE_CXX_FLAGS_DEBUG  CMAKE_CXX_FLAGS_DEBUG_INIT)
                STRING(REPLACE "/MD"  "/MT" "${flag}" "${${flag}}")
            +   STRING(REPLACE "/Zi"  "/Z7" "${flag}" "${${flag}}")
               ENDFOREACH()
               
               # Remove support for exceptions

            wlad Vladislav Vaintroub added a comment - - edited I tested the mentioned change for debuginfo format from /Zi to /Z7, and it seems to work well. The noticable change is that static libraries will be bigger in size (this of course applies to the libraries themselves, not to programs they link to). So I conclude, if the size of embedded library = 300M does not bother too many people, /Z7 should be quite ok. The whole patch is below. === modified file 'cmake/os/Windows.cmake' --- cmake/os/Windows.cmake 2011-06-30 15:46:53 +0000 +++ cmake/os/Windows.cmake 2014-04-04 06:02:17 +0000 @@ -71,13 +71,15 @@ SET(CMAKE_{type}_LINKER_FLAGS_RELEASE "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /debug") ENDFOREACH() - # Force static runtime libraries + # Force static runtime libraries. + # Force /Z7 instead of default /Zi to have debug symbols in static libraries. FOREACH(flag CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT) STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}") + STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}") ENDFOREACH() # Remove support for exceptions

            This change is an addition to the previous one, not a replacement, right?

            Some numbers (revno 4131 is the previous patch):

            VS 10 / cmake 2.8.5, revno 4130 before Zi=>Z7
            141848427 mariadb-5.5.37-winx64.zip
             
            VS 10 / cmake 2.8.5, revno 4130 after Zi=>Z7
            186223829 mariadb-5.5.37-winx64.zip
             
            VS 10 / cmake 2.8.5, revno 4131 before Zi=>Z7
            141813729 mariadb-5.5.37-winx64.zip
             
            VS 10 / cmake 2.8.5, revno 4131 after Zi=>Z7
            186232673 mariadb-5.5.37-winx64.zip
             
             
            VS 11 / cmake 2.8.12 revno 4130 after Zi=>Z7
            does not work
             
            VS 11 / cmake 2.8.12 revno 4131 before Zi=>Z7
            147336732 mariadb-5.5.37-winx64.zip
             
            VS 11 / cmake 2.8.12 revno 4131 after Zi=>Z7
            213447432 mariadb-5.5.37-winx64.zip

            elenst Elena Stepanova added a comment - This change is an addition to the previous one, not a replacement, right? Some numbers (revno 4131 is the previous patch): VS 10 / cmake 2.8.5, revno 4130 before Zi=>Z7 141848427 mariadb-5.5.37-winx64.zip   VS 10 / cmake 2.8.5, revno 4130 after Zi=>Z7 186223829 mariadb-5.5.37-winx64.zip   VS 10 / cmake 2.8.5, revno 4131 before Zi=>Z7 141813729 mariadb-5.5.37-winx64.zip   VS 10 / cmake 2.8.5, revno 4131 after Zi=>Z7 186232673 mariadb-5.5.37-winx64.zip     VS 11 / cmake 2.8.12 revno 4130 after Zi=>Z7 does not work   VS 11 / cmake 2.8.12 revno 4131 before Zi=>Z7 147336732 mariadb-5.5.37-winx64.zip   VS 11 / cmake 2.8.12 revno 4131 after Zi=>Z7 213447432 mariadb-5.5.37-winx64.zip

            Right, this is addition not a replacement. Bet the difference is due to mysqlserver.lib only, and is not noticable in MSIs.

            wlad Vladislav Vaintroub added a comment - Right, this is addition not a replacement. Bet the difference is due to mysqlserver.lib only, and is not noticable in MSIs.

            Some more sizes (mysqlserver.lib and the whole unpacked directory)

            VS 10 / cmake 2.8.5, 4131 before Zi=>Z7
              141813729  mariadb-5.5.37-winx64.zip
              72740006   mysqlserver.lib
              644775646  mariadb-5.5.37-winx64
             
            VS 10 / cmake 2.8.5, 4131 after Zi=>Z7
              186232673  mariadb-5.5.37-winx64.zip
              223535446  mysqlserver.lib
              800908270  mariadb-5.5.37-winx64
             
            VS 11 / cmake 2.8.12 4131 before Zi=>Z7
              147336732  mariadb-5.5.37-winx64.zip
              74633374   mysqlserver.lib
              647495889  mariadb-5.5.37-winx64
             
            VS 11 / cmake 2.8.12 4131 after Zi=>Z7
              213447432  mariadb-5.5.37-winx64.zip
              602570110  mysqlserver.lib
              1182596977 mariadb-5.5.37-winx64

            elenst Elena Stepanova added a comment - Some more sizes (mysqlserver.lib and the whole unpacked directory) VS 10 / cmake 2.8.5, 4131 before Zi=>Z7 141813729 mariadb-5.5.37-winx64.zip 72740006 mysqlserver.lib 644775646 mariadb-5.5.37-winx64   VS 10 / cmake 2.8.5, 4131 after Zi=>Z7 186232673 mariadb-5.5.37-winx64.zip 223535446 mysqlserver.lib 800908270 mariadb-5.5.37-winx64   VS 11 / cmake 2.8.12 4131 before Zi=>Z7 147336732 mariadb-5.5.37-winx64.zip 74633374 mysqlserver.lib 647495889 mariadb-5.5.37-winx64   VS 11 / cmake 2.8.12 4131 after Zi=>Z7 213447432 mariadb-5.5.37-winx64.zip 602570110 mysqlserver.lib 1182596977 mariadb-5.5.37-winx64

            I created a separate issue MDEV-6053 regarding including the debug info. I think we can afford waiting a bit to see if anybody actually needs it.

            elenst Elena Stepanova added a comment - I created a separate issue MDEV-6053 regarding including the debug info. I think we can afford waiting a bit to see if anybody actually needs it.

            People

              Unassigned Unassigned
              Eyecu Wes Bullard
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.