-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] How to define ABI compatibility for Visual Studio #3139
Comments
Hi @forry Thanks for your question. The path forward to 2.0 might depend on what you want to achieve. Conan 2.0 has some new capabilities like a better There is nothing bad in that, if that model is working fine for you, then I'd recommend to continue doing it. I'd say that the only change you need to do to your recipe is adding the Also, please note that So it could be something like this: def package_id(self):
v = Version(str(self.info.settings.compiler.version))
compiler = str(self.info.compiler)
toolset = str(self.info.settings.compiler.toolset)
if compiler == "Visual Studio" and (v >= "15" and v <= "17") and any((toolset == x for x in ["None", "", "v141", "v142", "v143"])):
self.info.settings.compiler.version = "15 compatible"
self.info.settings.compiler.toolset = "v141 compatible"
if compiler == "msvc" and (v>="191" and v <= "193"):
self.info.settings.compiler.version = "15 compatible" # you can use the same, whatever convention you like
self.info.settings.compiler.toolset = "v141 compatible" I have splitted into 2 Please try that and let us know. |
Thank you for your swift answer. It brings even more questions. The ones about the compatibility method and plugin I may open a new issue about it, but since there is a warning about it being a preview feature, I'm not very keen to try it out right now. But about the I'm sorry I haven't read the whole documentation yet but I wanted to start with a small recipe and work it out gradually. |
If you haven't please have a look at https://docs.conan.io/2/introduction.html#navigating-the-documentation
This is a chicken and egg problem, we don't make it stable because we are looking for users feedback first, but if we don't get users feedback, it is also very difficult to declare it stable
The
We are also starting to provide a experimental |
I have been looking at the things that you suggested. I've found in the package_id a thing that I've been looking for, which was that chapter about ABI compatibility that was in one place in the conan 1 doc. It would be great if the "chapters" were the same where it makes sense so that people can look them up through the same search query as they did in conan 1. Maybe it's just me but I have always found the doc to be difficult to navigate and not very intuitive. There seems to be an error in the code snippet or I am doing something wrong with my tests. It's the problem I had the first time. There is access to Also, it would be nice to run the doc through some kind of English grammar-checking tool or write it using one. |
Yes, it seems a bug in the docs. We will fix it to add the correct Regarding the documentation, the thing is that Conan 2.0 is a rewrite from scratch. We are not trying to do a parallelism, because we know it was a bit difficult to navigate. Now there is an important "tutorial" section, intended to be read as a hands-on, exercises and code included, and a more ordered reference. We will be completing things there, but it takes time. I am moving this to the docs repo to fix that. |
This PR #3140 will fix that, and close this issue. Is there any other question, or is it clear now with the fix to the docs? Thanks! |
Closed by #3140 |
No, thank you very much. My mistake was to assume that the release of 2.0 meant that the doc is complete and that I'd skipped most of the tutorial parts (to save time) to go to the things that I was interested in in the reference, since I knew the conan 1, or tried to find corresponding chapters to get a refresher. I need to backtrack a little and get a feel for it, then I will probably raise a new question/suggestion about the compatibility and its documentation unless I find it open. |
Good, thanks very much for the feedback! |
Quick one. Have you fixed the second one in the migration guide (https://docs.conan.io/1/migrating_to_2.0/recipes.html#migrate-conanfile-compatible-packages-to-the-new-compatibility-method) in the "To" section there seems to still be a |
What is your question?
Hello,
I'm considering migrating our repository to conan 2.0. We have lot's of packages with prebuilt binaries for Visual Studio. The recipes mostly only define one method telling that different compiler versions and toolsets are compatible so you can mix and match them. This yields a lot of combinations. The package binaries were loaded using
export-pkg
with the -pf argument so we don't have the binary duplication in the export folder.conan export-pkg . --user=user --channel=prebuild
the conan complains:ConanException: 'self.settings' access in 'package_id()' method is forbidden
. I have read about the compatibility() method but since I'm not a python programmer I don't quite understand if that applies to my case and if yes, how exactly I'm to generate the resulting super object for this case - all of the different combinations of compilers and toolsets.Here is the example conanfile.py:
Thanks
Forry
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: