Skip to content
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

[bug] Installation of Visual Studio 2022 Preview breaks VCVars generator #16239

Closed
rconde01 opened this issue May 11, 2024 · 9 comments · Fixed by #15588
Closed

[bug] Installation of Visual Studio 2022 Preview breaks VCVars generator #16239

rconde01 opened this issue May 11, 2024 · 9 comments · Fixed by #15588
Assignees
Milestone

Comments

@rconde01
Copy link

Describe the bug

Windows 11
Visual Studio 2022
Conan 2.3

How to reproduce it

  1. Install both Visual Studio 2022 and Visual Studio 2022 Preview
  2. Attempt to build a recipe using VCVars generator
  3. It seems to detect the preview version which had toolset 14.4 and reports
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3
[ERROR:vcvars.bat] Toolset directory for version '14.3' was not found.
@memsharded memsharded self-assigned this May 12, 2024
@memsharded
Copy link
Member

memsharded commented May 12, 2024

Hi @rconde01

I think this is the result of the breaking change that Microsoft did to the MSVC versioning: https://devblogs.microsoft.com/cppblog/msvc-toolset-minor-version-number-14-40-in-vs-2022-v17-10/

This should be fixed in #15588, which is intended for the next Conan 2.3.1 soon. It would be great if you can run it from source and test if it is looking good.

@memsharded
Copy link
Member

This should be closed in #15588 for 2.3.1

@FTamas77
Copy link

I have the same problem.

conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.3
[ERROR:vcvars.bat] Toolset directory for version '14.3' was not found.
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
[ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
[ERROR:VsDevCmd.bat] Where [value] is:
[ERROR:VsDevCmd.bat]    1 : basic debug logging
[ERROR:VsDevCmd.bat]    2 : detailed debug logging
[ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
[ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1

boost/1.81.0: ERROR:
Package 'f1ebb80658fd9c40ef10124242805f23dc9e84f0' build failed
boost/1.81.0: WARN: Build folder D:\conan_data\b\boostfac104765e9be\b\build-debug
ERROR: boost/1.81.0: Error in build() method, line 1130
        self.run(full_command)
        ConanException: Error 1 while executing

Now, I've only Visual Studio 2022 and Conan 2.4.1

Could you help me what I can do here?

@memsharded
Copy link
Member

@FTamas77 this could be a different issue.

The boost package itself hasn't updated yet to use the latest b2 build system, which is necessary to handle the latest VS 17.10 update.

Please report a new ticket, first reporting:

  • Your full profile (probably is outdated)
  • How it works with the default conan new cmake_lib template
  • Finally, if it fails for boost, try injecting via a profile with:
[tool_requires]
b2/5.2.0

That might solve the boost building issue (there is already a fix for that in the boost recipe, will hopefully be merged soon)

@rollastre
Copy link

rollastre commented Jul 9, 2024

I am facing the same problem and I could workaround this by building this in a machine that did not yet update Visual Studio. So, yes. I verify this is the reason. However, as you mention, the boost recipe is still broken. So here I ask the question. What should be done there in the boost recipe to fix this? If you explain me, I can try to foster this change myself.

Thanks in advance for the support.

@memsharded
Copy link
Member

However, as you mention, the boost recipe is still broken. So here I ask the question. What should be done there in the boost recipe to fix this? If you explain me, I can try to foster this change myself.

The boost recipe was fixed already. Making sure to clean the cache with conan remove boost*, conan remove b2* just in case, or maybe just by trying conan install ... --update will force the update and it should work.

If it doesn't work, it might be a different issue, and it would be better to do a new ticket with further details to reproduce.

@rollastre
Copy link

rollastre commented Jul 9, 2024

I can confirm that running conan remove boost*, conan remove b2* and conan install . --update doesn't fix it. After several attempts, I decided to delete the profiles/default file and call conan profile detect default. The resulting file differs only in compiler.version=194 vs the old compiler.version=193. Doing this, the boost build went through. Can't really tell if this is something that works as expected or the recipe should also somehow handle the 193 value for the compiler.version setting. But this is so far all I could find out.

By the way, it is boost 1.71.0 recipe the one I am always talking about.

@memsharded
Copy link
Member

Doing this, the boost build went through. Can't really tell if this is something that works as expected or the recipe should also somehow handle the 193 value for the compiler.version setting. But this is so far all I could find out.

Yes, the new VS 17.10 update for VS 2022 defines 14.4 toolset version and 194X as new compiler versions, it is totally expected and necessary to have conan profile define compiler.version=194 to match the VS 17.10 update.

@rconde01
Copy link
Author

rconde01 commented Jul 9, 2024

Just as an FYI, altenatively you can install the 17.39 toolset via the visual studio installer and then use 17.10 + v193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants