5 ms·
Is anyone here using gitlab with a runner to build QT applications upon commit? I've got a friend who needs this and he is only using QTCreator but it seems lik
by xrd 7y ago
Is anyone here using gitlab with a runner to build QT applications upon commit? I've got a friend who needs this and he is only using QTCreator but it seems like building inside a docker container should be possible. I guess I'm asking: can all the things discussed here be done from command line instead of inside the editor and if so, how do you determine those commands?
- detaro 7y agoSure, you don't need an IDE to build a Qt app. If you set it up using cmake, it's like any other app: cmake, make, done. (cmake has support for handling the Qt specific bits for you) If you're using Qt's qmake, which is likely if they just started with QtCreator, you call qmake and then make to build. In both cases I'd refer you to Qt's documentation for details, but QtCreators project configuration UI and build log also shows you which commands it is running.
- ucosty 7y agoI have a project that has this same workflow, in my gitlab-ci file I just run qmake followed by make. I have a custom container which contains the QT library and build tools.
- xrd 7y agoAre any of you available for a consulting project? If so, can you email me at the email in my profile?
- wwright 7y agoI've led adoption on that exact setup at work. You can definitely do it, but I have nothing but bad things to say about Qmake. It's poorly documented, inscrutable, and a huge PITA. Switch to any other build system if you can. That said, automating the builds in GitLab CI was worth it 1000x over.
- irishcoffee 7y agoIf you’re fighting qmake there is a very good chance you’re fighting the wrong problem. Is your build a complicated mess? (It shouldn’t be) Do you have a complicated multi platform mess (it shouldn’t be complicated) I would be happy to take a look at your build.
- wwright 7y agoOff the top of my head: - qmake doesn't support true dependencies between subprojects (ie, if I ask it to build a/b/c, it can't know that a/b/c depends on d/e/f) - qmake's support for integrating additional compilers is inscrutable and again, has terrible issues with parallelism and dependencies - the way it is backed by make is prone to incremental build issues
- irishcoffee 7y agoFor point 1, it can if you want it to. https://wiki.qt.io/SUBDIRS_-_handling_dependencies#Defining_Project_Dependencies:_.depends_attributes https://wiki.qt.io/SUBDIRS_-_handling_dependencies#Defining_... I have qt kits to build for 4 different platforms and 3 different build toolchains. It was very easy to set up, and flipping between kits either in creator or in a terminal takes mere seconds. I have never experienced your 3rd point.
- wwright 7y agoThat allows you to support _some_ dependency ordering from the top level, but not internally. It is very coarse, and also suffers from “recursive Makefile” issues. It’s also less ergonomic: a developer can’t go into a specific sub folder and build ONLY that sub folder and its dependencies. If you change a library, it also can't reliably tell you which other binaries are its dependents. You have to let Make walk the full project tree. By “additional compilers,” I mean adding additional metacompilers, other languages, and so on. There is QMAKE_EXTRA_COMPILERS, but I can’t figure out how to get it to properly integrate with the dependency graph for the life of me. Have you ever had to resort to “make distclean” to get a clean compile?
- pidtuner 7y agoYou can use this Dockerfile to build Qt apps inside a container, which then can easily be integrated in any CI system: https://github.com/juangburgos/JenkinsCentOs7Docker/tree/master/qt5.13.2 https://github.com/juangburgos/JenkinsCentOs7Docker/tree/mas...