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

better ux for VS not found error #15250

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion conan/tools/microsoft/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def _vcvars_path(version, vs_install_path):
# TODO: This comes from conans/client/tools/win.py vcvars_command()
vs_path = vs_install_path or vs_installation_path(version)
if not vs_path or not os.path.isdir(vs_path):
raise ConanException("VS non-existing installation: Visual Studio %s" % version)
raise ConanException(f"VS non-existing installation: Visual Studio {version}. "
"If using a non-default toolset from a VS IDE version consider "
"specifying it with the 'tools.microsoft.msbuild:vs_version' conf")

if int(version) > 14:
vcpath = os.path.join(vs_path, "VC/Auxiliary/Build/vcvarsall.bat")
Expand Down
2 changes: 1 addition & 1 deletion conans/model/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"tools.google.bazel:bazelrc_path": "List of paths to bazelrc files to be used as 'bazel --bazelrc=rcpath1 ... build'",
"tools.meson.mesontoolchain:backend": "Any Meson backend: ninja, vs, vs2010, vs2012, vs2013, vs2015, vs2017, vs2019, xcode",
"tools.meson.mesontoolchain:extra_machine_files": "List of paths for any additional native/cross file references to be appended to the existing Conan ones",
"tools.microsoft.msbuild:vs_version": "Defines the IDE version when using the new msvc compiler",
"tools.microsoft.msbuild:vs_version": "Defines the IDE version (15, 16, 17) when using the msvc compiler. Necessary if compiler.version specifies a toolset that is not the IDE default",
"tools.microsoft.msbuild:max_cpu_count": "Argument for the /m when running msvc to build parallel projects",
"tools.microsoft.msbuild:installation_path": "VS install path, to avoid auto-detect via vswhere, like C:/Program Files (x86)/Microsoft Visual Studio/2019/Community. Use empty string to disable",
"tools.microsoft.msbuilddeps:exclude_code_analysis": "Suppress MSBuild code analysis for patterns",
Expand Down