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

cmake trace-expand fails on variable expansion of libfmt for cmake <3.24

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 10.4
    • N/A
    • Configuration
    • None

    Description

      When running cmake --trace-expand, with cmake version 3.16, noted error

      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2543):  set(tag MD5=e77873199e897ca9f780479ad68e25b1 )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2544):  configure_file(/usr/share/cmake-3.16/Modules/RepositoryInfo.txt.in /home/anel/GitHub/mariadb/server/build/connect-java/extra/libfmt/src/libfmt-stamp/libfmt-urlinfo.txt @ONLY )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2549):  list(APPEND depends /home/anel/GitHub/mariadb/server/build/connect-java/extra/libfmt/src/libfmt-stamp/libfmt-urlinfo.txt )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2551):  list(LENGTH url url_list_length )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2552):  if(NOT 1 STREQUAL 1 )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2563):  if(IS_DIRECTORY https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2568):  else()
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2569):  get_property(no_extract TARGET libfmt PROPERTY _EP_DOWNLOAD_NO_EXTRACT SET )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2570):  if(https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip MATCHES ^[a-z]+:// )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2572):  if(x STREQUAL x )
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2573):  set(fname https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip )
      CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:2575 (if):
        Syntax error in cmake code when parsing string
       
          ([^/\?#]+(\.|=)(7z|tar|tar\.bz2|tar\.gz|tar\.xz|tbz2|tgz|txz|zip))([/?#].*)?$
       
        Invalid escape sequence \?
      Call Stack (most recent call first):
        /usr/share/cmake-3.16/Modules/ExternalProject.cmake:3236 (_ep_add_download_command)
        cmake/libfmt.cmake:15 (ExternalProject_Add)
        cmake/libfmt.cmake:47 (BUNDLE_LIBFMT)
        CMakeLists.txt:396 (CHECK_LIBFMT)
       
       
      /usr/share/cmake-3.16/Modules/ExternalProject.cmake(2575):  if(https://github.com/fmtlib/fmt/releases/download/8.0.1/fmt-8.0.1.zip MATCHES ([^/\?#]+(\.|=)(7z|tar|tar\.bz2|tar\.gz|tar\.xz|tbz2|tgz|txz|zip))([/?#].*)?$ )
      -- Configuring incomplete, errors occurred!
      See also "/home/anel/GitHub/mariadb/server/build/connect-java/CMakeFiles/CMakeOutput.log".
      See also "/home/anel/GitHub/mariadb/server/build/connect-java/CMakeFiles/CMakeError.log".
      

      However after testing cmake regex is good.
      Tested: https://regexr.com/7dmes

      This seems to be cmake bug.
      New cmake patch 3351b7b82c2 from cmake 3.24+ works, I have verified and tested and it works fine.

      Not sure should we indicate that in our codebase somehow (with comments)?

      Attachments

        Activity

          People

            anel Anel Husakovic
            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.