Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to compile single Qt module and use it on app?
QtWS25 Last Chance

How to compile single Qt module and use it on app?

Scheduled Pinned Locked Moved Solved General and Desktop
31 Posts 6 Posters 4.4k 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 JKSH
    29 Jun 2019, 11:37

    @_BPL_ said in How to compile single Qt module and use it on app?:

    Mmmm, interesting command indeed, it uses binary search... guess that 7 comes from ceil(log2(73))? Worst case of 7*20 isn't that bad (I guess :P)... I'll get familiar with that command first using some dummy projects for not screwing up with the real thing.

    In any case, it'd be interesting to know what's the workflow used by qt developers, which I'm pretty much sure it'll be quite optimized so they can check different versions relatively fast.

    See my previous post. It contains a link to an example where someone used git-bisect to hunt down a Qt bug. It also contains a link to the Developer mailing list where you can talk to the Qt developers directly.

    _ Offline
    _ Offline
    _BPL_
    wrote on 29 Jun 2019, 13:55 last edited by
    #18

    @JKSH said in How to compile single Qt module and use it on app?:

    See my previous post. It contains a link to an example where someone used git-bisect to hunt down a Qt bug. It also contains a link to the Developer mailing list where you can talk to the Qt developers directly.

    Thanks, but... I've decided to ask to one of the devs... It'd be great if git-bisect could be used effectively on windows+visual_studio although my hopes are quite low.

    The closes I've been to avoid doing git checkout -- . && git clean -fxd was to checkout a possible bad commit, cd qmake && nmake clean and configure.bat <options>... in this case configure.bat wouldn't give me errors... but when building again qtbase times would still be as similar as a cold build :(

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 29 Jun 2019, 15:27 last edited by Christian Ehrlicher
      #19

      Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      _ 2 Replies Last reply 29 Jun 2019, 16:13
      1
      • C Christian Ehrlicher
        29 Jun 2019, 15:27

        Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

        _ Offline
        _ Offline
        _BPL_
        wrote on 29 Jun 2019, 16:13 last edited by
        #20

        @Christian-Ehrlicher said in How to compile single Qt module and use it on app?:

        Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

        Maybe you're right and probably that's the faster startegy for bug hunting using git-bisect on qtbase. Only advantage of cleaning & reconfiguring is you can keep the good/bad commits living in separate folders (each time I was calling configure.bat I was using as a prefix the result of git describe --tags commit_hash) but consider the only goal is bug hunting probably these good/bad commit folders shouldn't be kept anyway (are they useful for other purposes?)

        Anyway, I've found the commit that introduced the bug and it's 1 year old, that's crazy :P !!!! It'd be really interesting to know how long would it take to hunt it using your method when working on latest master (configured&built ready).

        I've learned quite a lot thanks to this bug but it's still unclear to me when it's required to reconfigure again before building... it'd be interesting to learn that for future bug huntings :)

        1 Reply Last reply
        1
        • _ Offline
          _ Offline
          _BPL_
          wrote on 29 Jun 2019, 16:36 last edited by
          #21

          Btw, for those interested on this issue I've posted the results of my bug hunting on the original thread.

          Possible fixes are welcome :D

          1 Reply Last reply
          0
          • C Christian Ehrlicher
            29 Jun 2019, 15:27

            Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

            _ Offline
            _ Offline
            _BPL_
            wrote on 29 Jun 2019, 16:46 last edited by
            #22

            @Christian-Ehrlicher said in How to compile single Qt module and use it on app?:

            Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

            Btw... I've tested this suggestion and I can tell it won't work, give it a shot and you'll see, you'll probably end up with compiler/linking errors mostly of the time (even reconfiguring), so... yeah, unfortunately the only reliable way I've found to build a new local branch is by doing:

            1. git checkout -- . && git clean -fxd :)
            2. configure <options>
            3. make

            Not cool at all :/

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 29 Jun 2019, 16:50 last edited by
              #23

              You can be sure that I compile qtbase more than once a day and calling configure is only needed when switching branches.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              _ 1 Reply Last reply 29 Jun 2019, 17:44
              0
              • C Christian Ehrlicher
                29 Jun 2019, 16:50

                You can be sure that I compile qtbase more than once a day and calling configure is only needed when switching branches.

                _ Offline
                _ Offline
                _BPL_
                wrote on 29 Jun 2019, 17:44 last edited by
                #24

                @Christian-Ehrlicher Sure thing, just to be clear I don't doubt your suggestion works fin... my comment was based on the fact each time I've tried it out here I ended up having errors. Anyway, I'd really like to confirm it so I'll really know when I can apply it. Let's say I've checked out origin/5.12 [5d7e221bbf] and it's built succesfully. Now let's say I'd like to start bisecting without having to reconfigure, what'd be the oldest commit where I can be sure I don't need to reconfigure again? Could you please post the git hash of such a commit? I'd like to check it out.

                Thanks in advance!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 29 Jun 2019, 20:38 last edited by
                  #25

                  One small suggestion, use out of source builds. This will avoid the problem of cleaning stuff up in the source tree. If your build is broken for some reason, just nuke the folder and start fresh.

                  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 29 Jun 2019, 20:50
                  2
                  • S SGaist
                    29 Jun 2019, 20:38

                    One small suggestion, use out of source builds. This will avoid the problem of cleaning stuff up in the source tree. If your build is broken for some reason, just nuke the folder and start fresh.

                    _ Offline
                    _ Offline
                    _BPL_
                    wrote on 29 Jun 2019, 20:50 last edited by
                    #26

                    @SGaist Actually... That's a really good advice, I didn't know it was possible to achieve with this particular qtbase project, I've been doing it wrong all the time :-P . Could you please explain how to do that?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 29 Jun 2019, 21:03 last edited by
                      #27

                      Here is a generic *nix version but it's easy to translate to Windows style.

                      mkdir /some_path/builddir/qt5/qtbase
                      cd /some_path/builddir/qt5/qtbase
                      /path/to/Qt_sources/qtbase/configure
                      

                      /some_path/builddir is a path you use for building stuff.

                      I usually keep the qt5/module_names structure so if I build an other module it follows the sources folders structure. It's by no mean mandatory just a habit of mine.

                      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 29 Jun 2019, 22:19
                      3
                      • S SGaist
                        29 Jun 2019, 21:03

                        Here is a generic *nix version but it's easy to translate to Windows style.

                        mkdir /some_path/builddir/qt5/qtbase
                        cd /some_path/builddir/qt5/qtbase
                        /path/to/Qt_sources/qtbase/configure
                        

                        /some_path/builddir is a path you use for building stuff.

                        I usually keep the qt5/module_names structure so if I build an other module it follows the sources folders structure. It's by no mean mandatory just a habit of mine.

                        _ Offline
                        _ Offline
                        _BPL_
                        wrote on 29 Jun 2019, 22:19 last edited by
                        #28

                        @SGaist Awesome, this it's exactly how a build should be done... it's clear as water what configure is doing (not a black box anymore) and it's keeping the source tree clean. Right now I'm checking if a build/install using this method will work with origin/HEAD but all it's pointing out that's the case...

                        Anyway, I still would like to confirm what I've asked couple of comments ago about the git-bisect... Let me put a hypthetical example, let's say you're working on origin/head and you discover there is a bug... what'd be the optimal way to hunt it by using git-bisect? Said otherwise, how do you know what's the oldest commit you'll be able to test without having to reconfigure again?

                        Btw, this is my first time posting in the forums and while I feel this thread has become really interesting with lots of nice hints I also can see it's deviated a little bit from my original question :) , is that alright or usually this is the type of forum to get "solved" as an end goal (similar to Stackoverflow)... Btw, If that's the case I don't know what's the valid answer anymore lol ;)

                        Thanks everybody!

                        M 1 Reply Last reply 29 Jun 2019, 23:23
                        1
                        • _ _BPL_
                          29 Jun 2019, 22:19

                          @SGaist Awesome, this it's exactly how a build should be done... it's clear as water what configure is doing (not a black box anymore) and it's keeping the source tree clean. Right now I'm checking if a build/install using this method will work with origin/HEAD but all it's pointing out that's the case...

                          Anyway, I still would like to confirm what I've asked couple of comments ago about the git-bisect... Let me put a hypthetical example, let's say you're working on origin/head and you discover there is a bug... what'd be the optimal way to hunt it by using git-bisect? Said otherwise, how do you know what's the oldest commit you'll be able to test without having to reconfigure again?

                          Btw, this is my first time posting in the forums and while I feel this thread has become really interesting with lots of nice hints I also can see it's deviated a little bit from my original question :) , is that alright or usually this is the type of forum to get "solved" as an end goal (similar to Stackoverflow)... Btw, If that's the case I don't know what's the valid answer anymore lol ;)

                          Thanks everybody!

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 29 Jun 2019, 23:23 last edited by
                          #29

                          @_BPL_
                          Hi
                          The main goal here is to help people use the Qt framework and when the poster has a positive attitude and
                          well-asked questions - we are known to help with anything programming related.
                          We prefer to have unrelated questions in own threads so Title is accurate but in this case,
                          it was all related to building a module so seems pretty fine.
                          However, we like if you would use the Topic Tool button in your top post to mark as solved
                          as that helps other find answers and
                          us forum lurkers to see what posts are still unanswered.
                          alt text

                          _ 1 Reply Last reply 30 Jun 2019, 00:18
                          2
                          • M mrjj
                            29 Jun 2019, 23:23

                            @_BPL_
                            Hi
                            The main goal here is to help people use the Qt framework and when the poster has a positive attitude and
                            well-asked questions - we are known to help with anything programming related.
                            We prefer to have unrelated questions in own threads so Title is accurate but in this case,
                            it was all related to building a module so seems pretty fine.
                            However, we like if you would use the Topic Tool button in your top post to mark as solved
                            as that helps other find answers and
                            us forum lurkers to see what posts are still unanswered.
                            alt text

                            _ Offline
                            _ Offline
                            _BPL_
                            wrote on 30 Jun 2019, 00:18 last edited by
                            #30

                            @mrjj Thanks to clarify, that helps and makes total sense... I'll forget about my last question of git-bisect. I think at this point this thread has become quite clear already, I've opened a new one in the corresponding section. This has been my first thread in the forums so I didn't know there was a section called "Installation and Deployment". I guess this one should also be living there.

                            Anyway, again, thanks everybody for your help!

                            Ps. When I try to submit is telling me As a new user, you can only post once every 600 second(s) until you have earned 1 reputation - please wait before posting again, how do earn reputation? Is it a similar system than SO so I need to start answering questions as well?

                            M 1 Reply Last reply 30 Jun 2019, 01:30
                            1
                            • _ _BPL_
                              30 Jun 2019, 00:18

                              @mrjj Thanks to clarify, that helps and makes total sense... I'll forget about my last question of git-bisect. I think at this point this thread has become quite clear already, I've opened a new one in the corresponding section. This has been my first thread in the forums so I didn't know there was a section called "Installation and Deployment". I guess this one should also be living there.

                              Anyway, again, thanks everybody for your help!

                              Ps. When I try to submit is telling me As a new user, you can only post once every 600 second(s) until you have earned 1 reputation - please wait before posting again, how do earn reputation? Is it a similar system than SO so I need to start answering questions as well?

                              M Offline
                              M Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on 30 Jun 2019, 01:30 last edited by
                              #31

                              @_BPL_
                              Hi
                              Yes, you earn reps by people upvoting your answers.
                              However, its mostly a spam protection feature so i upvoted you to remove the
                              600 secs delay :)

                              1 Reply Last reply
                              0

                              27/31

                              29 Jun 2019, 21:03

                              • Login

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