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

qt_internal_add_qml_module should warn about files being added twice

    XMLWordPrintable

Details

    Description

      With https://codereview.qt-project.org/c/qt/qtdeclarative/+/499243/7 I accidentally added a file to qt_internal_add_qml_module's QML_FILES twice while fixing rebase conflicts:

      # Copyright (C) 2023 The Qt Company Ltd.
      # SPDX-License-Identifier: BSD-3-Clause
      set(qml_files
          "SwitchHandle.qml"
          "SwitchIndicator.qml"
          "SwitchHandle.qml"
      )
      qt_internal_add_qml_module(qtquickcontrols2macosstyleimplplugin
          URI "QtQuick.Controls.macOS.impl"
          VERSION "${PROJECT_VERSION}"
          PAST_MAJOR_VERSIONS 6
          CLASS_NAME QtQuickControls2macOSStyleImplPlugin
          DEPENDENCIES
              QtQuick/auto
          PLUGIN_TARGET qtquickcontrols2macosstyleimplplugin
          NO_PLUGIN_OPTIONAL
          QML_FILES
              ${qml_files}
          DEFINES
              QT_NO_CAST_FROM_ASCII
              QT_NO_CAST_TO_ASCII
      )
      

      that resulted in this error:

      11:58:30: Running steps for project QtDeclarative...    11:58:30: Starting: "/opt/homebrew/Cellar/cmake/3.26.0/bin/cmake" --build /Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative --target all    [1/2027 1.6/sec] Generating pc file for target Qt6::Quick    [2/2027 3.2/sec] Generating prl file for target Quick    [3/2027 3.1/sec] Running rcc for resource qmake_QtQuick    [4/2027 3.9/sec] Running rcc for resource scenegraph_shaders    [5/2027 3.9/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomfilewriter.cpp.o    [6/2027 4.1/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomindentinglinewriter.cpp.o    [7/2027 4.6/sec] Building CXX object src/quickcontrols/macos/impl/CMakeFiles/qtquickcontrols2macosstyleimplplugin.dir/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp.o    FAILED: src/quickcontrols/macos/impl/CMakeFiles/qtquickcontrols2macosstyleimplplugin.dir/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp.o    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DGL_SILENCE_DEPRECATION -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_NETWORK_LIB -DQT_NO_AS_CONST -DQT_NO_AS_CONST=1 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_EXCEPTIONS -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_PLUGIN -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_STRICT_QLIST_ITERATORS -DQT_USE_QSTRINGBUILDER -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -Dqtquickcontrols2macosstyleimplplugin_EXPORTS -I/Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative/src/quickcontrols/macos/impl/qtquickcontrols2macosstyleimplplugin_autogen/include -I/Users/mitch/dev/qt-dev/qtdeclarative/src/quickcontrols/macos/impl -I/Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative/src/quickcontrols/macos/impl -I/Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative/src/qml -I/Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtQml/6.7.0 -I/Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtQml/6.7.0/QtQml -I/Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtQml -I/Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtQmlIntegration -I/Users/mitch/dev/qt-dev/qtdeclarative/src/qmlintegration -I/Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative/src/qmlintegration -isystem /Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include -isystem /Users/mitch/dev/qt-dev-debug-non-fw/qtbase/src/corelib -isystem /Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtCore/6.7.0 -isystem /Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtCore/6.7.0/QtCore -isystem /Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtCore -isystem /Users/mitch/dev/qt-dev-debug-non-fw/qtbase/mkspecs/macx-clang -isystem /Users/mitch/dev/qt-dev-debug-non-fw/qtbase/include/QtNetwork -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mmacosx-version-min=11.0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fno-exceptions -Werror "-Wno-error=#warnings" -Wno-error=deprecated-declarations -fapplication-extension -MD -MT src/quickcontrols/macos/impl/CMakeFiles/qtquickcontrols2macosstyleimplplugin.dir/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp.o -MF src/quickcontrols/macos/impl/CMakeFiles/qtquickcontrols2macosstyleimplplugin.dir/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp.o.d -o src/quickcontrols/macos/impl/CMakeFiles/qtquickcontrols2macosstyleimplplugin.dir/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp.o -c /Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative/src/quickcontrols/macos/impl/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp    /Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative/src/quickcontrols/macos/impl/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp:25:38: error: redefinition of 'unit'        const QQmlPrivate::CachedQmlUnit unit = {                                         ^    /Users/mitch/dev/qt-dev-debug-non-fw/qtdeclarative/src/quickcontrols/macos/impl/.rcc/qmlcache/qtquickcontrols2macosstyleimplplugin_qmlcache_loader.cpp:11:38: note: previous definition is here        const QQmlPrivate::CachedQmlUnit unit = {                                         ^    1 error generated.    [8/2027 3.8/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomlinewriter.cpp.o    [9/2027 2.6/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomerrormessage.cpp.o    [10/2027 2.4/sec] Running AUTOMOC file extraction for target Quick    [11/2027 2.4/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomfieldfilter.cpp.o    [12/2027 2.2/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldommock.cpp.o    [13/2027 1.9/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldommoduleindex.cpp.o    [14/2027 1.6/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomexternalitems.cpp.o    [15/2027 1.4/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomelements.cpp.o    [16/2027 1.4/sec] Building CXX object src/qmldom/CMakeFiles/QmlDomPrivate.dir/qqmldomitem.cpp.o    ninja: build stopped: subcommand failed.    11:58:42: The process "/opt/homebrew/Cellar/cmake/3.26.0/bin/cmake" exited with code 1.    Error while building/deploying project QtDeclarative (kit: qt-dev-debug-non-fw)    When executing step "Build"    11:58:42: Elapsed time: 00:11.
      

      The error message would be better if it came from CMake complaining about the same file being added twice.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes