-
Notifications
You must be signed in to change notification settings - Fork 2k
libsodium: conan2 compatibility with msvc #14959
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
Conversation
This comment has been minimized.
This comment has been minimized.
recipes/libsodium/all/conanfile.py
Outdated
def _msvc_sln_folder(self): | ||
if self.settings.compiler == "Visual Studio": | ||
if self.settings.compiler == "msvc": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this works because this function is never called with mac/linux compilers 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right 🙃
@@ -118,7 +108,13 @@ def source(self): | |||
|
|||
@property | |||
def _msvc_sln_folder(self): | |||
if self.settings.compiler == "Visual Studio": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess str(self.settings.compiler) == "Visual Studio"
would also work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are other checks like that afterwards, so it requires more modifications in this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace by something like this:
@property
def _msvc_sln_folder(self):
sln_folders = {
"Visual Studio": {
"10": "vs2010",
"11": "vs2012",
"12": "vs2013",
"14": "vs2015",
"15": "vs2017",
"16": "vs2019",
},
"msvc": {
"170": "vs2012",
"180": "vs2013",
"190": "vs2015",
"191": "vs2017",
"192": "vs2019",
}
}
if self.version != "1.0.18":
sln_folders["Visual Studio"]["17"] = "vs2022"
sln_folders["msvc"]["193"] = "vs2022"
backup_folder = "vs2022" if self.version != "1.0.18" else "vs2019"
return sln_folders.get(str(self.settings.compiler), {}).get(str(self.settings.compiler.version), backup_folder)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely right, I did this quickly and didn't check it further. Thank you for the code suggestion
Co-authored-by: Chris Mc <[email protected]>
This recipe has many issues in its Visual Studio branch anyway since its migration to conan v2, it needs far more love or improvement in MSBuild helper from conan client. |
Conan v1 pipelineAll green in build 6 (
Conan v2 pipeline (informative, not required for merge)Failure in build 6 (
Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability. |
I detected other pull requests that are modifying libsodium/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
I've submitted another PR with more fixes: #14998 |
closing this one then, as #14998 already contained this fix. Thank you! |
A small detail to make the recipe fully compatible as the comparison
if self.settings.compiler == "Visual Studio"
is not allowed on conan 2 because "Visual Studio" is not among the valid values for settings