Conan migration guide to 2.0¶
Conan 2.0 is already released, you can install the latest Conan version from PyPI doing:
$ pip install conan
If you want to migrate to 2.0, there are several things you will need to change:
- The recipes have to be updated to be compatible with Conan 2.0. There are 2.0 features ported to Conan 1.X so you can get a compatible recipe with 2.0 using Conan 1.X.
- The conan commands have also changed, but there are no “compatible” commands introduced in Conan 1.X. We will review the more relevant changes.
- General changes not related to the recipes nor the Conan commands, “build profiles”, lowercase references… etc.
There are already lots of recipes prepared for v2, some of them with generated binaries, in ConanCenter, follow the Conan 2.0 and ConanCenter Support thread for more information.
- Migrating the recipes
- Python import statements
- The validate() method
- The layout() method
- The scm attribute
- The export_sources() method
- The generate() method
- The build() method
- The package() method
- The package_info() method
- The package_id() method
- Removed imports() method
- Migrate conanfile.compatible_packages to the new compatibility() method
- Changes in the test_package recipe
- Other recipe changes
- Migrating legacy cpp_info attributes to set_property()
- General changes