question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[error] Error when calling conanfile.info.clone()

See original GitHub issue

I am trying to achieve VS downward compatibility by using the new feature in package info. I have the following method:

def enable_visual_studio_downward_compatibility(conanfile):
    if conanfile.settings.compiler == "Visual Studio" and conanfile.settings.compiler.version == "16":
        for version in ("15", "14"):
            compatible_pkg = conanfile.info.clone()
            compatible_pkg.settings.compiler.version = version
            conanfile.compatible_packages.append(compatible_pkg)
    if conanfile.settings.compiler == "Visual Studio" and conanfile.settings.compiler.version == "15":
        for version in ("14"):
            compatible_pkg = conanfile.info.clone()
            compatible_pkg.settings.compiler.version = version
            conanfile.compatible_packages.append(compatible_pkg)

And the package uses:

 def package_id(self):
   enable_visual_studio_downward_compatibility(self)

From my understanding and reading the documentation, this is the right way to enable compatibility. However, when a VS2019 consumer tries to consume a VS2015 package, I get the following error:

ERROR: package/version@user/stable: Error in package_id() method, line 53
        enable_visual_studio_downward_compatibility(self)
while calling 'enable_visual_studio_downward_compatibility', line 8
        compatible_pkg = conanfile.info.clone()
        ConanException: 'minor_mode' is not a known package_id_mode

Is this a bug or am I doing something wrong here? (I am using Conan 1.22.2)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
KerstinKellercommented, Mar 4, 2020

Yeah you are right, there was something wrong with the dependencies. I reinstalled the dev branch and that works fine now. Sorry about that.

1reaction
jgsogocommented, Mar 3, 2020

Much better, it will go for 1.22.3 😉

https://github.com/conan-io/conan/pull/6618

Read more comments on GitHub >

github_iconTop Results From Across the Web

Methods — conan 1.44.1 documentation
Using the self.copy() method, artifacts are copied from the build folder to the package folder. ... from conans import ConanFile from conans.errors import ......
Read more >
Use conanfile.py for consumers — conan 1.53.0 documentation
This simplifies the process and reduces the errors of mismatches between the installed packages and the current project configuration. Also, the conanbuildinfo.
Read more >
Methods — conan 1.14.5 documentation
Method used to retrieve the source code from any other external origin like github using $ git clone or just a regular download....
Read more >
Tools — conan 1.55.0 documentation
Returns the command to call devenv and msbuild to build a Visual Studio project. It's recommended to use it with tools.vcvars_command(), so that...
Read more >
Changelog — conan 1.36.0 documentation
Fix: Avoid breaking users calling forbidden private api conanfile. ... #8183; Bugfix: Fix errors when using conan info --paths and short_paths=True in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found