CONAN_V2_MODE

This environment variable activates some behaviors and defaults that are intended to be in the next major release, Conan 2.0. It also turns into errors things that are already deprecated in Conan 1.x.

The objective is to try to minimize the impact on existing recipes when Conan 2.0 will be available and to start gathering feedback about the new configuration and behavior. This does not resemble the full behavior that Conan 2.0 will bring. The v2 mode is a work-in-progress, it is highly experimental and there is no commitment for stability here, but we expect that users with this mode activated will help us to shape the future version of Conan while we keep evolving the Conan 1.x series.

So, if you are ready to experiment add the variable CONAN_V2_MODE to your environment and, please, report your feedback about it.

Warning

Do not activate this mode in a production environment! Even if everything seems to work fine, package ID might change, revisions will be different and the ABI could be incompatible.

Changes in recipes

These changes could break existing recipes:

  • Forbid access to self.cpp_info in conanfile::package_id() method.

  • Deprecate conanfile::config() method.

  • Deprecate old python_requires syntax.

  • Forbid access to self.info in conanfile.package().

  • default_options are required to be a dictionary.

  • Raise if setting cppstd appears in the recipe.

  • Forbid self.settings and self.options in conanfile::source() method.

  • Deprecate tools.msvc_build_command.

  • Deprecate tools.build_sln_command.

  • Deprecate cpp_info.cppflags (use cxxflags instead).

  • Deprecate environment variables CONAN_USERNAME and CONAN_CHANNEL.

  • PYTHONPATH is not added automatically to the environment before running consumer functions.

  • Attribute self.version is ensured to be a string in all the functions and scenarios.

  • Access to member name in deps_cpp_info objects is forbidden, use get_name(<generator>) with the name of the generator.

Changes in profiles

Could break existing profiles:

  • Deprecate scopes section in profiles.

Other changes

  • Package name used by the pkg_config generator uses the same rules as any other generator. Previously, if it was not explicit, it was using lowercase cpp_info.name when it was different from the package name.

  • If build_type or compiler are not defined when using build helpers Conan will raise an error.

  • New compiler detection algorithm is used (e.g. when running conan profile new <name> --detect). Previously, <compiler> --version was parsed to detect the compiler and its version. Now, using CONAN_V2_MODE, Conan will try to detect the compiler and its version via compiler’s built-in macro definitions.

Note

More changes will be added, some of them could be reverted and the behavior may change without further noticing. If you are using CONAN_V2_MODE, thanks! We really appreciate your feedback about the future of Conan.