Skip to content

Conversation

@refack
Copy link
Contributor

@refack refack commented Jun 2, 2017

Fixes: #13376

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added - comments
  • commit message follows commit guidelines
Affected core subsystem(s)

test,module

@refack
Copy link
Contributor Author

refack commented Jun 2, 2017

Copy link
Contributor Author

@refack refack left a comment

Choose a reason for hiding this comment

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

Explaining + nits

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/s/message/messages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and a comma after Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

putting it in a separate line makes for easy breakpoint setting.

Copy link
Member

Choose a reason for hiding this comment

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

This seems like an unnecessary change. Not sure about other debuggers, but chrome://inspect allows you to set breakpoints on statements within a line:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replace dlerror_msg truthy check for a trivial fallback (Line 34) mostly for keeping line short.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

simplify

Copy link
Member

Choose a reason for hiding this comment

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

I fear this might actually be 'en\r\n'. Maybe .startsWith('en'), or even .includes('en'), or trim the output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack.

@refack
Copy link
Contributor Author

refack commented Jun 2, 2017

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

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

Just discovered that this method is not 100% accurate (I changed the locale, logged off and back in without rebooting), but I think it is close enough.

> require('./test/fixtures/module-loading-error.node')
Error: %1 is not a valid Win32 application.
\\?\E:\node\test\fixtures\module-loading-error.node
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at repl:1:1
    at sigintHandlersWrap (vm.js:22:35)
    at sigintHandlersWrap (vm.js:96:12)
>
(To exit, press ^C again or type .exit)
>

E:\node>powershell -NoProfile -ExecutionPolicy Unrestricted -c "(Get-UICulture).TwoLetterISOLanguageName"
de

Will approve if CI passes.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe use camelCase (dlErrorMsg) for consistency while you are at it?

Copy link
Member

Choose a reason for hiding this comment

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

s/if/If and add a period at the end

@tniessen tniessen added the windows Issues and PRs related to the Windows platform. label Jun 2, 2017
@mscdex mscdex added the module Issues and PRs related to the module subsystem. label Jun 2, 2017
@refack
Copy link
Contributor Author

refack commented Jun 2, 2017

@refack
Copy link
Contributor Author

refack commented Jun 2, 2017

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

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

Thank you for implementing this!

Copy link
Member

Choose a reason for hiding this comment

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

errorMsgsByPlafrom -> errorMsgsByPlatform (and below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in for penny in for a pound: errorMessagesByPlatform

Copy link
Member

Choose a reason for hiding this comment

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

This seems like an unnecessary change. Not sure about other debuggers, but chrome://inspect allows you to set breakpoints on statements within a line:

image

@refack refack force-pushed the test-module-mui-check branch from adb46b5 to 6ee5498 Compare June 3, 2017 14:21
Copy link
Member

Choose a reason for hiding this comment

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

If this line fails and we hit the catch, won't localeOk still be true rather than false?

i.e. should you do this?

if (common.isWindows) {
+  localeOk = false;
  const powerShellFindMUI =

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intentionally I chose to be strict. the less use of the "escape hatch" the better the coverage 🤔

Copy link
Member

Choose a reason for hiding this comment

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

If the powershell script fails will it log an error to the console? If so then I guess that's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea because execSync pipes stderr from the child we get the error (this one is a synthetic syntax error):

C:\bin\dev\node\node.exe D:\code\node\test\parallel\test-module-loading-error.js
Get-UICulture2 : The term 'Get-UICulture2' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:2
+ (Get-UICulture2).TwoLetterISOLanguageName
+  ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-UICulture2:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 

Process finished with exit code 0

Notice that the exit code is 0

PR-URL: nodejs#13393
Fixes: nodejs#13376
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@refack refack force-pushed the test-module-mui-check branch from 6ee5498 to 30a20bd Compare June 5, 2017 21:21
@refack
Copy link
Contributor Author

refack commented Jun 5, 2017

Landed in 30a20bd

@refack refack merged commit 30a20bd into nodejs:master Jun 5, 2017
@refack refack deleted the test-module-mui-check branch June 5, 2017 21:25
jasnell pushed a commit that referenced this pull request Jun 7, 2017
PR-URL: #13393
Fixes: #13376
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
@MylesBorins
Copy link
Contributor

Should this be backported to v6.x?

@refack
Copy link
Contributor Author

refack commented Jul 18, 2017

Yes. Does not land cleanly, I will backport.

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

Labels

module Issues and PRs related to the module subsystem. test Issues and PRs related to the tests. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test-module-loading-error fails on Windows with MUI set to a non-English language

7 participants