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

Improve runtime dependency packaging on Windows

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 11.4.7
    • 11.4.8, 11.8.4, 12.1.2
    • Packaging, Platform Windows
    • None
    • Not for Release Notes

    Description

      Problem

      When installing the Mroonga plugin into a MariaDB 11.4.7 build on Windows without vcpkg, the CMake install step raises the following error.

      -- Installing: …\install\lib\plugin\ha_mroonga.dll
      -- Installing: …\install\symbols\ha_mroonga.pdb
      CMake Error at storage/mroonga/cmake_install.cmake:58 (file):
        file Could not resolve runtime dependencies:
       
          groonga-llama.dll
          libmecab.dll
      

      Cause

      This happens because in `CMakeLists.txt` the default for `INSTALL_RUNTIME_DEPENDENCIES` is inverted. Because vcpkg is not detected, `INSTALL_RUNTIME_DEPENDENCIES` is turned on, and the dependency scan only searches the (non-existent) vcpkg bin/ paths for runtime dependencies, so the bundled-built Groonga DLLs are never found.

       IF(NOT DEFINED INSTALL_RUNTIME_DEPENDENCIES_DEFAULT)
      -  IF("${VCPKG_INSTALLED_DIR}")
      -    SET(INSTALL_RUNTIME_DEPENDENCIES_DEFAULT OFF)
      -  ELSE()
      -    SET(INSTALL_RUNTIME_DEPENDENCIES_DEFAULT ON)
      +  IF("${VCPKG_INSTALLED_DIR}")
      +    SET(INSTALL_RUNTIME_DEPENDENCIES_DEFAULT ON)
      +  ELSE()
      +    SET(INSTALL_RUNTIME_DEPENDENCIES_DEFAULT OFF)
        ENDIF()
       ENDIF()
       OPTION(INSTALL_RUNTIME_DEPENDENCIES "Install runtime dependencies" "${INSTALL_RUNTIME_DEPENDENCIES_DEFAULT}")
      

      How to reproduce

      On Windows without setting VCPKG_INSTALLED_DIR, configure MariaDB 11.4.7 with the Mroonga plugin.

      Could you see it in detail.
      https://github.com/mroonga/mroonga/blob/main/.github/workflows/windows.yml#L87-L234

      Expected behavior

      • With vcpkg: enable runtime-dependency scanning (ON) and point at the vcpkg bin/ directories.
      • Without vcpkg: disable runtime-dependency scanning (OFF) so local Groonga DLLs install correctly without requiring vcpkg paths.

      Thank you for all your hard work on MariaDB. If this understanding is correct, I’ll be happy to submit a pull request with the proposed fix.

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            otegami Takuya Kodama
            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.