-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Building using Conan CMakePresets via Jenkins jobs in parallel #17992
Comments
Thanks for your question Let me try to see if I understood correctly:
Did I get the issue correctly? If this is the case, some quick questions/possible approaches:
|
Hi @memsharded thanks for your feedback!
Exactly!
The source code checkout is done in the Jenkins pipeline workspace, a Docker container with the necessary toolchains is executed by mounting the Jenkins workspace as a If we had to create a clean checkout in a workspace per target then we would have to launch as many Docker containers as targets, or serialize the builds. Or doing source checkouts inside the container instead of in the Jenkins workspace would imply that the container has credentials to access the repos, etc. We found this approach to be more appropriate because in practice the source code directory ( But I understand that Conan does it this way, and I understand that it is the only way because unfortunately, from what I have read, CMake does not allow you to indicate the path of the
Good question :) |
Yes, exactly, CMake mandates that the presets file is only besides the root
With a deployer or something like that? Yes, maybe everything, the From the Conan side what could be done and I think it is feasible and might make sense is that for every |
May be an idea to explore, but how you know if that include is "managed" by Conan or not to delete it if the path doesn't exist? Current:
Proposal:
Then for every |
The "vendor": {
"conan": {}
}, So we know it is managed by Conan, so we are free to modify, remove or whatever is necessary in that file. That is exactly the goal of that field, it shouldn't be necessary to redirect to other file. |
What is your question?
I'm having a problem with building multiple targets with Jenkins jobs in parallel using CMakePresets.
The source code is checkout once, and a build folder for each target job is created.
I had to create a
CONAN_HOME
folder per job since the Conan cache failed when trying multiple jobs using the same folder. But that's okay.The issue I'm having is with the root file
CMakePresets.json
which Conan adds as the preset's include path in this file.As there are several jobs, each one compiling a target, each one edits the CMakePresets.json adding the preset path.
But when the job ends and the build folder is deleted, CMakePresets.json becomes with a dangling path that the other build will give an error when invoking
cmake --preset android-release
saying that anotherpreset --linux-release
no longer exists.The pipeline is something like this:
The script
make_setup.sh
basically does something like this:Would it be possible for Conan to edit and CMake to use
CMakePresets.json
defined in a build directory instead of the source directory to avoid collision? I wanted to avoid having to do code checkouts or source copy to be able to launch compilation jobs for each target.I was able to reduce the occurrence of dangling paths in
CMakePresets.json
by deleting the file before invokingconan install ... & cmake --preset conan-xxx
.But even so, I've had problems with a job failing because it couldn't find the preset because it was deleted by another one:
I know it's a bit confusing, but any suggestions on how to implement parallel CI/CD pipeline Jenkins jobs with Conan and CMake Presets?
Thanks!
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: