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

qmllint: Nondeterministic output when multiple files are linted in one invocation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.1, 6.8, 6.9.0 FF
    • 6.6.0
    • QML: Tooling
    • None
    • bc125ff64 (dev), fe6388c24 (6.8), d16bcf083 (dev), 3557dc846 (6.8)

    Description

      Building the attached example will result in qmllint warnings (and therefore a failed build if qmllint is taken seriously).

      Note the order of the qml files:

      • Main.qml
      • Foo.qml
      • Bar.qml

      Bar uses Foo. If Bar is listed before Foo (or Main would also use Foo), the warning disappears.

      • execute qmllint command only with foo.qml => warning
      • execute qmllint command with bar.qml + foo.qml => no warning
      • execute qmllint command with foo.qml + bar.qml => warning

      It seems the linter object in qmllint does not have a clean state for each invocation on the next file.

      Also I don't understand why this warning is triggered at all. Looks a little bit like QTBUG-104571, as QtQuick.Dialogs uses file selectors in its qmldir.

       

      FAILED: CMakeFiles/appuntitled_qmllint /Users/njeiseck/projects/build-untitled-Qt_6_6_0_for_macOS-Debug/CMakeFiles/appuntitled_qmllint 
      cd /Users/njeiseck/projects/untitled && /usr/local/Qt/6.6.0/macos/bin/qmllint --bare -I /Users/njeiseck/projects/build-untitled-Qt_6_6_0_for_macOS-Debug -I /usr/local/Qt/6.6.0/macos/./qml --resource /Users/njeiseck/projects/build-untitled-Qt_6_6_0_for_macOS-Debug/.rcc/qmake_untitled.qrc --resource /Users/njeiseck/projects/build-untitled-Qt_6_6_0_for_macOS-Debug/.rcc/appuntitled_raw_qml_0.qrc /Users/njeiseck/projects/untitled/Main.qml /Users/njeiseck/projects/untitled/Foo.qml /Users/njeiseck/projects/untitled/Bar.qml
      Warning: /Users/njeiseck/projects/untitled/Foo.qml:2:1: Warnings occurred while importing module "QtQuick.Dialogs": [import]
      import QtQuick.Dialogs
      ^^^^^^
      ---
      Warning: Ambiguous type detected. FolderDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. ColorDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. ColorDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FolderDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. ColorDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. MessageDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. ColorDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FileDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FolderDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FontDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. MessageDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FontDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FolderDialogDelegate 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FolderDialogDelegate 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FontDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FileDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FontDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. MessageDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FileDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FileDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FolderDialogDelegate 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. MessageDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FolderDialog 6.0 is defined multiple times. [import]
      Warning: Ambiguous type detected. FolderDialogDelegate 6.0 is defined multiple times. [import]
      ---
      
      [4/8 2.1/sec] Building CXX object CMakeFiles/appuntitled.dir/.rcc/qmlcache/appuntitled_Bar_qml.cpp.o
      [5/8 2.6/sec] Building CXX object CMakeFiles/appuntitled.dir/.rcc/qmlcache/appuntitled_Main_qml.cpp.o
      [6/8 3.1/sec] Building CXX object CMakeFiles/appuntitled.dir/.rcc/qmlcache/appuntitled_Foo_qml.cpp.o
      [7/8 3.4/sec] Building CXX object CMakeFiles/appuntitled.dir/.rcc/qmlcache/appuntitled_qmlcache_loader.cpp.o
      ninja: build stopped: subcommand failed.
      

      Attachments

        1. importwarning.tgz
          1 kB
          Nils Jeisecke

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              njeisecke Nils Jeisecke
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews