CMake Port/Enabling repo in the CI
Here are the steps to enable a new repository's CMake port in the CI / Coin.
I'll use qtopcua as an example.
Prerequisites: Have the CMake port merged to the dev branch (so all the CMakeLists.txt files). Some guidance on how to get that done can be found at Porting Guide
Gerrit Steps:
- Copy qtsvg/coin folder (dev branch) into under qtopcua/coin. That folder should have a module_config.yaml file. This file is used to tell Coin how to configure and build your module.
- Commit and push that as a new change to Gerrit to the dev branch (here's a sample change like that https://codereview.qt-project.org/c/qt/qtopcua/+/303007/4/coin/module_config.yaml )
- Checkout a copy of the qt5.git dev branch, go into the coin/platform_configs folder, make a copy of qtsvg.yaml and rename it to qtopcua.yaml. This file is used by Coin to know what platforms to build and test, and what configure arguments to pass.
- Commit and push that file as new change to Gerrit. (Here's a sample change like that https://codereview.qt-project.org/c/qt/qt5/+/302955/2/coin/platform_configs/qtopcua.yaml)
Now, if you do not have Qt Company internal VPN access, ask somebody on #qt-cmake Libre.Chat to schedule a test build using those 2 changes as the references.
If you have access to the VPN in order to schedule a test CMake build, do the following steps:
Coin test steps:
- Connect to full VPN
- Go to Coin's internal webpage
- Choose Schedule build in the top-right menu
- Copy the qtopcua Gerrit change URL you pushed in step 1 and paste it into the URL field and press Resolve. Wait for it to resolve, it can take a while if the CI is overloaded with work.
- Go to the gerrit qt5 change you pushed (e.g. https://codereview.qt-project.org/c/qt/qt5/+/302955) copy the SHA1 of the change using the Web UI
- Switch back to the Coin schedule build page, paste the copied sha1 into the "Product ref" field
- Check the "Post comment on Gerrit" and the "Do not abort integration on failure" checkmarks, and uncheck "Abort testing on first failure" checkmark
- Press List configurations
- You should have some CMake configurations appear under the qmake ones.
- Either checkmark only the CMake configurations and then press "Build and test on these configurations" or press "Run all configurations"
- Coin should start the job, and post a message with success or errors to the qtopcua gerrit change that you pushed
Once you've confirmed that all CMake configurations build and pass all tests (check the logs of each test config to be sure), you can first stage the qtopcua change. Once that's merged, stage the qt5.git change you created.
dependencies.yaml
A bit unrelated, but also related to working in the dev branch.
If your module is not part of qt5.git (like qtopcua), you will most likely want to use a dependencies.yaml file to specify what modules you depend on, instead of depending on the whole of qt5.git.
This way you explicitly specify a list of sha1s that you know that your module builds with.
An example can be found here https://codereview.qt-project.org/c/qt/qtopcua/+/302962
For now, you will have to manually update the file whenever you want to use a newer qtbase, etc.