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

os: move process.binding('os') to internalBinding #22292

Closed
wants to merge 2 commits into from
Closed

os: move process.binding('os') to internalBinding #22292

wants to merge 2 commits into from

Conversation

briete
Copy link
Contributor

@briete briete commented Aug 13, 2018

see: #22160

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. os Issues and PRs related to the os subsystem. labels Aug 13, 2018
Copy link
Member

@jdalton jdalton left a comment

Choose a reason for hiding this comment

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

Holding removals until migration is ironed out

@jasnell
Copy link
Member

jasnell commented Aug 13, 2018

Actual code change looks good. process.binding('os') is one that we definitely need to be careful about.

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Aug 13, 2018
@jasnell
Copy link
Member

jasnell commented Aug 15, 2018

@briete .. when you get a moment, can you rebase this from master then apply the following patch, which will be necessary for this to proceed

Author: James M Snell <[email protected]>
Date:   Tue Aug 14 19:36:25 2018 -0700

    [Squash] add `process.binding('os')` to fallthrough whitelist

diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 08daeb1915..ffae6e4cd9 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -327,7 +327,7 @@
     // that are whitelisted for access via process.binding()... this is used
     // to provide a transition path for modules that are being moved over to
     // internalBinding.
-    const internalBindingWhitelist = new SafeSet(['uv']);
+    const internalBindingWhitelist = new SafeSet(['uv', 'os']);
     process.binding = function binding(name) {
       return internalBindingWhitelist.has(name) ?
         internalBinding(name) :
diff --git a/test/parallel/test-process-binding-internalbinding-whitelist.js b/test/parallel/test-process-binding-internalbinding-whitelist.js
index ece967a0b7..cc0119917d 100644
--- a/test/parallel/test-process-binding-internalbinding-whitelist.js
+++ b/test/parallel/test-process-binding-internalbinding-whitelist.js
@@ -7,3 +7,4 @@ const assert = require('assert');
 // Assert that whitelisted internalBinding modules are accessible via
 // process.binding().
 assert(process.binding('uv'));
+assert(process.binding('os'));

Copy link
Member

@lundibundi lundibundi 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 nit.

@@ -7,3 +7,4 @@ const assert = require('assert');
// Assert that whitelisted internalBinding modules are accessible via
// process.binding().
assert(process.binding('uv'));
assert(process.binding('os'));
Copy link
Member

Choose a reason for hiding this comment

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

Missing newline at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. Fixed

@lundibundi
Copy link
Member

@briete could you please rebase this on master and resolve the conflicts? I'll then run the CI and we will hopefully get your PR landed 👍.

@briete
Copy link
Contributor Author

briete commented Aug 28, 2018

@lundibundi I resolved the conflict by rebasing

@lundibundi
Copy link
Member

lundibundi commented Aug 28, 2018

@briete could you try to remove all of the non-yours commits from this PR? You will have to either:

  • use git rebase --interactive and remove unnecessary commits and then rebase cleanly on master
  • close this PR and open a new one that will be based on up to date master branch (you can also use git cherry-pick to get your commits from this branch)

Also, I can do the first option for you and just push to your branch (briete:os-internal-binding) if that's fine with you.

Unfortunately, I cannot start the CI until this is resolved with whichever method you prefer.

@briete
Copy link
Contributor Author

briete commented Aug 29, 2018

@lundibundi sorry. I am confused by my first OSS contribution.:sweat:
May I ask you the first option?

@lundibundi
Copy link
Member

@briete I've updated your branch.

BE AWARE that the following will remove all your local changes to os-internal-binding branch (those not in github), if you want to keep them you have to use git stash or some other method.
If you didn't make any changes there is nothing to worry about.
If you want to pull the changes locally you will have to use

git checkout os-internal-binding
git fetch
git reset --hard origin/os-internal-binding

Refs: https://stackoverflow.com/a/9813888/3923380

@lundibundi
Copy link
Member

@jdalton (or someone else) could you please take a look at ca7dad0 (second commit in this branch) as I'm not sure if I did it correctly.

@lundibundi
Copy link
Member

lundibundi commented Aug 29, 2018

CI doesn't seem very healty right now, I'll start it later.

CI: https://ci.nodejs.org/job/node-test-pull-request/16866/

@briete
Copy link
Contributor Author

briete commented Aug 29, 2018

@lundibundi Thank you. informative.:+1:

@starkwang
Copy link
Contributor

@briete Are you still interested in this PR ?

@briete
Copy link
Contributor Author

briete commented Dec 17, 2018

@starkwang I'm sorry. Since time has passed since the first PR, close this and make a new PR.

@briete
Copy link
Contributor Author

briete commented Dec 17, 2018

See #25087

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++. os Issues and PRs related to the os subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants