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

moc: The metatypes.json file is generated with ambiguous "inputFile" records.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2, 6.5, 6.6
    • None
    • 6dda607f6 (dev), bfa3852bc (6.6)

    Description

      "inputFile" records in the generated metatypes.json files use the file name as the value. This is ambiguous since using subdirectories we can use the same file name but specify different content. The example project reproduces the invalid behavior. subdir/myclass.h end's up as "inputFile": "myclass.h" record in the metatypes.json file, so qmltyperegistrar generates the single include record for myclass.h and as the result compilation fails.

      The attached example is quite trivial, but in real projects subdir might reflect the inner namespace structure(this can happen in QtProtobuf for instance), so we definitely should consider subdirectories when generating metatypes.json.

      I suggest to add extra record to not break the dependent user projects, if they exist.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-115499
          # Subject Branch Project Status CR V

          Activity

            People

              qtbuildsystem Qt Build System Team
              semlanik Alexey Edelev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes