Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. pyside6-rcc generating different output on different PCs

pyside6-rcc generating different output on different PCs

Scheduled Pinned Locked Moved Solved Qt for Python
qt for pythonpython
9 Posts 4 Posters 374 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    james0807
    wrote on 11 Feb 2025, 09:59 last edited by
    #1

    Hi,

    I've got a project using PySide6 6.8.2.1 that is generating a different output on two PCs for the resources.qrc file once it's compiled using pyside6-rcc.

    Both PCs running Windows 11, Python 3.12.9 & virtual environments installed using the same requirements.txt file and viewing the same commit hash.

    The different is only in the "qt_resource_struct" byte array that is part of the "resources_rc.py" file and only 3 bytes are different.

    This issue was present when using python 3.12.5 & PySide6 6.7.3 as well, I updated everything as part of my attempts to resolve.

    Anyone got any thoughts?

    Thanks in advance

    J 1 Reply Last reply 11 Feb 2025, 10:24
    0
    • J james0807
      11 Feb 2025, 11:55

      @jsulm Interesting!

      So *_ui.py should be in my gitignore?

      Wouldn't that mean everything needs to be re-compiled locally whenever a change is made to a .ui file?

      Appreciate your help here by the way, I wasn't aware those python output files were not intended to be version controlled.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 11 Feb 2025, 12:40 last edited by
      #6

      @james0807 said in pyside6-rcc generating different output on different PCs:

      Wouldn't that mean everything needs to be re-compiled locally whenever a change is made to a .ui file?

      Yes, they needs to be generated again, but you always have to recompile after a change in ui file whether you store the generated files in your repo or not doesn't matter. It's like with C++ code: if you change something you have to recompile and you do not store generated object files in your repo.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply 11 Feb 2025, 13:27
      2
      • J james0807
        11 Feb 2025, 09:59

        Hi,

        I've got a project using PySide6 6.8.2.1 that is generating a different output on two PCs for the resources.qrc file once it's compiled using pyside6-rcc.

        Both PCs running Windows 11, Python 3.12.9 & virtual environments installed using the same requirements.txt file and viewing the same commit hash.

        The different is only in the "qt_resource_struct" byte array that is part of the "resources_rc.py" file and only 3 bytes are different.

        This issue was present when using python 3.12.5 & PySide6 6.7.3 as well, I updated everything as part of my attempts to resolve.

        Anyone got any thoughts?

        Thanks in advance

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 11 Feb 2025, 10:24 last edited by
        #2

        @james0807 Why is this a problem?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        J 1 Reply Last reply 11 Feb 2025, 11:36
        0
        • J jsulm
          11 Feb 2025, 10:24

          @james0807 Why is this a problem?

          J Offline
          J Offline
          james0807
          wrote on 11 Feb 2025, 11:36 last edited by
          #3

          @jsulm

          Well... files are changing per commit depending on which PC compiles the file, which is an annoyance. I'm also unsure if the different output is expected behaviour or an indication that something is wrong behind the scenes.

          I'm also intrigued that the compilation appears to not be deterministic.

          J 1 Reply Last reply 11 Feb 2025, 11:49
          0
          • J james0807
            11 Feb 2025, 11:36

            @jsulm

            Well... files are changing per commit depending on which PC compiles the file, which is an annoyance. I'm also unsure if the different output is expected behaviour or an indication that something is wrong behind the scenes.

            I'm also intrigued that the compilation appears to not be deterministic.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 11 Feb 2025, 11:49 last edited by
            #4

            @james0807 Generated files should not be commited.

            "I'm also intrigued that the compilation appears to not be deterministic" - this is usually the case, even with C/C++ compilers. There are many things playing a role here, like timestamps.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            J 1 Reply Last reply 11 Feb 2025, 11:55
            0
            • J jsulm
              11 Feb 2025, 11:49

              @james0807 Generated files should not be commited.

              "I'm also intrigued that the compilation appears to not be deterministic" - this is usually the case, even with C/C++ compilers. There are many things playing a role here, like timestamps.

              J Offline
              J Offline
              james0807
              wrote on 11 Feb 2025, 11:55 last edited by
              #5

              @jsulm Interesting!

              So *_ui.py should be in my gitignore?

              Wouldn't that mean everything needs to be re-compiled locally whenever a change is made to a .ui file?

              Appreciate your help here by the way, I wasn't aware those python output files were not intended to be version controlled.

              J 1 Reply Last reply 11 Feb 2025, 12:40
              0
              • J james0807
                11 Feb 2025, 11:55

                @jsulm Interesting!

                So *_ui.py should be in my gitignore?

                Wouldn't that mean everything needs to be re-compiled locally whenever a change is made to a .ui file?

                Appreciate your help here by the way, I wasn't aware those python output files were not intended to be version controlled.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 11 Feb 2025, 12:40 last edited by
                #6

                @james0807 said in pyside6-rcc generating different output on different PCs:

                Wouldn't that mean everything needs to be re-compiled locally whenever a change is made to a .ui file?

                Yes, they needs to be generated again, but you always have to recompile after a change in ui file whether you store the generated files in your repo or not doesn't matter. It's like with C++ code: if you change something you have to recompile and you do not store generated object files in your repo.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                J 1 Reply Last reply 11 Feb 2025, 13:27
                2
                • J jsulm
                  11 Feb 2025, 12:40

                  @james0807 said in pyside6-rcc generating different output on different PCs:

                  Wouldn't that mean everything needs to be re-compiled locally whenever a change is made to a .ui file?

                  Yes, they needs to be generated again, but you always have to recompile after a change in ui file whether you store the generated files in your repo or not doesn't matter. It's like with C++ code: if you change something you have to recompile and you do not store generated object files in your repo.

                  J Offline
                  J Offline
                  james0807
                  wrote on 11 Feb 2025, 13:27 last edited by
                  #7

                  @jsulm

                  Interesting. In C++ though you generally aren't generating .cpp files, whereas in the python case the output of the compiler are .py files, making not including them less trivial.

                  the PySide6-uic output is deterministic, it only seems to be rcc that has this behaviour I guess because it's embedding the resources themselves.

                  Thank you for your help!

                  1 Reply Last reply
                  0
                  • J james0807 has marked this topic as solved on 11 Feb 2025, 13:27
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 11 Feb 2025, 20:28 last edited by
                    #8

                    Hi,

                    It's a bit more complicated than that.
                    On the C++ side, you have a bit more project management and there uic is run automatically and generates code that does not need to be stored in the repository.
                    With Python, you usually don't have such automated process which means that people often check-in the generated py files because they don't take the "do not edit this file" section to the letter.

                    As you have seen, Qt uses several code generation tools whether for C++ or Python. While they have compiler in the name, they do not act as compilers in the gcc, clang, etc. sense. They rather compute a language specific output from an initial source that can then be compiled (c++) or loaded by an interpreter (Python).

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • F Offline
                      F Offline
                      friedemannkleint
                      wrote on 13 Feb 2025, 11:21 last edited by
                      #9

                      We actually provide a tool,
                      pyside6-project , which defines a simple project file format and can do these steps automatically and can also be opened in Qt Creator.

                      1 Reply Last reply
                      2

                      2/9

                      11 Feb 2025, 10:24

                      topic:navigator.unread, 7
                      • Login

                      • Login or register to search.
                      2 out of 9
                      • First post
                        2/9
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved