cmake-conan
cmake-conan copied to clipboard
CMake Error at conan.cmake:813 (message): Conan --version failed='2'
Hi, i have a C++ project and i am using conan for my external libraries (I use conan_cmake_install). When I build local, everything is working, but when I want to run the projects on my companies' Jenkins server, it runs first and fails when the project is build again during its packaging into a debian package.
(I want to make a note to my toolchain and clarify thinga:
The project is build on the Jenkins server, which works. After that, it is build again and packaged in a debian package with the command debuild for our customer, but I do not know how this works in detail.)
The full output including the error message is:
-- Conan: checking conan executable
-- Conan: Found program /usr/local/bin/conan
CMake Error at conan.cmake:813 (message):
Conan --version failed='2'
Call Stack (most recent call first):
conan.cmake:538 (conan_check)
CMakeLists.txt:165 (conan_cmake_install)
I took a look in the file conan.cmake and found the code block where the error is thrown and deleted it because this code does check the conan version, which is not really important for my program to run. But after that, I get a different error message, which is really confusing:
-- Conan: checking conan executable
-- Conan: Found program /usr/local/bin/conan
-- Conan executing: /usr/local/bin/conan install /home/jenkins/agent/workspace/ceDaemon_feature_including_conan/<this-is-a-secret>/conanfile_libs.txt --install-folder /home/jenkins/agent/workspace/ceDaemon_feature_including_conan/build/conan/libs --build missing --settings arch=x86_64 --settings compiler=gcc --settings compiler.version=7.5 --settings compiler.libcxx=libstdc++11 --settings build_type=Release --settings os.distro=ubuntu
ERROR: Can't write version file in '/.conan/version.txt': The folder /.conan does not exist and could not be created (Permission denied).
CMake Error at conan.cmake:638 (message):
Conan install failed='2'
Call Stack (most recent call first):
CMakeLists.txt:165 (conan_cmake_install)
I made sure that everyone has permissions for the .conan folder and its subfolder:
-rwxrwxrwx 1 1000 1000 0 Mar 3 09:49 artifacts.properties
-rwxrwxrwx 1 1000 1000 351649 Mar 3 09:49 cacert.pem
-rwxrwxrwx 1 1000 1000 4586 Mar 3 09:49 conan.conf
-rwxrwxrwx 1 1000 1000 216 Mar 3 09:49 config_install.json
drwxrwsrwx 8 1000 1000 4096 Mar 3 09:51 data
drwxrwsrwx 2 1000 1000 4096 Mar 3 09:49 hooks
drwxrwsrwx 2 1000 1000 4096 Mar 3 09:49 profiles
-rwxrwxrwx 1 1000 1000 284 Mar 3 09:49 remotes.json
-rwxrwxrwx 1 1000 1000 6616 Mar 3 09:49 settings.yml
-rwxrwxrwx 1 1000 1000 6 Mar 3 09:49 version.txt
So why do I have a permission problem and how do I solve it?
Hi @ano33, that could be a specific issue regarding your ci setup, I don't think that's related to cmake-conan.
Maybe you can try to specify a different CONAN_USER_HOME for your Jenkins builds, maybe in the Jenkins created workspace, you can set-up that folder using the CONAN_USER_HOME environment variable.