FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

process: correctly parse Unicode in NODE_OPTIONS by bzoz · Pull Request #34476 · nodejs/node · GitHub

/ node Public

process: correctly parse Unicode in NODE_OPTIONS - #34476

Closed
bzoz wants to merge 5 commits into
nodejs:masterfrom
JaneaSystems:unicode-node-options
Closed

process: correctly parse Unicode in NODE_OPTIONS#34476
bzoz wants to merge 5 commits into
nodejs:masterfrom
JaneaSystems:unicode-node-options

Conversation

bzoz commented Jul 22, 2020

Copy link
Copy Markdown
Contributor

Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed
correctly.

Fixes: #34399

Reused the code from node_env_var.cc for getting the enviroment variable value.

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

nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jul 22, 2020

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Comment on lines 11 to 20

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit:

Suggested change
const NODE_OPTIONS = `--redirect-warnings=${expected_redirect_value}`;
const result = cp.spawnSync(process.argv0,
['--expose-internals', __filename, 'test'],
{
env: {
NODE_OPTIONS
}
});
const env = { NODE_OPTIONS: `--redirect-warnings=${expected_redirect_value}` };
const result = cp.spawnSync(process.argv0,
['--expose-internals', __filename, 'test'],
{ env });

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this necessary?

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: I'd prefer to have explicit check for 'child process' case (i.e. if (process.argv[2] === 'test') {) instead to handle possibly different test start args.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
const result = cp.spawnSync(process.argv0,
const result = cp.spawnSync(process.execPath,

Copy link
Copy Markdown
Collaborator

bzoz commented Aug 12, 2020

Copy link
Copy Markdown
Contributor Author

Fixed some nits and rebased.

Copy link
Copy Markdown
Collaborator

bzoz commented Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

Ok, this is weird. This fails only on ubuntu1804_sharedlibs_openssl111_x64 with this error message:

ot ok 2466 parallel/test-unicode-node-options
  ---
  duration_ms: 0.144
  severity: fail
  exitcode: 1
  stack: |-
    out/Release/node: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1b' not found (required by out/Release/node)
    assert.js:103
      throw new AssertionError(obj);
      ^
    
    AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
    
    1 !== 0
    
        at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-unicode-node-options.js:18:10)
        at Module._compile (internal/modules/cjs/loader.js:1089:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1110:10)
        at Module.load (internal/modules/cjs/loader.js:954:32)
        at Function.Module._load (internal/modules/cjs/loader.js:795:14)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
        at internal/main/run_main_module.js:17:47 {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: 1,
      expected: 0,
      operator: 'strictEqual'
    }
  ...

It looks like other tests can spawn new Node instances just fine. I'm stuck here 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Does this help with the current CI failure?

Suggested change
env: { NODE_OPTIONS },
env: { ...process.env, NODE_OPTIONS },

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes, it helped. Thanks!

bzoz force-pushed the unicode-node-options branch from 398d7d5 to 15ac48a Compare August 20, 2020 01:46

bzoz commented Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

bzoz added a commit to JaneaSystems/node that referenced this pull request Aug 20, 2020
Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed
correctly.

Fixes: nodejs#34399

PR-URL: nodejs#34476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>

bzoz commented Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

Green CI, landed in de565ad

bzoz closed this Aug 20, 2020
BethGriggs pushed a commit that referenced this pull request Aug 20, 2020
Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed
correctly.

Fixes: #34399

PR-URL: #34476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
danielleadams mentioned this pull request Aug 20, 2020
BethGriggs pushed a commit that referenced this pull request Aug 20, 2020
Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed
correctly.

Fixes: #34399

PR-URL: #34476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed
correctly.

Fixes: #34399

PR-URL: #34476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Fixes an issue on Windows, where Unicode in NODE_OPTIONS was not parsed
correctly.

Fixes: #34399

PR-URL: #34476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
codebytere mentioned this pull request Sep 28, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unicode characters are not properly parsed from NODE_OPTIONS on Windows

7 participants


Back | FazBrowse Home | New Git URL