简体   繁体   中英

Build server / continuous integration recommendation for C++ / Qt-based projects

I'm looking to implement a build server for Qt-based C++ projects. The server needs to check out the necessary code / assets from Subversion, build the executable files, assemble the artifacts for installation projects, and build the installation media files. The target platforms and (rough) toolchains are:

  • Windows (32- and 64-bit): qmake, nmake, msbuild, wix toolchain. The end result is an installer EXE and DVD image.
  • Mac OS X: qmake, make, custom bash scripts to assemble package. The end result is an application bundle within a disk image and a DVD image.
  • Ubuntu (32- and 64-bit): qmake, make, debuild-based scripts. The end result is a collection of DEB files and a DVD image.
  • Fedora (32- and 64-bit): qmake, make, rpmbuild-based scripts. The end result is a collection of RPM files and a DVD image.

So that's at least 4 build agents (maybe more if 32- and 64-bit can't be done on the same box) and 7 configurations. Open-source projects are preferred, but that is not an absolute requirement.

Most of the tools I'm seeing seem to be catered to Java (Jenkins, CruiseControl, etc.) or .Net (CruiseControl.net, etc.) Can those be used with a C++ toolchain, or will I constantly be fighting the system? Anything that you have used in the past and found works well with Qt / C++?

I use Jenkins for building and packaging many C++ projects, based on qmake, cmake, and makefiles.

There are plugins for cmake, qmake, and msbuild, but any command line scripts can be run as well.

I have done packaging using Jenkins with no problems, as it is just another command line step in a project.

There are good plugins for monitoring the number of warnings/errors produced by the compiler (I normally use GCC).

It also has matrix builds which allow you to build a project several times with different combinations of compiler flags, pre-processor variables, platform, etc. One project I set up is a matrix build with 5 boolean preprocessor flags on two platforms, which then does 2^6=64 builds. These can take a bit of setting up to get correct.

Here you can read a quick example:

Continuous Integration Server - Hudson

I think that Hudson, jenkins and builbot are worth a try. Wasting a day or two evaluating and trying them with a quick example will help you to choose confidently.

Most of the tools I'm seeing seem to be catered to Java (Jenkins, CruiseControl, etc.) or .Net (CruiseControl.net, etc.) Can those be used with a C++ toolchain, or will I constantly be fighting the system? Anything that you have used in the past and found works well with Qt / C++?

Any reasonably capable CI system will have a piece that will allow you to execute any program you want for your build command.

Here's what I would consider:

  • Does the CI system run on your system(s) of choice
  • Does it allow you an easy way to view your logs
  • Does it integrate with your test runner
  • Does it integrate with your code coverage reports (eg BullseyeCoverage w/C++ & Qt)
  • Will it publish your files in a manner sensible for your needs
  • Will at provide an archive/store of files, if necessary (eg pdbs & lib*.so.debug)
  • If the CI system doesn't support feature X, will you have to write it for each supported OS/system
  • Is the CI system / UI easy for you to use.

I did the above using CruiseControl and most things were pretty easy. I wrote everything in make or qmake and simply called out to the command that I needed executed. For unit test and code coverage integration I output stuff to XML and transformed it to something supported by CruiseControl.

My recommendation, take a look at the recommended CI systems and examine them based on the criteria above.

I'm using buildbot for this. I've been using it for 4 years, and I feel very happy with it.

It is an application written in python, that runs on a server and can manage multiple clients on various OSes. I'm currently using Windows XP, Windows 7, Debian, Ubuntu and CentOS build slaves. My projects are C++, and one of them (the end user GUI) is made in Python. But we've also integrated with other frameworks, for other features than GUI.

What is really good about buildbot is that it works by running command lines on slaves. With this, you can do whatever you want. Even on Windows systems to compile using Visual Studio! From these command lines, you get all the output centralized on the server, and accessible.

You may also find alternatives on this site that references many of them. Disclaimer: I looked at it 3 years ago, I don't know if it is still accurate.

Jenkins is indeed pretty popular for developing such a custom service, even after all these years, considering the question is already 7 years old.

Felgo also offers a Continuous Integration and Delivery (CI/CD) service for Qt. It supports desktop platforms as well as iOS, Android and embedded targets. The full feature set is described in the blog post .

Disclaimer: I am a software developer at Felgo

哈德森或詹金斯非常好。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM