Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-139199

qttools configure error if llvm-provided packages are used

XMLWordPrintable

    • All
    • b676278a2 (dev), 4ea3f090f (6.10), 02f94ce22 (dev), 6051f6ed4 (6.10)

      Consider the following situation:

      • Linux, maybe debian with llvm-provided llvm-packages from apt.llvm.org
      • user is doing a per-repo build of qttools

      Configuring qttools fails with

      CMake Error at /usr/lib/x86_64-linux-gnu/cmake/zstd/zstdTargets.cmake:42 (message):
        Some (but not all) targets in this export set were already defined.
      
        Targets Defined: zstd::libzstd_shared, zstd::libzstd_static
      
        Targets not yet defined: zstd::libzstd
      
      Call Stack (most recent call first):
        /usr/lib/x86_64-linux-gnu/cmake/zstd/zstdConfig.cmake:42 (include)
        /home/karl-heinz/src/qt/single_repos/src/qtbase/cmake/FindWrapZSTD.cmake:24 (find_package)
        /home/karl-heinz/src/qt/single_repos/src/qtbase/cmake/QtFindPackageHelpers.cmake:141 (find_package)
        src/designer/src/lib/CMakeLists.txt:425 (qt_find_package)
      
      
      -- Configuring incomplete, errors occurred!
      CMake Error at /home/karl-heinz/src/qt/single_repos/src/qtbase/cmake/QtProcessConfigureArgs.cmake:1187 (message):
        CMake exited with code 1.
      

      The problem here is that

      • llvmConfig.cmake does find_package(zstd)
      • LLVM's Findzstd.cmake is loaded (because CMAKE_MODULE_PATH is temporarily modified) and creates two targets: zstd::libzstd_shared, zstd::libzstd_static
      • later, in the designer subdir of qttools, we have find_package(WrapZSTD) which does find_package(zstd)
      • zstdConfig.cmake is loaded and expects three or zero targets: zstd::libzstd_shared, zstd::libzstd_static, zstd::libzstd

      That LLVM's Findzstd.cmake is inconsistent with zstd's config files is a known issue and packagers work around that issue. For example: https://www.mail-archive.com/arch-commits@archlinux.org/msg965877.html

      LLVM upstream issue: https://github.com/llvm/llvm-project/issues/139666

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jbornema Joerg Bornemann
            jbornema Joerg Bornemann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes