-
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
lib: run prepareMainThreadExecution for third_party_main #26677
Conversation
Treat `_third_party_main` like any other CJS entry point, as it was done before 6967f91.
Landed in 81edd0a. |
Treat `_third_party_main` like any other CJS entry point, as it was done before 6967f91. PR-URL: #26677 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Treat `_third_party_main` like any other CJS entry point, as it was done before 6967f91. PR-URL: nodejs#26677 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Treat `_third_party_main` like any other CJS entry point, as it was done before 6967f91. PR-URL: #26677 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
A see: node/lib/internal/bootstrap/node.js Lines 245 to 288 in 9a5b243
I'm not sure if this is a bug or a breaking change, because it is now commented as legacy.. ref: nexe/nexe#638 |
What are the preparations that do make sense for |
I think anything that doesn't stem from user code would qualify as a preparation. Cluster setup is dependent on user-code usage of cluster. So the effects are occurring before the embedded _third_party_main.js is run. I can't think of any other scenario where this might be an issue, just the cluster setup. ( |
@calebboyd There are currently two parts of bootstrap
IIUC you are talking about doing 2 after running So I guess my question is, what is nexe doing with |
@calebboyd BTW, the intent of this PR is to make it so that |
Also, we previously thought about deprecating |
I don't think there is anything wrong with This is actually fine for the nexe use case. Historically though the bootstrap procedure would do all the setup except for cluster -- which would run immediately before user code execution node/lib/internal/bootstrap/node.js Lines 275 to 276 in 9a5b243
I would propose that for the same reasons cluster setup is run before preload modules, _third_party_main.js should be run before cluster setup. |
@calebboyd Do you know why running The cluster set up code mostly just instantiates certain variables exported by cluster depending on the value of |
Also, do you modify |
Treat
_third_party_main
like any other CJS entry point, as itwas done before 6967f91.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes