Conan: [bug] Breaking change with CMakeToolchain

Created on 10 Dec 2020  路  7Comments  路  Source: conan-io/conan


We are using conan since 2 years and since ~1.5 years we have a custom cmake toolchain generator for our cross builds to arm-none-eabi. Unfortunately, we named the generator CMakeToolchain. Now there is a naming collision.

Environment Details (include every applicable attribute)

  • Operating System+version: Linux
  • Compiler+version: GCC 9.3 + GCC-arm-none-eabi
  • Conan version: 1.32
  • Python version: 3.6

Steps to reproduce (Include if Applicable)

Create a custom generator called CMakeToolchain and add as required dependency to a conan file.

   requires = "CMakeToolchainGenerator/0.0.1@.....", "...other..."
    generators = "cmake", "CMakeToolchain" # <-Was your generator!

If we now call conan create with a cross-toolchain, the build fails because the "CMakeToolchain" generator is now the conan build in and not our anymore.

Logs (Executed commands with output) (Include/Attach if Applicable)

Conan 1.27 output:

conanfile.py (....): Generator cmake created conanbuildinfo.cmake
conanfile.py (....): Generator CMakeToolchain created conan_toolchain.cmake <-- Our generator.
conanfile.py (....): Generator txt created conanbuildinfo.txt

Conan 1.32 output:

conanfile.py (....): Generator cmake created conanbuildinfo.cmake
conanfile.py (....): Generator 'CMakeToolchain' calling 'generate()' <-- Conans generator.
conanfile.py (....): Generator txt created conanbuildinfo.txt
triaging bug

All 7 comments

Proposing a solution in https://github.com/conan-io/conan/pull/8183.

We will also change for Conan 2.0 the way user custom generators are instantiated, to avoid these issues, and make it more explicit. How are you using it? As a regular require? In the new cache/generators global folder?

In any case, I would recommend to try to use custom names for your custom generators, better MyCompanyCMakeToolchain than the generic one, as it is more evident and meaningful for recipe readers that this is a custom helper and not a Conan built-in one.

Thank you for the hotfix!

Yes. We will definitely migrate in the midterm, but not immediately.

Fixed by https://github.com/conan-io/conan/pull/8183, will be released in Conan 1.32.1 soon

@memsharded Would be create to get a new version asap - many of our PRs standing still because of this issue. We want to use new features from v1.3x.

Hi @Viatorus, we are releasing 1.32.1 in a couple of hours if no further problems arise, as soon as the ci passes
I'll ping you when it's released :)

Hi @Viatorus, Conan 1.32.1 has just been released!

Thank you very much! :man_dancing:

Was this page helpful?
0 / 5 - 0 ratings