Skip to content

[bug] vcvars not called when using Visual Studio 17.10 + clang #16373

Closed
@sykhro

Description

@sykhro

Describe the bug

Windows 11
Visual Studio 17.10.1
Conan version 2.3.2

vcvars is not sourced correctly resulting in some libraries failing to build

How to reproduce it

I have a profile as follows:

[settings]
os=Windows
arch=x86_64
build_type=Debug

compiler=clang
compiler.version=17
compiler.runtime=dynamic
compiler.runtime_type=Debug
compiler.runtime_version=v143
 
[conf]
tools.cmake.cmaketoolchain:generator=Ninja Multi-Config

all recipes show the following:

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

and some decide to die right after (e.g. libjpeg-turbo)
I can see in the code that v143 is mapped to vcvars_ver=14.3:

vcvars_ver = {"v140": "14.0",
"v141": "14.1",
"v142": "14.2",
"v143": "14.3"}.get(toolset_version)

However, when using 17.10, the 14.3 tools are wiped by the VS installer. In light of this bug and work I've been doing lately around VS, I express desire for:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions