[error] Error when calling conanfile.info.clone()
See original GitHub issueI 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:
- Created 4 years ago
- Comments:12 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah you are right, there was something wrong with the dependencies. I reinstalled the dev branch and that works fine now. Sorry about that.
Much better, it will go for 1.22.3 😉
https://github.com/conan-io/conan/pull/6618