GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buffer: move process.binding('buffer') to internalBinding by starkwang · Pull Request #22370 · nodejs/node

Conversation

@starkwang

@starkwang starkwang commented Aug 17, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Refs: #22160

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot

nodejs-github-bot commented Aug 17, 2018

Copy link
Copy Markdown
Collaborator

@starkwang build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/579/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs involving general changes in the lib/ or src/ directories. label Aug 17, 2018
@starkwang starkwang added the wip Issues and PRs that are still a work in progress. label Aug 17, 2018
@starkwang

starkwang commented Aug 17, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

node/test/parallel/test-buffer-bindingobj-no-zerofill.js

Lines 29 to 34 in 3814534

// Load from file system because internal buffer is already loaded and we're
// testing code that runs on first load only.
// Do not move this require() to top of file. It is important that
// `require('internal/buffer').setupBufferJS` be monkey-patched before this
// runs.
const monkeyPatchedBuffer = require('../../lib/buffer');

The tests is failed now because the monkeyPatchedBuffer is loaded from file system and internal/bootstrap/loaders cannot be required in that way.

Details
out/Release/node --expose-internals /Users/apple/Desktop/node/test/parallel/test-buffer-bindingobj-no-zerofill.js
internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'internal/bootstrap/loaders'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/apple/Desktop/node/lib/buffer.js:24:29)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)

How can we solve it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell mentioned this pull request Aug 17, 2018
Tracking Issue: process.binding to internalBinding #22160
Closed
32 of 33 tasks
@jasnell

jasnell commented Aug 17, 2018

Copy link
Copy Markdown
Member

This is going to be a tricky one because the way that test is written, there is no other way to test that particular bit. One question is: do we actually need to test that particular case?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BridgeAR

BridgeAR commented Aug 17, 2018

Copy link
Copy Markdown
Member

I am +1 on removing that part from the test.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdalton

jdalton commented Aug 18, 2018

Copy link
Copy Markdown
Member

@starkwang I believe this should be added to the allow list at here.

starkwang reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@starkwang
starkwang force-pushed the buffer-internal-binding branch from e9c556d to b0984ae Compare August 18, 2018 14:22
@Trott

Trott commented Aug 18, 2018

Copy link
Copy Markdown
Member

This is going to be a tricky one because the way that test is written, there is no other way to test that particular bit. One question is: do we actually need to test that particular case?

Ideally, that entire test file should be replaced by an addon test. See conversation at 27e84ddd4e1#r19182129 and #11706.

The test was written to cover the || [0] part of this code from lib/buffer.js:

// |zeroFill| can be undefined when running inside an isolate where we
// do not own the ArrayBuffer allocator.  Zero fill is always on in that case.
const zeroFill = bindingObj.zeroFill || [0];

If you can come up with an addon test that makes sure that code is run in the appropriate condition, then this rather inelegant way to test that bit of code can be removed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Aug 18, 2018

Copy link
Copy Markdown
Member

Moreover, that assertion was added by @bengl in 8172f45. It seems to me like it is inessential and can be removed, but he may believe otherwise?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Aug 23, 2018
@starkwang starkwang mentioned this pull request Aug 27, 2018
Replace test-buffer-bindingobj-no-zerofill.js by an addon test #22547
Closed
@BridgeAR

BridgeAR commented Sep 5, 2018

Copy link
Copy Markdown
Member

This needs a rebase.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@starkwang
starkwang force-pushed the buffer-internal-binding branch 2 times, most recently from 2c1292c to 3870dcd Compare September 10, 2018 02:05
@starkwang

starkwang commented Sep 10, 2018

Copy link
Copy Markdown
Contributor Author

I've removed the tricky test-buffer-bindingobj-no-zerofill.js. We can follow up it in #22547.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@starkwang

starkwang commented Sep 10, 2018

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@starkwang starkwang removed the wip Issues and PRs that are still a work in progress. label Sep 11, 2018
@cjihrig cjihrig mentioned this pull request Oct 3, 2018
icu: make process.binding('icu') internal #23234
Merged
3 tasks done
@starkwang
starkwang force-pushed the buffer-internal-binding branch from bf7a154 to 2eda676 Compare October 11, 2018 02:55
@starkwang

starkwang commented Oct 11, 2018

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@starkwang

starkwang commented Oct 11, 2018

Copy link
Copy Markdown
Contributor Author

@nodejs/buffer PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cjihrig
cjihrig approved these changes Oct 12, 2018
View reviewed changes
lundibundi
lundibundi approved these changes Oct 14, 2018
View reviewed changes
@starkwang
buffer: move process.binding('buffer') to internalBinding
5e88675
@starkwang
starkwang force-pushed the buffer-internal-binding branch from 2eda676 to 5e88675 Compare October 15, 2018 02:42
@starkwang

starkwang commented Oct 15, 2018

Copy link
Copy Markdown
Contributor Author

CI before landing: https://ci.nodejs.org/job/node-test-pull-request/17861/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@starkwang

starkwang commented Oct 15, 2018

Copy link
Copy Markdown
Contributor Author

This change is semver-major so it needs another member in TSC to approve.

@nodejs/tsc PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Oct 15, 2018
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
addaleax
addaleax approved these changes Oct 15, 2018
View reviewed changes
@starkwang

starkwang commented Oct 15, 2018

Copy link
Copy Markdown
Contributor Author

Landed in ac23e65

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@starkwang starkwang closed this Oct 15, 2018
starkwang added a commit that referenced this pull request Oct 15, 2018
@starkwang
buffer: move process.binding('buffer') to internalBinding
ac23e65
PR-URL: #22370
Refs: #22160
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
@starkwang @jasnell
buffer: move process.binding('buffer') to internalBinding
5d95542
PR-URL: #22370
Refs: #22160
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Denys Otrishko <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@addaleax addaleax addaleax approved these changes
@cjihrig cjihrig cjihrig approved these changes
+1 more reviewer
@lundibundi lundibundi lundibundi approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@starkwang @nodejs-github-bot @jasnell @BridgeAR @jdalton @Trott @mcollina @addaleax @cjihrig @lundibundi
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.