conan: [bug] Conan 2.0 fails to find Visual Studio Build Tools using the 'MSBuildToolchain'
Environment details
- Operating System+version: Windows 10
- Compiler+version: msvc 2019 build tools
- Conan version: 2.0.0
- Python version: 3.9
Steps to reproduce
- Install the msvc 2019 build tools (a.k.a Visual Studio 16)
- In a recipe, use the generator ‘MSBuildToolchain’
- and build
It fails finding the Visual Studio 16 Build Tools installation with an error:
ERROR: Error in generator 'MSBuildToolchain': VS non-existing installation: Visual Studio 16
Note: I already tried to manually activate vcvars, but conan still does not find the installation.
Logs
======== Finalizing install (deploy, generators) ========
conanfile.py (qt/5.15.8): Writing generators to C:\src\qt-conan\5.x.x
conanfile.py (qt/5.15.8): Generator 'MSBuildToolchain' calling 'generate()'
conanfile.py (qt/5.15.8): MSBuildToolchain created conantoolchain_release_x64.props
conanfile.py (qt/5.15.8): MSBuildToolchain writing conantoolchain.props
conanfile.py (qt/5.15.8): ERROR: Traceback (most recent call last):
File "c:\local\miniforge3\lib\site-packages\conans\client\generators\__init__.py", line 70, in write_generators
generator.generate()
File "c:\local\miniforge3\lib\site-packages\conan\tools\microsoft\toolchain.py", line 104, in generate
VCVars(self._conanfile).generate()
File "c:\local\miniforge3\lib\site-packages\conan\tools\microsoft\visual.py", line 139, in generate
vcvars = vcvars_command(vs_version, architecture=vcvarsarch, platform_type=None,
File "c:\local\miniforge3\lib\site-packages\conan\tools\microsoft\visual.py", line 216, in vcvars_command
cmd.append('call "%s" ' % _vcvars_path(version, vs_install_path))
File "c:\local\miniforge3\lib\site-packages\conan\tools\microsoft\visual.py", line 232, in _vcvars_path
raise ConanException("VS non-existing installation: Visual Studio %s" % version)
conans.errors.ConanException: VS non-existing installation: Visual Studio 16
ERROR: Error in generator 'MSBuildToolchain': VS non-existing installation: Visual Studio 16
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 25 (25 by maintainers)
Commits related to this issue
- Fixed parsing the output of vswhere The output of vswhere uses "Ansi" encoding. It was though decoded via "Utf-8", which raised an exception in certain cases (i.e. letters like 'ö'). Thus, some visu... — committed to rainman110/conan by rainman110 a year ago
- Fixed parsing the output of vswhere The output of vswhere uses "Ansi" encoding. It was though decoded via "Utf-8", which raised an exception in certain cases (i.e. letters like 'ö'). Thus, some visu... — committed to rainman110/conan by rainman110 a year ago
- Fixed parsing the output of vswhere The output of vswhere normally uses "Ansi" encoding. It was though decoded via "Utf-8", which raised an exception in certain cases (i.e. letters like 'ö'). This c... — committed to rainman110/conan by rainman110 a year ago
- Fixed parsing the output of vswhere (#13284) The output of vswhere normally uses "Ansi" encoding. It was though decoded via "Utf-8", which raised an exception in certain cases (i.e. letters like 'ö... — committed to conan-io/conan by rainman110 a year ago
If you want, I’ll provide a PR, including a potential fix