Skip to content

fix: preserve process.execArgv#161853

Merged
alexdima merged 9 commits into
microsoft:mainfrom
jsjoeio:jsjoeio/fix-process-execArgv
Oct 24, 2022
Merged

fix: preserve process.execArgv#161853
alexdima merged 9 commits into
microsoft:mainfrom
jsjoeio:jsjoeio/fix-process-execArgv

Conversation

@jsjoeio

@jsjoeio jsjoeio commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

This ensures flags like --prof are passed down to the vs code process so we can profile everything.

To test this:

  1. run ./lib/node --prof .
  2. in another terminal, run ps -ejww

You should see --prof next to every vs code process.

P.S. this approach leans on a pattern already in the codebase:

// if not set, the forked process inherits the execArgv of the parent process
// --inspect and --inspect-brk can not be inherited as the port would conflict
forkOpts.execArgv = process.execArgv.filter(a => !/^--inspect(-brk)?=/.test(a)); // remove

This ensures flags like `--prof` are passed down to the vs code process so
we can profile everything.

To test this:
1. run `./lib/node --prof .`
2. in another terminal, run `ps -ejww`

You should see `--prof` next to every vs code process.
@jsjoeio
jsjoeio marked this pull request as ready for review September 26, 2022 21:50
@bpasero bpasero assigned alexdima and unassigned bpasero Sep 27, 2022
@jsjoeio

jsjoeio commented Oct 7, 2022

Copy link
Copy Markdown
Contributor Author

@alexdima any update on this? happy to open an issue if you'd like more context first.

@alexdima alexdima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alexdima alexdima added this to the October 2022 milestone Oct 24, 2022
@alexdima
alexdima merged commit 30c0860 into microsoft:main Oct 24, 2022
formigoni pushed a commit to formigoni/vscode that referenced this pull request Oct 27, 2022
This ensures flags like `--prof` are passed down to the vs code process so
we can profile everything.

To test this:
1. run `./lib/node --prof .`
2. in another terminal, run `ps -ejww`

You should see `--prof` next to every vs code process.
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants