Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QMAKE_POST_LINK failures don't re-try on the next build?
QtWS25 Last Chance

QMAKE_POST_LINK failures don't re-try on the next build?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
10 Posts 2 Posters 2.6k 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by
    #1

    I use QMAKE_POST_LINK for my post build steps (a python script) (so i can move the project to a different computer and not have to manually create post build steps in the build config)

    But if that post link step fails, i go and fix the python script. then when i go back and hit build again, it doesn't re-attempt the post link step.

    is this a bug in Qt Creator?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #10

      what i did was make a new build step, reordered it to come FIRST, which just deletes the .exe (or .app). that way, the app is ALWAYS linked, and ALWAYS runs the post link step

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        No it's not related to Qt Creator at all. What happens is that in fact no build happens since your application was already built thus nothing is linked therefore the post link step is not called.

        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
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #3

          oh, so "linking" is not actually considered a build step (when i hit "build") ?
          i totally thought it was. in my thinking, if Qt Creator knows that the build was successful but the link was not, then next time i "build", i would have expected it to just attempt to link again.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            You misunderstood me: the second time you hit build, nothing happens because there is nothing to do.

            Let's rewind:

            • You change your application code
            • You hit the build button (first time)
            • Your code is built
            • Your objects are linked
            • Your post link step is called

            So far so good.

            Now:

            • You modify your post link script (so unrelated to your application code)
            • You hit the build button (so second time)
            • No code was modified so nothing is built
            • Nothing was built so nothing needs to be linked
            • Nothing was linked so there's no post link action

            An easy work around to that is to take of your source file, "touch it" and then build again.

            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
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by
              #5

              well, so this is what i'm seeing:

              • You change your application code
              • You hit the build button (first time)
              • Your code is built
              • Your objects are linked
              • Your post link step is called
              • the post link step FAILS <--- this is the problem

              here's what i expect:

              • You modify your post link script (so unrelated to your application code)
              • You hit the build button (so second time)
              • No code was modified so nothing is built
              • Nothing was built so nothing needs to be linked
              • since post-link FAILED last time, re-run the post link action

              IMHO, post-link is PART of linking. if linking fails (including post-link) then you HAVE to re-do it. i consider this a bug.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #6

                Post link is not part of link, it happens after it when linking happened and succeeded. Like I wrote before, the second time, there's no linking happening so there's no post linking to be run.

                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
                0
                • D Offline
                  D Offline
                  davecotter
                  wrote on last edited by
                  #7

                  okay, so i get it that it's not part of linking.

                  my question remains: how can i get the compiler to see a post-link failure as something to re-attempt the next time i build?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #8

                    Like I suggested before, the quick and easy solution is to "touch" one of the source file so the next build will do something.

                    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
                    0
                    • D Offline
                      D Offline
                      davecotter
                      wrote on last edited by
                      #9

                      yes i know i can do that, but that's the point, the IDE should track that, not me.

                      from my perspective, touching any source file, including the post link python script, is what should cause the IDE to KNOW to rebuild that file or rerun that script. having to remember to do it manually harkens back to the day when you had to manually re-compile a file you had touched, because the IDE didn't track that sort of thing, because there was no IDE to do so.

                      in xcode there's a notion in any build step about "input files". you set any files as an input to the build step, then xcode tracks the mod dates of those files, and if any of those dates change between builds, that step is always re-run. it's a no brainer. computers should do our bidding and automate tedious tasks for us, we should not have to "work around" a limitation that can very easily be scripted.

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        davecotter
                        wrote on last edited by
                        #10

                        what i did was make a new build step, reordered it to come FIRST, which just deletes the .exe (or .app). that way, the app is ALWAYS linked, and ALWAYS runs the post link step

                        1 Reply Last reply
                        0

                        • Login

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