Adapt to Conan 2.0 - Fix conan create
Summary
After updating conanfile.py and CMakeLists.txt for Conan 2.0, the conan create
command fails with
CMake Warning:
Ignoring extra path from command line:
"/home/joscha/.conan2/p/b/caosd7b1e9937e9170/b"
CMake Error: The source directory "/home/joscha/.conan2/p/b/caosd7b1e9937e9170/b" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
caosdb/0.3.0-dev: ERROR:
Package 'aa906c6430e0c7a2ec8dc2a192d14ef64e9cc5f5' build failed
caosdb/0.3.0-dev: WARN: Build folder /home/joscha/.conan2/p/b/caosd7b1e9937e9170/b/build/Release
ERROR: caosdb/0.3.0-dev: Error in build() method, line 71
cmake.configure()
ConanException: Error 1 while executing
So, something isn't right and needs to be fixed to get deployment (and integration tests) running again.
======== Exporting recipe to the cache ========
caosdb/0.3.0-dev: Exporting package recipe: /home/joscha/caosdb/src/caosdb-cpplib/conanfile.py
caosdb/0.3.0-dev: Copied 272 '.cmake' files
caosdb/0.3.0-dev: Copied 9 '.txt' files
caosdb/0.3.0-dev: Copied 22 '.md' files
caosdb/0.3.0-dev: Copied 1 '.py' file: conanfile.py
caosdb/0.3.0-dev: Copied 12 '.in' files
caosdb/0.3.0-dev: Copied 3 '.c' files: CMakeCCompilerId.c, CMakeCCompilerId.c, ccaosdbcli.c
caosdb/0.3.0-dev: Copied 39 '.cpp' files
caosdb/0.3.0-dev: Copied 44 '.h' files
caosdb/0.3.0-dev: Copied 5 '.rst' files
caosdb/0.3.0-dev: Copied 3 '.proto' files: main.proto, main.proto, main.proto
caosdb/0.3.0-dev: Exported to cache folder: /home/joscha/.conan2/p/caosddd90e29f03b94/e
caosdb/0.3.0-dev: Exported: caosdb/0.3.0-dev#defef7b332201ec01c3c366873a37d1b (2024-06-18 19:49:46 UTC)
======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux
======== Computing dependency graph ========
Graph root
cli
Requirements
abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02 - Cache
boost/1.78.0#76ab0d03d2bab6a37a393e76b96de1fe - Cache
bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
c-ares/1.19.1#02ac853d7b96c7e631cc12bb373e6b42 - Cache
caosdb/0.3.0-dev#defef7b332201ec01c3c366873a37d1b - Cache
grpc/1.48.4#15c547df10da0106c8f0e11caae69da2 - Cache
libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c - Cache
openssl/1.1.1s#3eeebc156917046ee80533dbbb8f4671 - Cache
protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73 - Cache
re2/20230301#4482314b6488e5d71e9944f5bedb730d - Cache
zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Test requirements
gtest/1.11.0#d99d2af6a53ab52d3c2dd88cdbc1e0fd - Cache
Build requirements
b2/4.10.1#a41eecb267963ddf518e3c177eae60e1 - Cache
boost/1.78.0#76ab0d03d2bab6a37a393e76b96de1fe - Cache
bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
cmake/3.29.3#292a699b66d006bf4c6648608fa7c9e4 - Cache
libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c - Cache
protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73 - Cache
zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Resolved version ranges
cmake/[>=3.13]: cmake/3.29.3
openssl/[>=1.1 <4]: openssl/1.1.1s
zlib/[>=1.2.11 <2]: zlib/1.3.1
======== Computing necessary packages ========
caosdb/0.3.0-dev: Forced build from source
Requirements
abseil/20230125.3#a402cb19abb5639d7aef2ecdf48d2f02:838c313f1b7acdfd23b222f0156e7c264dcc2515#0c144bd0071c1693b119146139dc0bf4 - Cache
boost/1.78.0#76ab0d03d2bab6a37a393e76b96de1fe:60855651246b304608632317bb2e82001cac054b#5e2f9e32b77329184ef1e15920a6d7b6 - Cache
bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4:432d7695adc526147073285e155d2ca0340bc76d#16e43ebd4f4741fb4309823a5faa38cc - Cache
c-ares/1.19.1#02ac853d7b96c7e631cc12bb373e6b42:7494606b7156a5838c6e9cf6f1b4434683f651b0#5c77b7022fffea5ee0d22504fb9836a2 - Cache
caosdb/0.3.0-dev#defef7b332201ec01c3c366873a37d1b:aa906c6430e0c7a2ec8dc2a192d14ef64e9cc5f5 - Build
grpc/1.48.4#15c547df10da0106c8f0e11caae69da2:6456c44e98213634b33fd17e11117a3dc5d49138#2c5edc2707b82ea7216cf31fd8307d10 - Cache
libbacktrace/cci.20210118#ec1aa63bbc10145c6a299e68e711670c:c81087b06d1a5beef0ad711fc32d45f7a425a8f3#5820fde7a501215e1dfe68298b0f7ead - Cache
openssl/1.1.1s#3eeebc156917046ee80533dbbb8f4671:b469f21fcc058ee35f066fed6f93fcff17a9b73a#d7444b0da7c220b29ce0ee15b21dcc9f - Cache
protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73:c42f1248a3b63be5afcfa96cd3eae924f6154d21#03e364e04e5922d6896ec9df1823f1bb - Cache
re2/20230301#4482314b6488e5d71e9944f5bedb730d:d82d61b049c28e3ef95ee28911620ac73218b75e#76ba1bcb109c071be79958157beca14c - Cache
zlib/1.3.1#f52e03ae3d251dec704634230cd806a2:c81087b06d1a5beef0ad711fc32d45f7a425a8f3#5b436af687dbefff994902196826d59f - Cache
Test requirements
gtest/1.11.0#d99d2af6a53ab52d3c2dd88cdbc1e0fd:2a9132e602cc3a13b45a057dee362c74bdc31369#03dd70eab9e00b03634462e42236ab47 - Cache
Build requirements
boost/1.78.0#76ab0d03d2bab6a37a393e76b96de1fe:36249c6da61cbf6ab71af18626febe740309df78#c44c7fec10a21466012af0c575868021 - Cache
cmake/3.29.3#292a699b66d006bf4c6648608fa7c9e4:63fead0844576fc02943e16909f08fcdddd6f44b#cd1f05e22b6797ef13dd59b74c709699 - Cache
protobuf/3.21.12#2070373d5f1a2606a4491faef9315a73:c42f1248a3b63be5afcfa96cd3eae924f6154d21#03e364e04e5922d6896ec9df1823f1bb - Cache
Skipped binaries
b2/4.10.1, bzip2/1.0.8, libbacktrace/cci.20210118, zlib/1.3.1
======== Installing packages ========
abseil/20230125.3: Already installed! (1 of 14)
bzip2/1.0.8: Already installed! (2 of 14)
c-ares/1.19.1: Already installed! (3 of 14)
cmake/3.29.3: Already installed! (4 of 14)
cmake/3.29.3: Appending PATH environment variable: /home/joscha/.conan2/p/cmakee640aa79d28bd/p/bin
gtest/1.11.0: Already installed! (5 of 14)
libbacktrace/cci.20210118: Already installed! (6 of 14)
openssl/1.1.1s: Already installed! (7 of 14)
re2/20230301: Already installed! (8 of 14)
zlib/1.3.1: Already installed! (9 of 14)
boost/1.78.0: Already installed! (10 of 14)
boost/1.78.0: Already installed! (11 of 14)
protobuf/3.21.12: Already installed! (12 of 14)
grpc/1.48.4: Already installed! (13 of 14)
-------- Installing package caosdb/0.3.0-dev (14 of 14) --------
caosdb/0.3.0-dev: Building from source
caosdb/0.3.0-dev: Package caosdb/0.3.0-dev:aa906c6430e0c7a2ec8dc2a192d14ef64e9cc5f5
caosdb/0.3.0-dev: Copying sources to build folder
caosdb/0.3.0-dev: Building your package in /home/joscha/.conan2/p/b/caosd7b1e9937e9170/b
caosdb/0.3.0-dev: Calling generate()
caosdb/0.3.0-dev: Generators folder: /home/joscha/.conan2/p/b/caosd7b1e9937e9170/b/build/Release/generators
caosdb/0.3.0-dev: CMakeToolchain generated: conan_toolchain.cmake
caosdb/0.3.0-dev: CMakeToolchain generated: /home/joscha/.conan2/p/b/caosd7b1e9937e9170/b/build/Release/generators/CMakePresets.json
caosdb/0.3.0-dev: CMakeDeps necessary find_package() and targets for your CMakeLists.txt
find_package(gRPC)
find_package(protobuf)
find_package(Boost)
find_package(GTest)
target_link_libraries(... grpc::grpc protobuf::protobuf boost::boost gtest::gtest)
caosdb/0.3.0-dev: Generating aggregated env files
caosdb/0.3.0-dev: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
caosdb/0.3.0-dev: Calling build()
caosdb/0.3.0-dev: Running CMake.configure()
caosdb/0.3.0-dev: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/joscha/.conan2/p/b/caosd7b1e9937e9170/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/joscha/.conan2/p/b/caosd7b1e9937e9170/b"
CMake Warning:
Ignoring extra path from command line:
"/home/joscha/.conan2/p/b/caosd7b1e9937e9170/b"
CMake Error: The source directory "/home/joscha/.conan2/p/b/caosd7b1e9937e9170/b" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
caosdb/0.3.0-dev: ERROR:
Package 'aa906c6430e0c7a2ec8dc2a192d14ef64e9cc5f5' build failed
caosdb/0.3.0-dev: WARN: Build folder /home/joscha/.conan2/p/b/caosd7b1e9937e9170/b/build/Release
ERROR: caosdb/0.3.0-dev: Error in build() method, line 71
cmake.configure()
ConanException: Error 1 while executing
Actual Behavior
Deployment using conan create should work.
Steps to Reproduce the Problem
Please describe, step by step, how others can reproduce the problem. Please try these steps for yourself on a clean system.
conan create .
Specifications
- Version: 0.3 dev with conan 2.0
Possible fixes
Check the migration guide...
Edited by Joscha Schmiedt