Bootstrap fails if Visual Studio 2019 isn't installed
It seems like this commit broke MSVC support if Visual Studio 2019 isn't installed, as it started using the vswhere.exe
switch -sort
which was only added to 2019. I only have 2015, and 2017 installed.
I fixed this for my purposes by removing the -sort
option, however to maintain functionality a sort of the json output might be in order.
This is the error I get after a fresh clone:
$ ./cerbero-uninstalled bootstrap
Loading default configuration from C:/MinGW/msys/1.0/home/User/.cerbero/cerbero.cbc
Traceback (most recent call last):
File "c:\devel\cerbero\cerbero\utils\shell.py", line 168, in check_output
o = subprocess.check_output(cmd, cwd=cmd_dir, env=env, stderr=stderr)
File "C:\Python37\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "C:\Python37\lib\subprocess.py", line 512, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe', '-legacy', '-prerelease', '-format', 'json', '-utf8', '-sort']' returned non-zero e
xit status 87.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\devel\cerbero\cerbero\utils\__init__.py", line 391, in parse_file
exec(compile(open(filename).read(), filename, 'exec'), dict)
File "c:/devel/cerbero/config/windows.config", line 131, in <module>
env, msvc_version = get_msvc_env(arch, target_arch, vs_install_version, vs_install_path)
File "c:\devel\cerbero\cerbero\ide\vs\env.py", line 202, in get_msvc_env
vcvarsall, vsver = get_vcvarsall(version, vs_install_path)
File "c:\devel\cerbero\cerbero\ide\vs\env.py", line 136, in get_vcvarsall
return _get_vswhere_vs_install(vswhere, vs_versions)
File "c:\devel\cerbero\cerbero\ide\vs\env.py", line 93, in _get_vswhere_vs_install
'json', '-utf8', '-sort'])
File "c:\devel\cerbero\cerbero\utils\shell.py", line 175, in check_output
raise CommandError(msg, cmd, getattr(e, 'returncode', -1))
cerbero.errors.CommandError: Command Error: Running ['C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe', '-legacy', '-prerelease', '-format', 'json', '-utf8', '-sort'] returned
87
b'Visual Studio Locator version 2.5.2+gebb9f26a3d [query version 1.17.1230.42073]\r\nCopyright (C) Microsoft Corporation. All rights reserved.\r\n\r\nError 0x57: Unknown parameter: sort\r\n'
Configuration Error: Could not include config file (c:/devel/cerbero/config/windows.config)
Perhaps @nirbheek can take a look.
Edited by Joshua M. Doe