| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Share `process` through the module wrapper rather than relying on nobody messing with `global.process`. Fixes: nodejs#6802
There was a problem hiding this comment.
I have a curious sense of double deja vu: both of reviewing something like this before and of writing it myself...
Sorry, something went wrong.
|
@bnoordhuis I think we might have tried to add it to the userland module wrapper at some point, which broke existing code that contained statements like const process = ...; – not sure I remember correctly though… |
Sorry, something went wrong.
There was a problem hiding this comment.
Code change LGTM.
Should this be defensively marked semver-major?
Definitely needs a CITGM run.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM - and to think I was going down the ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES rabbit hole. This is nice and clean.
Sorry, something went wrong.
|
This should be semver-major IMHO. |
Sorry, something went wrong.
|
@mscdex I don’t have a strong opinion personally, but would you mind giving a reason for that? What scenario could this break? |
Sorry, something went wrong.
|
@addaleax For people that may rely on global.process being changed? |
Sorry, something went wrong.
|
@mscdex Changed to what? If the new value doesn’t have the properties as the initial process, that would basically always crash the process from Node’s internals sooner or later anyway, right? |
Sorry, something went wrong.
|
Feel free to remove the label, but I generally like to be defensive about such changes... |
Sorry, something went wrong.
|
I think being defensive is the safest route, if citgm comes up without any problematic hits then I've no problem dropping the label when this lands. |
Sorry, something went wrong.
|
to be clear, @addaleax, I cannot think of a single reasonable case where this would break anyone, but there's no harm in being cautious. |
Sorry, something went wrong.
Sorry, something went wrong.
Share `process` through the module wrapper rather than relying on nobody messing with `global.process`. PR-URL: #17198 Fixes: #6802 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
|
@nodejs/tsc Can we unmake this semver-major per chance? It's actually impossible for Node to get through a single run of the event loop if process gets set to a new object, because we rely on process._tickCallback, process.nextTick and many other things in our internal code. It's blocking landing #17736 on v9.x |
Sorry, something went wrong.
|
@apapirovski Are you asking for removing the semver-major label or something else? |
Sorry, something went wrong.
|
@targos Yes, I'm looking to remove the semver-major label. I think it's overly cautious and we haven't seen any breakages in CitGM on master as a result of this. In addition to what I said above, if someone just modifies the process object with new properties then those changes will still be available. This merely changes the behaviour if global.process is assigned a new value (which breaks Node anyway...). |
Sorry, something went wrong.
|
+1 from me |
Sorry, something went wrong.
|
Removed the label for now, we can see if anybody has a differing opinion. |
Sorry, something went wrong.
Share `process` through the module wrapper rather than relying on nobody messing with `global.process`. PR-URL: nodejs#17198 Fixes: nodejs#6802 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Share `process` through the module wrapper rather than relying on nobody messing with `global.process`. Backport-PR-URL: #19006 PR-URL: #17198 Fixes: #6802 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Share `process` through the module wrapper rather than relying on nobody messing with `global.process`. Backport-PR-URL: #19006 PR-URL: #17198 Fixes: #6802 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Share `process` through the module wrapper rather than relying on nobody messing with `global.process`. Backport-PR-URL: #19006 PR-URL: #17198 Fixes: #6802 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
|
This does not land cleanly in v8.x LTS. Please feel free to manually backport by following the guide. Please also feel free to replace do-not-land if it is being backported edit: the backport to 9.x came with a number of other PRs (see #19006) it landed in 743cf33...f2dd17b likely we would want to backport all at once? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Share process through the module wrapper rather than relying
on nobody messing with global.process.
Fixes: #6802
Checklist
Affected core subsystem(s)
lib (but in particular the REPL)