简体   繁体   English

C ++的持续集成服务器 - 库依赖性怎么样?

[英]Continuous Integration server for C++ - What about library dependencies?

I am currently researching a good setup for a continuous integration server which would build various C++ applications for several Linux distributions. 我目前正在研究一个连续集成服务器的良好设置,它将为几个Linux发行版构建各种C ++应用程序。

My primary question is how other users here have handled the differences in system libraries between Linux distributions? 我的主要问题是这里的其他用户如何处理Linux发行版之间系统库的差异?

While it might be relatively easy to build direct dependencies such as UI libraries along with an application, "indirect" dependencies such as glibc look like a big pain if they had to be built alongside the application every time. 虽然构建直接依赖项(如UI库和应用程序)可能相对容易,但如果必须每次都与应用程序一起构建glibc等“间接”依赖项,那么它们就会非常痛苦。 I am therefore thinking of moving the actual build execution into a separate virtual machine for each distribution, eg using rlogin to run the commands. 因此,我正在考虑将实际构建执行移动到每个分发的单独虚拟机中,例如使用rlogin来运行命令。 My goal is to prevent binary incompatibilities between build-machine library versions and those deployed in the target distributions. 我的目标是防止构建机器库版本与目标分发版本中部署的版本之间的二进制不兼容。

Does anyone here have any experience with such a process and could tell if the above sounds like a feasible approach? 这里有没有人有这样一个过程的经验,可以判断上述听起来是否像一个可行的方法?

We use Jenkins (Contiguous Integration) and CMake (build system) for this purpose. 为此,我们使用Jenkins (连续集成)和CMake (构建系统)。 Jenkins is similar to Buildbot, ie it also has buildmaster and buildslaves. Jenkins与Buildbot类似,即它也有buildmaster和buildslaves。 Currently I have setup 8 slaves to build for 4 different platforms (FC8, FC10, FC12 and Windows 7). 目前我已经为4个不同的平台(FC8,FC10,FC12和Windows 7)设置了8个从站。 We build both debug and release binaries, so I dedicated one slave for each platform and build type. 我们构建了调试和发布二进制文件,因此我为每个平台和构建类型专用了一个slave。

As for the third party libraries like Qt & Boost, I compiled them on each platform and checked them into a separate repository. 对于像Qt和Boost这样的第三方库,我在每个平台上编译它们并将它们检查到一个单独的存储库中。

@esavard: We use CMake 2.8 to do cross compilation, I have not used minigw but a quick google search indicates that it is possible. @esavard:我们使用CMake 2.8进行交叉编译,我没有使用minigw,但快速谷歌搜索表明它是可能的。 Here is a link to a tutorial to cross compile for Windows on Linux using CMake and miniGW. 以下是使用CMake和miniGW在Linux上交叉编译Windows的教程的链接

I have not used Buildbot and cannot comment on its features but thought I should mention an alternative that we are currently using. 我没有使用Buildbot,也无法对其功能发表评论,但我认为我应该提一下我们目前正在使用的替代方案。

Hope this helps. 希望这可以帮助。

Buildbot has the notion of buildmasters and buildslaves . Buildbotbuildmasters和buildslaves的概念。

A buildmaster takes care of displaying the web GUI, sending email, triggering builds, and other housekeeping. 构建管理员负责显示Web GUI,发送电子邮件,触发构建和其他内务管理。 The buildslaves wait on the buildmaster and when commanded perform builds. buildlaves在buildmaster上等待命令执行构建。

We have buildbot set up to build on a number of different platforms, some of them VMs, and it's working well for us. 我们已经建立了buildbot,可以在许多不同的平台上构建,其中一些是虚拟机,它对我们很有用。

Certainly buildbot and many virtual machines is the way to go with this. 当然buildbot和许多虚拟机是这样的。 We have VMWare ESX server hosting many build slaves which overnight compile our application. 我们有VMWare ESX服务器托管许多构建从属,可以在一夜之间编译我们的应用程序 The application is then tested on another virtual machine (not the build slave and just having a default OS install) to verify that it works and all dependency's are packaged. 然后,在另一个虚拟机(不是构建从属服务器,只是安装默认操作系统)上测试该应用程序,以验证它是否正常工作,并且所有依赖项都已打包。

The nice thing I would like to do is make the testing run time phase an automated step but I haven't been given the time to do that yet. 我想做的好事是让测试运行时阶段成为一个自动化步骤,但我还没有时间去做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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