-
Notifications
You must be signed in to change notification settings - Fork 30k
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
src: add /json/protocol endpoint to inspector #7491
Conversation
strm.opaque = Z_NULL; | ||
CHECK_EQ(Z_OK, inflateInit(&strm)); | ||
static const size_t kDecompressedSize = | ||
PROTOCOL_JSON[0] * 0x1000u + |
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.
0x10000u
?
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.
Indeed. I'll fix that.
LGTM but can you add a quick statement to the commit log about why? :-) |
result += flags_match.group(1).strip().split() | ||
# PORT should match the definition in test/common.js. | ||
env = { 'PORT': int(os.getenv('NODE_COMMON_PORT', '12346')) } | ||
env['PORT'] += self.thread_id * 100 |
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.
Adding thread_id * 100
to the port number and requiring the port to match common.PORT
seem to be kind of contradictory?
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.
I didn't make it up, exports.PORT += process.env.TEST_THREAD_ID * 100;
is what test/common.js does.
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.
Oh, sorry, didn’t see that value is changed later in test/common.js.
This CI failure looks related |
Does this commit intend to canonicalize V8's embedded protocol.json as Node's protocol.json? I don't think we should finalize that yet, that's the goal of the discussion in nodejs/diagnostics#52. |
Looks like I got the dependency chain wrong. It also looks like we're doing that wrong in more places. I added a fix-up that makes the inspector build depend explicitly on the generated header. New CI: https://ci.nodejs.org/job/node-test-pull-request/3137/
No. |
import zlib | ||
|
||
if __name__ == '__main__': | ||
fp = open(sys.argv[1]) |
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.
not sure if important for this kind of script, but fp is not explicitly closed. Since we depend on 2.6-2.7, maybe use a with statement instead?
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.
The script is short-lived so I went for simplicity.
Apparently, that did not do the trick… https://ci.nodejs.org/job/node-test-commit-arm/3865/nodes=armv7-wheezy/console |
I'm starting to think the bug might not be in my changes to node.gyp. Other buildbots do this:
But the armv7-wheezy buildbot only does this:
The output of --- a.txt 2016-06-30 10:39:49.475993197 +0200
+++ b.txt 2016-06-30 10:40:04.387993197 +0200
@@ -1,7 +1,7 @@
'variables': { 'arm_float_abi': 'hard',
- 'arm_fpu': 'vfpv3',
+ 'arm_fpu': 'vfp',
'arm_thumb': 0,
- 'arm_version': '7',
+ 'arm_version': '6',
'asan': 0,
'debug_devtools': 'node',
'gas_version': '2.24', cc @nodejs/build - ideas on what might be causing that? EDIT: To be clear, CI runs for other pull requests show the exact same behavior. It's not isolated to this pull request. |
Ping @nodejs/build. Even just a 'no clue' would be appreciated. :-) |
It might make sense to expose this via the protocol itself i.e. Protocol.getJSON method would return the protocol definition. That way clients could reuse same web socket connection and hence save on CORS, etc. for the separate request. |
On my local machine this compiles with |
@joaocgreis Good suggestion, updated. CI: https://ci.nodejs.org/job/node-test-pull-request/3227/
@pavelfeldman Correct me if I'm wrong but doesn't that introduce a chicken-and-egg problem? The client won't know what protocol to speak to request the protocol JSON. |
It does, but it is manageable. There could be runtimes with different sets of capabilities available via the same endpoint. If we do use json/protocol to expose those capabilities, then it should be on the connection level in a form of RTTI. We have not implemented these capabilities yet, so it is up for debate. |
ping @bnoordhuis :-) |
Let's take the debian approach: when faced with several options, do 'em all. Does publishing the protocol over both WS and HTTP sound good? |
@bnoordhuis we can do /json/protocol first to cover the immediate needs. we'll follow up with the same in chromium for consistency. |
Rebased, new CI: https://ci.nodejs.org/job/node-test-pull-request/3676/ Can I get a LGTM or two? |
@@ -322,6 +322,7 @@ | |||
'dependencies': [ | |||
'deps/v8_inspector/third_party/v8_inspector/platform/' | |||
'v8_inspector/v8_inspector.gyp:v8_inspector_stl', | |||
'v8_inspector_compress_protocol_json#host', |
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.
nit: is there a reason for the inconsistent indent between this and the two lines above?
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.
The previous line is a continuation of the one before it. Note how the first line doesn't have a comma at the end.
68206a9
to
2655fb9
Compare
Rebased against master. Can someone sign off on this? |
LGTM |
1 similar comment
LGTM |
Rebased. New CI run: https://ci.nodejs.org/job/node-test-pull-request/4008/ Barring nays or CI failures, I'll merge this tomorrow or the day after. EDIT: Again, because "stderr: fatal: unable to access 'https://github.com/nodejs/node.git/': gnutls_handshake() failed: A TLS packet with unexpected length was received." |
CI again so we can get this merged: https://ci.nodejs.org/job/node-test-pull-request/4064 EDIT: Problems on ARM and AIX which are out of my realm to troubleshoot 😢 |
Ping @bnoordhuis |
Rebased. CI again: https://ci.nodejs.org/job/node-test-pull-request/4240/ |
Known flake parallel/test-tick-processor-unknown on smartos, see #8725; everything else is green/yellow. I'm going to land this. |
Embed the compressed and minified protocol.json from the bundled v8_inspector and make it available through the /json/protocol endpoint. Refs: nodejs/diagnostics#52 PR-URL: nodejs#7491 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Embed the compressed and minified protocol.json from the bundled v8_inspector and make it available through the /json/protocol endpoint. Refs: nodejs/diagnostics#52 PR-URL: nodejs#7491 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Embed the compressed and minified protocol.json from the bundled v8_inspector and make it available through the /json/protocol endpoint. Refs: nodejs/diagnostics#52 PR-URL: #7491 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Embed the compressed and minified protocol.json from the bundled v8_inspector and make it available through the /json/protocol endpoint. Refs: nodejs/diagnostics#52 PR-URL: #7491 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
According to nodejs/node#7491
Embed the compressed and minified protocol.json from the bundled
v8_inspector and make it available through the /json/protocol endpoint.
Refs: nodejs/diagnostics#52
CI: https://ci.nodejs.org/job/node-test-pull-request/3133/
EDIT: https://ci.nodejs.org/job/node-test-pull-request/3135/