Skip to content

win: more robust parsing of SDK version#1198

Merged
refack merged 1 commit intonodejs:masterfrom
refack:fix-1179-parsing
May 17, 2017
Merged

win: more robust parsing of SDK version#1198
refack merged 1 commit intonodejs:masterfrom
refack:fix-1179-parsing

Conversation

@refack
Copy link
Copy Markdown
Contributor

@refack refack commented May 13, 2017

Fixes: #1179

Personally I prefer #1178, but this is smaller.

@refack refack mentioned this pull request May 13, 2017
Copy link
Copy Markdown
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a question.

Comment thread lib/Find-VS2017.cs Outdated
Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(id.Substring(Win10SDKPrefix.Length)));
else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
else if (id.StartsWith(Win10SDKPrefix)) {
string[] parts = id.ToString().Substring(Win10SDKPrefix.Length).Split('.');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superfluous ToString() call?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.
Gone.

Comment thread lib/Find-VS2017.cs
else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
else if (id.StartsWith(Win10SDKPrefix)) {
string[] parts = id.Substring(Win10SDKPrefix.Length).Split('.');
Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(parts[0]));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the Desktop C++ SDK is good, according to https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community it has .Desktop appended. What about:

-                    Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(parts[0]));
+                    if (parts.Length == 1 || (parts.Length == 2 && parts[1] == "Desktop"))
+                        Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(parts[0]));
+                    else
+                        continue;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, with variation

Comment thread lib/Find-VS2017.cs Outdated
else if (id == "Microsoft.VisualStudio.Component.Windows81SDK")
else if (id.StartsWith(Win10SDKPrefix)) {
string[] parts = id.Substring(Win10SDKPrefix.Length).Split('.');
if (parts.Length == 2 && parts[1] != "Desktop")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a Microsoft.VisualStudio.Component.Windows10SDK.15063.UWP.Native that this does not catch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎 for Microsoft.
Enhanced the guard.

Copy link
Copy Markdown
Member

@joaocgreis joaocgreis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joaocgreis
Copy link
Copy Markdown
Member

@refack
Copy link
Copy Markdown
Contributor Author

refack commented May 15, 2017

@joaocgreis I don't have write here (yet?), after we land we need to ping one of the package owners to package a patch version.

@joaocgreis
Copy link
Copy Markdown
Member

@refack refack force-pushed the fix-1179-parsing branch from 65d02db to 099eab3 Compare May 17, 2017 18:43
PR-URL: nodejs#1198
Fixes: nodejs#1179
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: João Reis <[email protected]>
@refack refack force-pushed the fix-1179-parsing branch from 099eab3 to bad903a Compare May 17, 2017 18:44
@refack refack merged commit bad903a into nodejs:master May 17, 2017
@refack
Copy link
Copy Markdown
Contributor Author

refack commented May 17, 2017

Landed in bad903a

@refack
Copy link
Copy Markdown
Contributor Author

refack commented May 17, 2017

@refack
Copy link
Copy Markdown
Contributor Author

refack commented May 17, 2017

This should go into v3.6.2 fixes #1179 and #1144 (comment)
/cc @bnoordhuis @rvagg

This was referenced May 22, 2017
@refack
Copy link
Copy Markdown
Contributor Author

refack commented May 28, 2017

/cc @rvagg @bnoordhuis @joaocgreis @nodejs/node-gyp
IMHO we need to release another patch version for this (and try to push it into npm@5)
Fixes: #1179
Ref: #1056 (comment)
Ref: #1144 (comment)
Ref: #1205

@rvagg
Copy link
Copy Markdown
Member

rvagg commented Jun 1, 2017

👍 done, v3.6.2, thanks @refack

@refack refack deleted the fix-1179-parsing branch June 1, 2017 22:29
@refack
Copy link
Copy Markdown
Contributor Author

refack commented Jun 1, 2017

👍 done, v3.6.2, thanks @refack

No, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants