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

vcbuild fails with non-descriptive error when the registry has stale keys #14103

Closed
seishun opened this issue Jul 6, 2017 · 3 comments
Closed
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.

Comments

@seishun
Copy link
Contributor

seishun commented Jul 6, 2017

  • Version: master
  • Platform: Windows 10 64-bit
  • Subsystem: build

When I run vcbuild or vcbuild vs2017, it results in the following output:

Looking for Visual Studio 2017
Found MSVS version 15.0
C:\Python27\python.exe configure  --dest-cpu=x64 --tag=
creating icu_config.gypi
* Using ICU in deps/icu-small
creating icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'coverage': 'false',
                 'debug_devtools': 'node',
                 'force_dynamic_crt': 0,
                 'host_arch': 'x64',
                 'icu_data_file': 'icudt59l.dat',
                 'icu_data_in': '..\\..\\deps/icu-small\\source/data/in\\icudt59l.dat',
                 'icu_endianness': 'l',
                 'icu_gyp_path': 'tools/icu/icu-generic.gyp',
                 'icu_locales': 'en,root',
                 'icu_path': 'deps/icu-small',
                 'icu_small': 'true',
                 'icu_ver_major': '59',
                 'node_byteorder': 'little',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 56,
                 'node_no_browser_globals': 'false',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared': 'false',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_bundled_v8': 'true',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'true',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'node_use_v8_platform': 'true',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'shlib_suffix': 'so.56',
                 'target_arch': 'x64',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_enable_inspector': 1,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_promise_internal_field_count': 1,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 0,
                 'want_separate_host_toolset_mkpeephole': 0}}
creating config.gypi
creating config.mk
Traceback (most recent call last):
  File "configure", line 1406, in <module>
    run_gyp(gyp_args)
  File "tools\gyp_node.py", line 53, in run_gyp
    rc = gyp.main(args)
  File "tools\gyp\pylib\gyp\__init__.py", line 538, in main
    return gyp_main(args)
  File "tools\gyp\pylib\gyp\__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "tools\gyp\pylib\gyp\generator\msvs.py", line 2032, in GenerateOutput
    generator_flags))
  File "tools\gyp\pylib\gyp\generator\msvs.py", line 953, in _GenerateProject
    return _GenerateMSBuildProject(project, options, version, generator_flags)
  File "tools\gyp\pylib\gyp\generator\msvs.py", line 3378, in _GenerateMSBuildProject
    project_file_name)
  File "tools\gyp\pylib\gyp\generator\msvs.py", line 2714, in _GetMSBuildGlobalProperties
    _ConfigWindowsTargetPlatformVersion(configuration, version))
  File "tools\gyp\pylib\gyp\generator\msvs.py", line 311, in _ConfigWindowsTargetPlatformVersion
    return names[0]
IndexError: list index out of range
Failed to create vc project files.

I have a "v10.0" key under HKLM\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows (but not under HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows). The ProductVersion value under it has data "10.0.15063" even though I don't have that specific Windows 10 SDK version installed. I might have previously installed and removed it though. Consequently, I don't have a "10.0.15063" directory under C:\Program Files (x86)\Windows Kits\10\Include, so this line returns an empty list.

@seishun seishun added build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform. labels Jul 6, 2017
@kylelamse
Copy link

Get the same thing. Have no idea how to fix it.

@seishun
Copy link
Contributor Author

seishun commented Jul 18, 2017

You can fix it locally by removing the offending registry key.

@jaimecbernardo
Copy link
Contributor

Hi, this issue was fixed in this upstream commit , which was has landed in 327077c .

@bzoz bzoz closed this as completed Aug 24, 2017
duqingnian pushed a commit to duqingnian/gyp that referenced this issue Apr 26, 2024
When building with Visual Studio 2017, gyp may fail with a
non-descriptive message if Windows has stale registry keys for a
version of Windows SDK that was previously uninstalled.

This commit adds a specific warning message when the directory for
a detected SDK version doesn't exist and adds some Fixes to avoid
Python crashes that were blocking the detection of other SDK
versions:

- Only try to run listdir on a path if it exists and is a dir.

- Avoid accessing names[0] if it has no elements.

- Use %s instead of %o to print compatible_sdks (to avoid TypeError,
since %o is the octal number format specifier in Python and %s can be
used as a generic format specifier for objects).

Refs: nodejs/node#14597
Bug: nodejs/node#14103
Change-Id: Ifd50fe239f65b7b4a2d69c1c02038bada03066cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants