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

deps: Add node-inspect #10187

Closed
wants to merge 10 commits into from
Closed

deps: Add node-inspect #10187

wants to merge 10 commits into from

Conversation

jkrems
Copy link
Contributor

@jkrems jkrems commented Dec 9, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

deps

Description of change

This adds a reimplementation of the old CLI debugger (node debug)
against the new debugger protocol (node --inspect). This is necessary
because the old protocol won't be supported in future versions of V8.

This just adds an additional make target (make test-node-inspect) but
will not include the new debugger in releases.

Fixes #7266

@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to build files or the CI. label Dec 9, 2016
@jkrems jkrems changed the title inspect: Add node inspect to deps deps: Add node inspect to deps Dec 9, 2016
@jkrems jkrems changed the title deps: Add node inspect to deps inspect: Add node-inspect 1.10.1 Dec 9, 2016
@mscdex mscdex added debugger and removed build Issues and PRs related to build files or the CI. labels Dec 9, 2016
@jkrems
Copy link
Contributor Author

jkrems commented Dec 9, 2016

This PR is supposed to start a conversation around both the code itself and how the debugger should be exposed.

Notes and references

  • Tracking issue in nodejs/diagnostics
  • The changeset could be reduced if we don't want to run the node-inspect test suite in node by restricting it to what would be published to npm.

The deps/node-inspect files were generated via:

rm -rf deps/node-inspect node-inspect-* && curl -sSL "https://github.com/buggerjs/node-inspect/archive/v1.10.4.tar.gz" | tar -xzvf - && mv node-inspect-* deps/node-inspect

@jkrems jkrems changed the title inspect: Add node-inspect 1.10.1 deps: Add node-inspect 1.10.1 Dec 9, 2016
@Fishrock123 Fishrock123 added the discuss Issues opened for discussions and feedbacks. label Dec 9, 2016
@@ -241,6 +241,9 @@ test-debugger: all
test-inspector: all
$(PYTHON) tools/test.py inspector

test-node-inspect: $(NODE_EXE)
Copy link
Member

Choose a reason for hiding this comment

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

Ideally, there's be a similar job for Windows in vcbuild.bat.

Copy link
Contributor Author

@jkrems jkrems Dec 11, 2016

Choose a reason for hiding this comment

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

Yep, didn't have a Windows machine set up to look into vcbuild.bat, that's why I only copied tools/test-npm.sh in the first push. Should be able to work on the Windows part next week.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Windows part is done.

@bnoordhuis
Copy link
Member

Didn't look too closely yet but this only checks in the files without further integration? That's not very useful by itself so what (and when) is the next step?

I agree with Rich that the tests should run on Windows so you should probably turn the shell script into a node script. Ideally, it gets integrated with tools/test.py somehow but I don't quite know how yet.

The fact that the test runner copies around files and runs npm install is less than pleasing. Better integration with the rest of the tree would let you drop the dependency on the tap and eslint packages and I don't think nlm is necessary in-tree.

@addaleax
Copy link
Member

Btw, it might be quite helpful for reviewing to put the additions to deps/ into a separate commit?

Jan Krems added 2 commits December 11, 2016 14:36
This adds a reimplementation of the old CLI debugger (`node debug`)
against the new debugger protocol (`node --inspect`). This is necessary
because the old protocol won't be supported in future versions of V8.
This just adds an additional make target (`make test-node-inspect`) but
will not include the new debugger in releases.
@jkrems
Copy link
Contributor Author

jkrems commented Dec 11, 2016

@addaleax Good point. Split the change into two commits. One for the bulk deps/ change, one for adding the make target and copying tools/test-npm.sh.

@jkrems
Copy link
Contributor Author

jkrems commented Dec 11, 2016

That's not very useful by itself so what (and when) is the next step?

I agree that just enabling the tests is of limited use. It gets us "master doesn't break the CLI debugger" but not "bundle the CLI debugger". The latter would be the next step - and I would say it comes as soon as we agree that the CLI debugger is ready to ship with node. I'm hoping that this PR will surface any blockers for that 2nd step.

The fact that the test runner copies around files and runs npm install is less than pleasing.

Agreed. Honest answer: I just blindly copied whatever was done for the npm integration. I'm not super familiar with node's build setup (and where it's heading), so any pointers would be appreciated if this is not the right direction.

Better integration with the rest of the tree would let you drop the dependency on the tap and eslint packages and I don't think nlm is necessary in-tree.

I believe the idea is to keep node-inspect as a standalone project that can be developed out-of-tree. I had a version that was pulling in even more parts of node's build setup. I honestly regret even keeping the custom eslint rules etc.. It adds a lot of churn trying to keep the files in sync when working on the debugger project itself. I'd rather keep node-inspect self-contained and reduce the amount of assumptions / degree of integration into node core's setup.

P.S.: The fact that it currently runs tap explicitly is hopefully temporary while I work through some build issues. The goal should be that it's just npm install && npm test from node's perspective.

@bnoordhuis
Copy link
Member

Can tap (the module) produce .tap files? Node's test runner prints tap output to both stdio and a file. The file is then picked up and parsed by the CI.

I suppose you could npm test | tee test-node-inspect.tap in the shell script but that won't work on Windows.

I just blindly copied whatever was done for the npm integration.

I don't think make test-npm runs as part of the regular CI. Perhaps only at release time? Maybe @Fishrock123 knows.

@MylesBorins
Copy link
Contributor

the tap module can definitely output raw tap... just have to select it as a reporter. It is worth noting we are moving towards junit XML for CI... but we will be able to convert the tap stream to xml in real time with @jbergstroem's tap2xml utility

make test-npm is not run in CI.

@bnoordhuis
Copy link
Member

But can it run in a tee-like mode? It needs to print to stdio for humans and to a file for machines.

@jkrems
Copy link
Contributor Author

jkrems commented Dec 12, 2016

But can it run in a tee-like mode?

I looked trough the tap docs and it didn't look like tee-support was built-in. But if we continue with the make/vcbuild (or node script) wrapping, we could just do it there.

Starting with 1.10.2 the test suite should pass consistently on
windows.
@gibfahn
Copy link
Member

gibfahn commented Dec 12, 2016

@bnoordhuis test-npm fix for CI is #7867. The script uses tee in bash and Tee-Object in Powershell.

@richardlau
Copy link
Member

It probably wouldn't be too hard to write a cross platform tee in Node.js.

@jkrems jkrems changed the title deps: Add node-inspect 1.10.1 deps: Add node-inspect Dec 12, 2016
@jkrems
Copy link
Contributor Author

jkrems commented Dec 13, 2016

@gibfahn Thanks for that link! I'll see tomorrow morning if I can steal that code for node-inspect purposes.

@addaleax addaleax added this to the 8.0.0 milestone Dec 13, 2016
@gibfahn
Copy link
Member

gibfahn commented Dec 13, 2016

@jkrems Actually if you look at Ben's comment here, he'd rather have a general node script that can test any of our dependencies (that use npm test). So if I rewrite that PR to work for deps/npm, it should be straightforward to get it to work for the inspector as well.

@jkrems
Copy link
Contributor Author

jkrems commented Dec 13, 2016

Got it, should've subscribed to that other PR. It looked stalled so I wasn't sure if we can count on it landing soon.

I assume that node script would basically take a source directory and then run npm install/npm run test-node in a properly sandboxed directory? If so, I could already update node-inspect to expose a test-node script (potentially just an alias for the test script).

addaleax added a commit that referenced this pull request Feb 13, 2017
Include the relevant files from `deps/node-inspect` in the compiled
`node` binary and make `node inspect` work like `node-inspect`.

PR-URL: #10187
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax
Copy link
Member

I’ve gone ahead and landed this in b1fc774...fd18b65. Thanks for the PR, @jkrems! 🎉

@addaleax addaleax closed this Feb 13, 2017
addaleax pushed a commit that referenced this pull request Feb 13, 2017
Squashed from:

- deps: Add node-inspect 1.10.1

This adds a reimplementation of the old CLI debugger (`node debug`)
against the new debugger protocol (`node --inspect`). This is necessary
because the old protocol won't be supported in future versions of V8.

- deps: Update node-inspect to 1.10.2

Starting with 1.10.2 the test suite should pass consistently on
windows.

- deps: Update to node-inspect 1.10.4

PR-URL: #10187
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax pushed a commit that referenced this pull request Feb 13, 2017
This just adds an additional make target (`make test-node-inspect`) but
will not include the new debugger in releases.

PR-URL: #10187
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Feb 13, 2017
Include the relevant files from `deps/node-inspect` in the compiled
`node` binary and make `node inspect` work like `node-inspect`.

PR-URL: #10187
Reviewed-By: James M Snell <jasnell@gmail.com>
@joshgav
Copy link
Contributor

joshgav commented Feb 13, 2017

Thank you @addaleax @jkrems and everyone who's worked on bringing this in! Great to see it landed and primed to land in 7.6.0 (#11185 (comment)).

I think we now need to decide if/how/when to deprecate or change behavior of node debug myscript.js. A proposal might be:

  1. Add a warning message to node debug that it will become an alias to node inspect soon and recommending use of node inspect.
  2. Actually make node debug an alias to node inspect, perhaps in the same release which first includes V8 >= 5.8.

Also to be sure we're on the same page, I think we expect updates to "upstream" nodejs/node-inspect to be manually integrated into nodejs/node occasionally via a PR, as we do with npm currently (e.g. #11020).

@jkrems
Copy link
Contributor Author

jkrems commented Feb 13, 2017

I think we expect updates to "upstream" nodejs/node-inspect to be manually integrated into nodejs/node occasionally via a PR, as we do with npm currently

👍

perhaps in the same release which first includes V8 >= 5.8.

Was there a decision on this? IIRC 5.8 was the release that would potentially break the older debug protocol and there was uncertainty about pulling it into node 8.x or not. Anyhow - I would say the alias should, if at all possible, happen before we're forced to drop the old debugger. That way we have some cycles to make additional changes (like the -p <pid> things).

italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
Squashed from:

- deps: Add node-inspect 1.10.1

This adds a reimplementation of the old CLI debugger (`node debug`)
against the new debugger protocol (`node --inspect`). This is necessary
because the old protocol won't be supported in future versions of V8.

- deps: Update node-inspect to 1.10.2

Starting with 1.10.2 the test suite should pass consistently on
windows.

- deps: Update to node-inspect 1.10.4

PR-URL: nodejs#10187
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
This just adds an additional make target (`make test-node-inspect`) but
will not include the new debugger in releases.

PR-URL: nodejs#10187
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 14, 2017
Include the relevant files from `deps/node-inspect` in the compiled
`node` binary and make `node inspect` work like `node-inspect`.

PR-URL: nodejs#10187
Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas added a commit that referenced this pull request Feb 16, 2017
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](#11094)
    * add node-inspect 1.10.2 (Jan Krems) [#10187](#10187)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](#11149)
* fs: allow WHATWG URL and file: URLs as paths (James M Snell) [#10739](#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](#10857)

PR-URL: #11185
italoacasas added a commit to italoacasas/node that referenced this pull request Feb 21, 2017
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [nodejs#11029](nodejs#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [nodejs#11094](nodejs#11094)
    * add node-inspect 1.10.4 (Jan Krems) [nodejs#10187](nodejs#10187)
    * upgrade zlib to 1.2.11 (Sam Roberts) [nodejs#10980](nodejs#10980)
* lib: build `node inspect` into `node` (Anna Henningsen) [nodejs#10187](nodejs#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [nodejs#9469](nodejs#9469)
* inspector: add --inspect-brk (Josh Gavant) [nodejs#11149](nodejs#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [nodejs#10739](nodejs#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [nodejs#11129](nodejs#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [nodejs#10857](nodejs#10857)

PR-URL: nodejs#11185
italoacasas added a commit to italoacasas/node that referenced this pull request Feb 22, 2017
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [nodejs#11029](nodejs#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [nodejs#11094](nodejs#11094)
    * add node-inspect 1.10.4 (Jan Krems) [nodejs#10187](nodejs#10187)
    * upgrade zlib to 1.2.11 (Sam Roberts) [nodejs#10980](nodejs#10980)
* lib: build `node inspect` into `node` (Anna Henningsen) [nodejs#10187](nodejs#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [nodejs#9469](nodejs#9469)
* inspector: add --inspect-brk (Josh Gavant) [nodejs#11149](nodejs#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [nodejs#10739](nodejs#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [nodejs#11129](nodejs#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [nodejs#10857](nodejs#10857)

PR-URL: nodejs#11185
@jkrems jkrems deleted the jk-node-inspect branch February 22, 2017 20:40
imyller added a commit to imyller/meta-nodejs that referenced this pull request Mar 2, 2017
    Notable changes:

    * deps:
        * update V8 to 5.5 (Michaël Zasso) [#11029](nodejs/node#11029)
        * upgrade libuv to 1.11.0 (cjihrig) [#11094](nodejs/node#11094)
        * add node-inspect 1.10.4 (Jan Krems) [#10187](nodejs/node#10187)
        * upgrade zlib to 1.2.11 (Sam Roberts) [#10980](nodejs/node#10980)
    * lib: build `node inspect` into `node` (Anna Henningsen) [#10187](nodejs/node#10187)
    * crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](nodejs/node#9469)
    * inspector: add --inspect-brk (Josh Gavant) [#11149](nodejs/node#11149)
    * fs: allow WHATWG URL objects as paths (James M Snell) [#10739](nodejs/node#10739)
    * src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](nodejs/node#11129)
    * url: extend url.format to support WHATWG URL (James M Snell) [#10857](nodejs/node#10857)

    PR-URL: nodejs/node#11185

Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
@jkrems jkrems mentioned this pull request Mar 15, 2017
3 tasks
@MylesBorins
Copy link
Contributor

we've opted to not land this on v6.x due to the the inspect being provided being an older version. It could prove difficult to keep this up to date.

Please let me know if we should reconsider

@jkrems
Copy link
Contributor Author

jkrems commented May 15, 2017

👍 People on 6.x already have a working bundled CLI debugger & if they really want node-inspect, they can install it from npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issues opened for discussions and feedbacks. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port the CLI debugger to use the v8 inspector protocol