[Scons-users] parsing empty C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe output

KANNEGIESER Veit (MM) veit.kannegieser at magnetimarelli.com
Fri Feb 8 10:14:39 EST 2019


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256


Hello

after an today update 3.0.1 -> 3.0.4 using pip
and python 3.7.1 on windows,

D:\ccm_wa\mlb\MLB-Veit4\MLB\BLF\MLB_BTS>"C:\Program
Files\Python37\Scripts\scons.bat" >111
IndexError: list index out of range:
  File "D:\ccm_wa\mlb\MLB-Veit4\MLB\BLF\MLB_BTS\SConstruct", line 59:
    Export('top_level')
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Script\SConscript.py",
line 665:
    env = self.factory()
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Script\SConscript.py",
line 645:
    default_env = SCons.Defaults.DefaultEnvironment()
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Defaults.py", line 88:
    _default_env = SCons.Environment.Environment(*args, **kw)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Environment.py", line 982:
    apply_tools(self, tools, toolpath)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Environment.py", line 107:
    env.Tool(tool)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Environment.py", line 1789:
    tool(self)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 296:
    self.generate(env, *args, **kw)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\default.py", line 40:
    for t in SCons.Tool.tool_list(env['PLATFORM'], env):
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 1266:
    c_compiler = FindTool(c_compilers, env) or c_compilers[0]
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 1169:
    if t.exists(env):
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\msvc.py", line 292:
    return msvc_exists(env)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py",
line 759:
    vcs = cached_get_installed_vcs(env)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py",
line 524:
    ret = get_installed_vcs(env)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py",
line 535:
    VC_DIR = find_vc_pdir(ver)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py",
line 344:
    comps = find_vc_pdir_vswhere(msvc_version)
  File "c:\program
files\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py",
line 306:
    vc_pdir = os.path.join(vsdir[0], 'VC')

I have looked at the executed tool, and it seem that currently
the called

C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
- -products *  -version 14.1 -property installationPath

reports nothing.

This may be a private problem with the installation,
but it would be nice if SCons can just return None from
find_vc_pdir_vswhere() for an empty list.

Proposal:

    if os.path.exists(vswhere_path):
        sp = subprocess.Popen(vswhere_cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
        vsdir, err = sp.communicate()
        vsdir = vsdir.decode("mbcs").splitlines()
        # vswhere could easily return multiple lines
        # we could define a way to pick the one we prefer, but since
        # this data is currently only used to make a check for existence,
        # returning the first hit should be good enough for now.
        if vsdir:
            vc_pdir = os.path.join(vsdir[0], 'VC')
            return vc_pdir
        else:
            # vswhere returned nothing
            return None
    else:
        # No vswhere on system, no install info available
        return None


regards

- --
Veit Kannegieser
software developer

Magneti Marelli GmbH
Instrument Cluster and Display

Waldburgstraße 21
70563 Stuttgart
Tel: +49 711 12371 129
Fax: +49 711 12371 198
mailto:Veit.Kannegieser at magnetimarelli.com

Manager: Heinrich-Gerhard Schüring
Domicile: Stuttgart
Court of Registry: Stuttgart, HRB 761189

please send plain text mail.
please ignore the mail server appended spam.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEElP6zc7O10FCIcxYNH1Nrgn5dJmkFAlxdnLsACgkQH1Nrgn5d
JmlJNw//W4ky06QH0pUH+xBmgKPTgPsUtjLByv1w5CR8IKN3LJS56lbOltHCi0rg
OAHHhqouTxftDR2C+RIvJIO7IaDukahd5H/0q9u6M61/niltFwqnvAo73zvx90SO
2FbEekIVhwy77gPIXSUWz4TItRrGHdLT8/uUsYjEysSvX8fkLo4M+K+XVsuOJTXZ
61inEFj9Of8zjNpBKelsVhWa/j4/oy40xEmWCfLUu4mO7lu8wKHO9nwcCqje4B2T
2qmu8UCXsOel5mpNEHfEi4lvPeJwln3Ks1Pps0AjStzo2EvmlQTRzrsJh/6RYx0o
Rm/ujv7u5GBoXxmLBvFBPv4Zx9ywL5Pvje2ifkjFgnce1L3TCyf6suKpnTcqG3FM
jJSqs3uq0sxoa4D+PuhUrbcU3F7JkON71IXS91Kxv9h+sT6ejgZfjaJRsmRaIcfZ
kWr4NQl6oWPVrld9rIWS2wl8Tm4MFnK+sE3FU2V8j4fdyT+zJjVoRXbWGtdeFwvI
101HiC/N3vE6kfcYy7YF/SORxJDCVGwrvJvzkixP7VFhAKPKMcbXQX+y0cYdx+X7
pAJOBvNMpjzmBbHsKjYyBj1hBUX6SdEjjUqbjiWwBeaIwdv/HOByThtI8ONMpwdz
hstpfwFMfccMRYQHiDtKK6wQc8Erg5pugoWMnsI9vsqB7dDJrjY=
=knMO
-----END PGP SIGNATURE-----
Besuchen Sie unseren Internetauftritt! - VISIT OUR WEB SITE! www.magnetimarelli.com Dieses Dokument ist vertraulich zu behandeln. Es ist nicht gestattet, es ohne unsere ausdrückliche Genehmigung weiterzuleiten, zu vervielfältigen oder den Inhalt zu verwerten. Wenn Sie nicht der beabsichtigte Empfänger sind, informieren Sie bitte den Absender und löschen diese Email. This document is to be treated confidentially. It is not allowed to pass on, duplicate, exploit or disclose the contents of this email in all respects without our expressed permission. If you are not the intended recipient, please contact the sender and delete this message. ---------------------------------------------------------------------------------------------------------- Geschäftsführer: Heinrich-Gerhard Schuering Sitz der Gesellschaft: Stuttgart Amtsgericht: Stuttgart HRB 761189


More information about the Scons-users mailing list