-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: expose WriteNodeReport
to embedders
#55076
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55076 +/- ##
=======================================
Coverage 88.23% 88.23%
=======================================
Files 652 652
Lines 183911 183920 +9
Branches 35858 35863 +5
=======================================
+ Hits 162271 162290 +19
Misses 14916 14916
+ Partials 6724 6714 -10
|
Refs electron/electron#43774 Allows creating Node.js diagnostic reports from Electron signal handlers. Currently used by Utility process to support error event.
522fd7d
to
76a7ec4
Compare
WriteNodeReport
to embedders
I don't know about the report stuff too well, but the current API looks a bit too verbose to expose to node.h and we might end up changing the signature for some internal use (which would make it semver-major). Are all of the parameters needed by Electron? Can we expose a simplified version of it with only the bits that need to be customized to be exposed as parameters in the public API? |
Also we can consider taking a struct for the parameters, that'll allow us to add more parameters without making the public API changes semver-major due to ABI compatibility breakage. |
Thanks @codebytere for starting this thread! @joyeecheung you are right not all parameters are needed today, we would like to capture diagnostics from
Also having an extendable way to exclude parts of the report maybe via enum would be helpful,
For example in our case |
@joyeecheung I agree with this but just to be clear, that's not what this PR is doing – we're not really providing any guarantees, neither ABI nor API stability, to Electron here. This is just making an internal API accessible when using (I do think that Electron should put some effort into stopping to do that. But there have been PRs like this for years and I don't think expect any changes here.) |
Oh right, I misread, this is adding it to node_report.h, not node.h |
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 if this makes it easier for Electron to resolve conflicts. Though I agree with @addaleax that reducing the usage of NODE_WANT_INTERNALS would be ideal.
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.
There is a node::GetNodeReport
public API in node.h
already. It should provide the functionality.
Thanks @legendecas, somehow I missed that. It is sufficient for our use case. |
Refs electron/electron#43774
This PR allows creating Node.js diagnostic reports from Electron signal handlers. It's currently used by Electron's Utility Process to support
error
events.cc @deepak1556