Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-330

MSI not created when connectors is built from source - Windows

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 3.1.13
    • 3.1.14
    • General
    • None
    • Windows 10

    Description

      When following documentation https://mariadb.com/kb/en/building-mariadb-connectorodbc-from-source/
      steps are ( I added for out of source, the same is happening for in source):

      > mkdir bld
      > cd bld
      > cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off .  
      > cmake --build . --config RelWithDebInfo  
      

      We are ending with no ".msi" files created.
      Note that when you run --build second time you can see the error too:

        The system cannot find the path specified.
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(230
      ,5): error MSB6006: "cmd.exe" exited with code 3. [D:\mariadb-connector-odbc\wininstall\ODBC_WIX.vcxproj]
        odbc_basic.vcxproj -> D:\mariadb-connector-odbc\test\RelWithDebInfo\odbc_basic.exe
      

      Also when you add CONC_WITH_MSI=ON the same happens.

      When you run with cmake --build . --target MSI the error si:

      D:\mariadb-connector-odbc\bld>cmake --build . --target MSI
      Microsoft (R) Build Engine version 16.3.2+e481bbf88 for .NET Framework
      Copyright (C) Microsoft Corporation. All rights reserved.
      MSBUILD : error MSB1009: Project file does not exist.
      Switch: MSI.vcxproj
      

      Note you can create the logs to inspect with following command (note example is used for ".msi.vcxproj"project file , since there is no msi created() which doesn't make sense, but just as demo example how to create the logs) :

      > msiexec.exe /i "D:\mariadb-connector-odbc\bld\wininstall\mariadb-connector-odbc-3.1.14-win64.msi.vcxproj" /L*V "D:\package.log" 
      

      Attachments

        Activity

          anel Anel Husakovic added a comment - - edited

          Can you please try yourself and let me know exact steps and where are msi located?
          I can only show you what is installed in wininstall and don't know what else to trace

          D:\mariadb-connector-odbc\bld>dir wininstall
           Volume in drive D is HDD 1
           Volume Serial Number is 0AC3-FE71
           
           Directory of D:\mariadb-connector-odbc\bld\wininstall
           
          02.08.2021.  14:49    <DIR>          .
          02.08.2021.  14:49    <DIR>          ..
          02.08.2021.  12:42    <DIR>          change_dsns_driver.dir
          02.08.2021.  14:49            23.937 change_dsns_driver.vcxproj
          02.08.2021.  12:41               962 change_dsns_driver.vcxproj.filters
          02.08.2021.  14:49    <DIR>          CMakeFiles
          02.08.2021.  12:41             1.063 cmake_install.cmake
          02.08.2021.  12:41            11.773 INSTALL.vcxproj
          02.08.2021.  12:41               520 INSTALL.vcxproj.filters
          02.08.2021.  14:42            15.523 mariadb-connector-odbc-3.1.14-win64.msi.vcxproj
          02.08.2021.  12:41               776 mariadb-connector-odbc-3.1.14-win64.msi.vcxproj.filters
          02.08.2021.  12:41             7.810 mariadb_odbc.xml
          02.08.2021.  14:42            18.059 ODBC_WIX.vcxproj
          02.08.2021.  12:41               714 ODBC_WIX.vcxproj.filters
          02.08.2021.  12:41            12.189 PACKAGE.vcxproj
          02.08.2021.  12:41               520 PACKAGE.vcxproj.filters
          02.08.2021.  12:42    <DIR>          RelWithDebInfo
          02.08.2021.  12:42    <DIR>          x64
                        12 File(s)         93.846 bytes
                         6 Dir(s)  1.936.068.321.280 bytes free
          

          anel Anel Husakovic added a comment - - edited Can you please try yourself and let me know exact steps and where are msi located? I can only show you what is installed in wininstall and don't know what else to trace D:\mariadb-connector-odbc\bld>dir wininstall Volume in drive D is HDD 1 Volume Serial Number is 0AC3-FE71   Directory of D:\mariadb-connector-odbc\bld\wininstall   02.08.2021. 14:49 <DIR> . 02.08.2021. 14:49 <DIR> .. 02.08.2021. 12:42 <DIR> change_dsns_driver.dir 02.08.2021. 14:49 23.937 change_dsns_driver.vcxproj 02.08.2021. 12:41 962 change_dsns_driver.vcxproj.filters 02.08.2021. 14:49 <DIR> CMakeFiles 02.08.2021. 12:41 1.063 cmake_install.cmake 02.08.2021. 12:41 11.773 INSTALL.vcxproj 02.08.2021. 12:41 520 INSTALL.vcxproj.filters 02.08.2021. 14:42 15.523 mariadb-connector-odbc-3.1.14-win64.msi.vcxproj 02.08.2021. 12:41 776 mariadb-connector-odbc-3.1.14-win64.msi.vcxproj.filters 02.08.2021. 12:41 7.810 mariadb_odbc.xml 02.08.2021. 14:42 18.059 ODBC_WIX.vcxproj 02.08.2021. 12:41 714 ODBC_WIX.vcxproj.filters 02.08.2021. 12:41 12.189 PACKAGE.vcxproj 02.08.2021. 12:41 520 PACKAGE.vcxproj.filters 02.08.2021. 12:42 <DIR> RelWithDebInfo 02.08.2021. 12:42 <DIR> x64 12 File(s) 93.846 bytes 6 Dir(s) 1.936.068.321.280 bytes free
          Lawrin Lawrin Novitsky added a comment - - edited

          anel, add slash to the end of WIX_DIR after bin. Apparently that is expected - can be seen in the error message. Even though it's probably wrong. I'll fix that, amend the commit, and then clsose the ticket.

          Lawrin Lawrin Novitsky added a comment - - edited anel , add slash to the end of WIX_DIR after bin. Apparently that is expected - can be seen in the error message. Even though it's probably wrong. I'll fix that, amend the commit, and then clsose the ticket.

          Btw, didn't Wix installer added WIX to environment? I kinda guess, that installer does it. Not sure though

          Lawrin Lawrin Novitsky added a comment - Btw, didn't Wix installer added WIX to environment? I kinda guess, that installer does it. Not sure though

          No it doesn't work for out of source builds:

          D:\mariadb-connector-odbc\bld>cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DWIX_DIR="C:\Program Files (x86)\WiX Toolset v3.11\bin\" ..
          CMake Warning:
            No source or binary directory provided.  Both will be assumed to be the
            same as the current working directory, but note that this warning will
            become a fatal error in future CMake releases.
           
           
          CMake Error: The source directory "D:/mariadb-connector-odbc/bld" does not appear to contain CMakeLists.txt.
          Specify --help for usage, or press the help button on the CMake GUI.
          

          Yes, WIX is adding system env variable (haven't noted that).

          D:\mariadb-connector-odbc\bld>echo %WIX%
          C:\Program Files (x86)\WiX Toolset v3.11\
          

          However escaping the slash at the end works:

          D:\mariadb-connector-odbc\bld>cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DWIX_DIR="C:\Program Files (x86)\WiX Toolset v3.11\bin\/" ..
          

          And I finally got msi package:

           Directory of D:\mariadb-connector-odbc\bld\wininstall
           
          02.08.2021.  18:26        14.094.336 mariadb-connector-odbc-3.1.14-win64.msi
          

          Lawrin thanks for looking, it can be closed now and also I would recommend not to silently remove the error of wix.

          anel Anel Husakovic added a comment - No it doesn't work for out of source builds: D:\mariadb-connector-odbc\bld>cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DWIX_DIR="C:\Program Files (x86)\WiX Toolset v3.11\bin\" .. CMake Warning: No source or binary directory provided. Both will be assumed to be the same as the current working directory, but note that this warning will become a fatal error in future CMake releases.     CMake Error: The source directory "D:/mariadb-connector-odbc/bld" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. Yes, WIX is adding system env variable (haven't noted that). D:\mariadb-connector-odbc\bld>echo %WIX% C:\Program Files (x86)\WiX Toolset v3.11\ However escaping the slash at the end works: D:\mariadb-connector-odbc\bld>cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONC_WITH_UNIT_TESTS=Off -DWIX_DIR="C:\Program Files (x86)\WiX Toolset v3.11\bin\/" .. And I finally got msi package: Directory of D:\mariadb-connector-odbc\bld\wininstall   02.08.2021. 18:26 14.094.336 mariadb-connector-odbc-3.1.14-win64.msi Lawrin thanks for looking, it can be closed now and also I would recommend not to silently remove the error of wix .

          Basically, -DWIX_DIR=... is not required, if WIX env variable is set

          Changed, that if WIX_DIR is specified, and wix is not found there, then cmake exits with error, otherwise, if wix binaries are not found, msi targets are not created.
          Fixed, that it would fail, if WIX_DIR didn't have slash or backslash at the end.

          Lawrin Lawrin Novitsky added a comment - Basically, -DWIX_DIR=... is not required, if WIX env variable is set Changed, that if WIX_DIR is specified, and wix is not found there, then cmake exits with error, otherwise, if wix binaries are not found, msi targets are not created. Fixed, that it would fail, if WIX_DIR didn't have slash or backslash at the end.

          People

            Lawrin Lawrin Novitsky
            anel Anel Husakovic
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.