-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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 cli option to preserve env vars on dr #55697
base: main
Are you sure you want to change the base?
Conversation
@@ -105,6 +105,9 @@ const report = { | |||
|
|||
nr.setReportOnUncaughtException(trigger); | |||
}, | |||
get preserveEnv() { | |||
return !nr.shouldPreserveEnvironmentVariables(); |
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.
Can this just be a constant exposed from C++ rather than a function?
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.
Also I think this should be cached, if we are keeping it as it is.
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.
We can cache it, yes, but at the moment this is only used inside our tests. That's why I just didn't care about it.
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'll change it to a regular const. Possibly tomorrow.
@@ -170,6 +170,12 @@ static void ShouldReportOnUncaughtException( | |||
env->isolate_data()->options()->report_uncaught_exception); | |||
} | |||
|
|||
static void ShouldPreserveEnvironmentVariables( |
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: a todo with a note of adding v8 fast api for this.
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 don't think there's a need for that now. See: #55697 (comment)
For consistency with |
This PR introduces a new cli flag
--report-preserve-env
to avoid writing env vars on diagnostic reports.Some context: https://x.com/arthurfiorette/status/1848372069198614664