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

test: remove dependency on node-weak #11239

Merged
merged 3 commits into from
Feb 11, 2017

Conversation

bnoordhuis
Copy link
Member

Replace node-weak with a small hand-rolled add-on. We can now drop node-weak and nan, reducing the size of the source tree by about 750 kB (and the size of the tarball by about 150-300 kB.)

The first commit cleans up the tests, the second introduces the add-on, the third one drops nan and node-weak.

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Feb 8, 2017
@richardlau
Copy link
Member

vcbuild.bat will also require changes.

@bnoordhuis
Copy link
Member Author

@richardlau Right you are, updated.

@mscdex mscdex added the test Issues and PRs related to the tests. label Feb 8, 2017
Copy link
Member

@richardlau richardlau left a comment

Choose a reason for hiding this comment

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

node-weak is also referenced in the LICENSE file via tools/license-builder.sh.

try {
module.exports = require('./build/Release/binding').ongc;
} catch (e) {
module.exports = require('./build/Debug/binding').ongc;
Copy link
Member

Choose a reason for hiding this comment

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

Is it correct to prefer a binding in Release (e.g. if tests are run with node_g)?

For example, build and test Release and then build and test Debug without cleaning in-between.

I don't think it's possible for the makefile to build the binding in debug mode (it always runs node-gyp with the Release node) -- vcbuild.bat runs node-gyp with "%config%\node".

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right that the build won't compile a debug version but it seems convenient for manual testing/debugging. What would you do instead?

Copy link
Member

Choose a reason for hiding this comment

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

Try to load the version that matched the mode (release/debug) of the node process first and fallback to the other?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a bad idea but I decided to use the same logic we use in test/addons for the sake of consistency. PTAL.

@bnoordhuis
Copy link
Member Author

node-weak is also referenced in the LICENSE file via tools/license-builder.sh.

Funny, I didn't even realize I own the copyright. At any rate, removed!

Rewrite the tests in test/gc so that they no longer call process.exit().
Instead they exit gracefully now.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Replace node-weak with a small hand-rolled add-on.  We can now drop
node-weak and nan, reducing the size of the source tree by about 750 kB
and the size of the tarball by about 150-300 kB.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Since the previous commit obsoleted them, remove them.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@bnoordhuis bnoordhuis closed this Feb 11, 2017
@bnoordhuis bnoordhuis deleted the cleanup-gc-tests branch February 11, 2017 13:22
@bnoordhuis bnoordhuis merged commit 75019df into nodejs:master Feb 11, 2017
italoacasas pushed a commit that referenced this pull request Feb 13, 2017
Rewrite the tests in test/gc so that they no longer call process.exit().
Instead they exit gracefully now.

PR-URL: #11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
italoacasas pushed a commit that referenced this pull request Feb 13, 2017
Replace node-weak with a small hand-rolled add-on.  We can now drop
node-weak and nan, reducing the size of the source tree by about 750 kB
and the size of the tarball by about 150-300 kB.

PR-URL: #11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
italoacasas pushed a commit that referenced this pull request Feb 13, 2017
Since the previous commit obsoleted them, remove them.

PR-URL: #11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
Rewrite the tests in test/gc so that they no longer call process.exit().
Instead they exit gracefully now.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
Replace node-weak with a small hand-rolled add-on.  We can now drop
node-weak and nan, reducing the size of the source tree by about 750 kB
and the size of the tarball by about 150-300 kB.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
Since the previous commit obsoleted them, remove them.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
Rewrite the tests in test/gc so that they no longer call process.exit().
Instead they exit gracefully now.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
Replace node-weak with a small hand-rolled add-on.  We can now drop
node-weak and nan, reducing the size of the source tree by about 750 kB
and the size of the tarball by about 150-300 kB.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
krydos pushed a commit to krydos/node that referenced this pull request Feb 25, 2017
Since the previous commit obsoleted them, remove them.

PR-URL: nodejs#11239
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@jasnell
Copy link
Member

jasnell commented Mar 7, 2017

needs backport PRs to land in v4 or v6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants