[Development] Unity Build on CI for Qt Base for 3 Platforms

Volker Hilsheimer volker.hilsheimer at qt.io
Mon Jun 26 22:14:45 CEST 2023


On 26 Jun 2023, at 09:39, EXT Amir Abdol via Development <development at qt-project.org> wrote:


Hi,

Unity Build is now enabled on CI for Qt Base, on dev branch, for the following platforms: INTEGRITY, Windows 10 MinGW, Windows 11 MinGW, which are among the slowest platforms on our CI.

Here is a brief note about the unity build, and what you should expect:

  *   Unity build achieves a faster build by pooling several source files into one translation unit and compiling that instead of individually compiling every source file. This means the build is especially susceptible to duplicate symbol collision. If you notice such instances,
     *   Try resolving the issue, as it is often achievable in a reasonable timeframe. If not,
     *   You can exclude the file from the unity build, by adding it to NO_UNITY_BUILD_SOURCES, which is available in most of our qt_internal_* CMake APIs, e.g., qt_internal_add_tool. When doing so, please leave a brief comment and/or TODO on why/how to resolve the issue.
     *   If an entire target is troublesome, and resolving the issue needs major work, you can exclude it from the unity build by passing NO_UNITY_BUILDto the respective qt_internal_* call.
  *   You can enable the unity build locally by passing -unity-build and -unity-build-batch-size to configure, or use -DQT_UNITY_BUILDif you are using CMake. Default batch size is 32.
  *   We have tested the build with batch size of 32. Changing the batch size may result in undiscovered symbol collisions, or other issues.
  *   Tests and examples are not being built using unity build at the moment.

While at the moment, we are only partially enabling the unity build for Qt Base on CI, the build should be successful on other platforms as well. Other Qt modules can be built with unity build as well, with varying degrees of success. Please give it a try, and let us know if you ran into issues, either by opening a bug report, or submitting a patch!

P.S. Unity build for Qt was initially discussed here: https://lists.qt-project.org/pipermail/development/2023-January/043518.html.

Best,

Amir

Very nice, thanks a lot!

Cheers,
Volker


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230626/2ace0172/attachment-0001.htm>


More information about the Development mailing list