-
Notifications
You must be signed in to change notification settings - Fork 989
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
[feature] tools.microsoft.msbuild:vs_version should be included in the default profile detect #14487
Comments
Hi @p-groarke Thanks for the suggestion. I'd like to clarify, just in case, that the default value for So I think defining this |
Hey @memsharded , yes that's exactly the use case I was discussing with Julius. We rarely run the same VS version as the target toolset version. On CI, it's always a more recent VS generating cached binaries to match a given ABI (ex, VS 2019 generating v142, v141, VS 2022 generating v143, v142, v141). On dev PCs, any VS version goes as long as its >= than the targeted toolset. It really doesn't matter what VS version you use, ABI wise only the toolset matters. By omitting this conf option from the detect profile, we can't automate this workflow. Configs we ship must only enforce toolsets (now Doing it this way (ala conan 1) decouples our recipes from VS versions. It allows multiple teams, multiple CI images, multiple configs to work without any intervention. Using the conan 2 way, we'll have to implement some sort of logic to detect the VS version. This logic will need to be duplicated in all scenarios where we use conan. It's a pain, for something that's already builtin conan and should work out-of-the box. Another way to think about this; conan 2 has it backwards. Detected profiles should probably only contain [edit] Unless I'm missing something of course :) |
Thanks for the feedback. I am afraid I might be missing something from the conversation you mention. If you rely on the automatically detected profile (something not recommended in the docs in https://docs.conan.io/2/knowledge/guidelines.html and https://docs.conan.io/2/introduction.html#stable), then the compiler version and the IDE version will match, it is not possible that they diverge (Unless you are installing a more modern VS IDE without the matching default compiler and only installing an older toolset in it, is that the use case?) I'll try to sync with @jcar87 to see what can I be missing from your conversation. In the meantime, I'd like to suggest a potential alternative way of thinking: devs can set |
Hi @p-groarke We are considering the following approach, which could provide both the desired behavior for your case and extended flexibility for other users as well:
In this way, you can define your profiles as:
Explicitly defining it. This can have some side advantages as well, for example, it keeps working when installing a new VS IDE version, automatically using the new IDE. It can also completely eliminate the need to As suggested above this approach could also work defining such value in the Please let me know what you think. |
Hey @memsharded , I'm off for vacation tackling the fishies 🎣 so my responses will be sparse. That sounds good :) Another thought I had : Lets say you only have 1 vs version installed, and we change Anyhow, good day |
Fantastic. We will start to move forward the implementation of this new api
Not sure what you mean here, could you please clarify? Thanks! |
Initial proposal to kick-off the technical and design discussions in #14578 |
Closed by #14578, it is now possible to do in profiles with jinja2 syntax:
|
@memsharded Wow that was a quick turnaround. Thank you so much! |
What is your suggestion?
In conan 2, the new way of selecting an msvc toolset ABI is through
compiler.version
. Selecting the "build" msvc version is managed through[conf] tools.microsoft.msbuild:vs_version
.This
tools.microsoft.msbuild:vs_version
setting should be initialized and defaulted when runningprofile detect
. It should be set at the same version ascompiler.version
by default. The "detected" visual studio, whatever the case may be.So for example, in a VS 2022 context, I would expect running a
conan profile detect
to contain both.This brings back feature parity with conan 1, it allows flexibility and an "out-of-the-box" conan experience. Where the detected host msvc version doesn't need to be set by the callee. This is important, as
vs_version
isn't something easily controlled. It isn't something that needs to be controlled either, only the toolset matters.[edit] This allows conan to run in multiple environments, not easily controlled (see, different teams, different products), all the while ensuring that as long as the selected toolset is installed, our recipes will work.
In addition, these are appropriate defaults. They do not change the current conan 2 behavior. Everything should work as before.
@jcar87 As per our discussion. Let me know if you need more details.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: