GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: add `process` to internal module wrapper by addaleax · Pull Request #17198 · nodejs/node

Conversation

@addaleax

@addaleax addaleax commented Nov 21, 2017

Copy link
Copy Markdown
Member

Share process through the module wrapper rather than relying
on nobody messing with global.process.

Fixes: #6802

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

lib (but in particular the REPL)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

devsnek and bricss reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@addaleax
lib: add process to internal module wrapper
a5511e4
Share `process` through the module wrapper rather than relying
on nobody messing with `global.process`.

Fixes: nodejs#6802
@addaleax addaleax added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. repl Issues and PRs related to the REPL subsystem. labels Nov 21, 2017
@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs involving general changes in the lib/ or src/ directories. label Nov 21, 2017
@addaleax addaleax mentioned this pull request Nov 21, 2017
REPL crashes after let process; #6802
Closed
bnoordhuis
bnoordhuis approved these changes Nov 21, 2017
View reviewed changes

@bnoordhuis bnoordhuis left a comment

Copy link
Copy Markdown
Member

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 have a curious sense of double deja vu: both of reviewing something like this before and of writing it myself...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@addaleax

addaleax commented Nov 21, 2017

Copy link
Copy Markdown
Member Author

@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…

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Nov 21, 2017
View reviewed changes

@jasnell jasnell left a comment

Copy link
Copy Markdown
Member

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.

Code change LGTM.
Should this be defensively marked semver-major?
Definitely needs a CITGM run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lance
lance approved these changes Nov 21, 2017
View reviewed changes

@lance lance left a comment

Copy link
Copy Markdown
Member

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 - and to think I was going down the ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES rabbit hole. This is nice and clean.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mscdex

mscdex commented Nov 21, 2017

Copy link
Copy Markdown
Contributor

This should be semver-major IMHO.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex mscdex added the semver-major PRs that contain breaking changes and should be released in the next major version. label Nov 21, 2017
@addaleax

addaleax commented Nov 21, 2017

Copy link
Copy Markdown
Member Author

@mscdex I don’t have a strong opinion personally, but would you mind giving a reason for that? What scenario could this break?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex mscdex removed the repl Issues and PRs related to the REPL subsystem. label Nov 21, 2017
@mscdex

mscdex commented Nov 21, 2017

Copy link
Copy Markdown
Contributor

@addaleax For people that may rely on global.process being changed?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Nov 21, 2017

Copy link
Copy Markdown
Member Author

@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?

lance and jasnell reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

mscdex commented Nov 21, 2017

Copy link
Copy Markdown
Contributor

Feel free to remove the label, but I generally like to be defensive about such changes...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 21, 2017

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Nov 21, 2017

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

apapirovski
apapirovski approved these changes Nov 21, 2017
View reviewed changes
joyeecheung
joyeecheung approved these changes Nov 21, 2017
View reviewed changes
aqrln
aqrln approved these changes Nov 22, 2017
View reviewed changes
targos
targos approved these changes Nov 22, 2017
View reviewed changes
cjihrig
cjihrig approved these changes Nov 22, 2017
View reviewed changes
TimothyGu
TimothyGu approved these changes Nov 22, 2017
View reviewed changes
@addaleax addaleax added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 27, 2017
@addaleax

addaleax commented Nov 27, 2017

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-commit/14382/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

refack
refack approved these changes Nov 27, 2017
View reviewed changes
@addaleax addaleax removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Nov 28, 2017
@addaleax

addaleax commented Nov 28, 2017

Copy link
Copy Markdown
Member Author

Landed in e8a26e7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax closed this Nov 28, 2017
@addaleax
addaleax deleted the process-internal branch November 28, 2017 01:57
addaleax added a commit that referenced this pull request Nov 28, 2017
@addaleax
lib: add process to internal module wrapper
e8a26e7
Share `process` through the module wrapper rather than relying
on nobody messing with `global.process`.

PR-URL: #17198
Fixes: #6802
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@apapirovski

apapirovski commented Feb 23, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@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

devsnek, addaleax, and cjihrig reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented Feb 23, 2018

Copy link
Copy Markdown
Member

@apapirovski Are you asking for removing the semver-major label or something else?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apapirovski

apapirovski commented Feb 23, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@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...).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apapirovski apapirovski mentioned this pull request Feb 23, 2018
timers: make setImmediate() immune to tampering #17736
Closed
@targos

targos commented Feb 23, 2018

Copy link
Copy Markdown
Member

+1 from me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 23, 2018
@addaleax

addaleax commented Feb 23, 2018

Copy link
Copy Markdown
Member Author

Removed the label for now, we can see if anybody has a differing opinion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

apapirovski pushed a commit to apapirovski/node that referenced this pull request Feb 26, 2018
@addaleax @apapirovski
lib: add process to internal module wrapper
af42919
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@apapirovski apapirovski mentioned this pull request Feb 26, 2018
[v9.x-backport] Backport #17198, #17738, #17841, #17736, #17881, #17879 and #18139 #19006
Closed
4 tasks done
addaleax added a commit that referenced this pull request Feb 26, 2018
@addaleax
lib: add process to internal module wrapper
337d529
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@addaleax addaleax added the backported-to-v9.x label Feb 26, 2018
addaleax added a commit that referenced this pull request Feb 26, 2018
@addaleax
lib: add process to internal module wrapper
c7b66d0
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
MylesBorins pushed a commit that referenced this pull request Feb 26, 2018
@addaleax @MylesBorins
lib: add process to internal module wrapper
738b0a1
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Lance Ball <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
@addaleax addaleax mentioned this pull request Feb 27, 2018
v9.7.0 proposal #19040
Closed
@MylesBorins MylesBorins added the backport-requested-v8.x label Jul 31, 2018
@MylesBorins

MylesBorins commented Jul 31, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
@jasnell jasnell jasnell approved these changes
@cjihrig cjihrig cjihrig approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
+6 more reviewers
@lance lance lance approved these changes
@apapirovski apapirovski apapirovski approved these changes
@refack refack refack approved these changes
@TimothyGu TimothyGu TimothyGu approved these changes
@targos targos targos approved these changes
@aqrln aqrln aqrln approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

lib / src Issues and PRs involving general changes in the lib/ or src/ directories.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

14 participants

@addaleax @mscdex @jasnell @apapirovski @targos @MylesBorins @lance @refack @bnoordhuis @TimothyGu @cjihrig @joyeecheung @aqrln @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.