-
Notifications
You must be signed in to change notification settings - Fork 30k
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
gyp: show descriptive Windows SDK detection error #14597
gyp: show descriptive Windows SDK detection error #14597
Conversation
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). Fixes: nodejs#14103
/cc @bnoordhuis /cc @refack PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@jaimecbernardo this looks good, would you mind submitting it upstream: https://gyp.gsrc.io/docs/Hacking.md P.S. If you do add me as a reviewer |
@refack Will submit it upstream, thanks! |
I've submitted this PR upstream. Review link: https://chromium-review.googlesource.com/c/602133 |
This PR has landed upstream in https://chromium.googlesource.com/external/gyp/+/324dd166b7c0b39d513026fa52d6280ac6d56770 |
@jaimecbernardo thanks, I'll update #12632 (or open a new PR, since that one seems stalled). |
@refack I guess it makes more sense to update the current PR, if you can :) Thank you. |
@refack Actually, that PR is for ninja, right? This commit doesn't seem to fall under that umbrella. |
#12632 started as a |
So I'm closing this in favor of a new |
@jaimecbernardo Thanks for the contribution and the "bureaucratic" dance 🥇 |
@refack Thanks for helping me along the way ;) |
Patch Set 1: Hi, This change comes originally from nodejs/node#14597 I've added as reviewers those accounts that seem to have committed/reviewed recent changes for Windows in gyp. Please let me know if I should add another reviewer I might have missed. Thanks, in advance. Patch-set: 1 Reviewer: Gerrit User 1188132 <1188132@3ce6091f-6c88-37e8-8c75-72f92ae8dfba> Reviewer: Gerrit User 1174099 <1174099@3ce6091f-6c88-37e8-8c75-72f92ae8dfba> Reviewer: Gerrit User 1003232 <1003232@3ce6091f-6c88-37e8-8c75-72f92ae8dfba> Reviewer: Gerrit User 1226816 <1226816@3ce6091f-6c88-37e8-8c75-72f92ae8dfba> Work-in-progress: false
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
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:
%s
instead of%o
to printcompatible_sdks
(to avoidTypeError
, since%o
is the octal number format specifier in Python and%s
can be used as a generic format specifier for objects).Fixes: #14103
/cc @nodejs/build
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
win, build, tools, gyp