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

Build repc from source corrupts generated files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6.1
    • Remote Objects
    • None
    • Windows

    Description

      Summary:
      I customized repc by removing the QCLASSINFO(QCLASSINFO_REMOTEOBJECT_TYPE, value).

      repcodegenerator.cpp 631

      // m_stream << "    Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_TYPE, \""
            //          << astClass.name << "\")" << Qt::endl;
      • using customized repc with QMAKE_EXTRA_COMPILERS results in a corrupted file. File looks fine and contains everything it should, but is corrupted.
        • moc does not get generated for the file generated by customized repc

      Even after building Qt 6.6.1 from sources and using the repc from that build in my project as described above the same error persists.

      ______________________
      Explanation:
      After building customized repc from sources the source/replica get corrupted.
      C:\Dev\Build\project\src\Util\rep_ExampleClass_source.h:-1: error: LNK1107: invalid or corrupt file: cannot read at 0x23B3

      Step by step:

      • Build the attached repc
      • add following lines to .qmake.conf
        •   
          # Use customized repc
          OUT_ROOT=$$shadowed($$PWD)
          # Build rep_class_source.h with customized repc
          c_repc_source.output  = rep_${QMAKE_FILE_BASE}_source.h
          c_repc_source.commands = $$OUT_ROOT/bin/repc -i rep -o source ${QMAKE_FILE_NAME} rep_${QMAKE_FILE_BASE}_source.h
          c_repc_source.input = C_REPC_SOURCE
          QMAKE_EXTRA_COMPILERS += c_repc_source
          # Build rep_class_replica.h with customized repc
          c_repc_replica.output  = rep_${QMAKE_FILE_BASE}_replica.h
          c_repc_replica.commands = $$OUT_ROOT/bin/repc -i rep -o replica ${QMAKE_FILE_NAME} rep_${QMAKE_FILE_BASE}_replica.h
          c_repc_replica.input = C_REPC_REPLICA
          QMAKE_EXTRA_COMPILERS += c_repc_replica
          
      •  add following lines to a .pro file in the same project
        • C_REPC_SOURCE += \
              ExampleClass/ExampleClass.rep
          
          C_REPC_REPLICA += \
              ExampleClass/ExampleClass.rep 

           

      • define that exampleclass.rep like so
        • class ExampleClass {
             PROP(bool remove=false);
             SLOT(removeSlot(bool remove));
          }

           

      • Compile

      Note: in the repc.pro there are 3 lines that I could not resolve/understand why they are needed.

      Talking about

      # option(host_build)
      # include(moc_copy/moc.pri)
      
      # load(qt_tool) 

      include moc.pri does not exists in qt 6.6.1 aswell as qt_tool function.

      I attached the broken files aswell. I compared them with Notepad++ compare-plugin to the files generated by the repc from qt 6.6.1 installation. They were identical.. Seems to me something under the hood of repc does not work properly

      Attachments

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

        Activity

          People

            bstottle Brett Stottlemyer
            redman Calvin Flatt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes