Skip to content
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

Run internal modules and scripts in isolated manner. #10681

Closed
karthiknadig opened this issue Mar 20, 2020 · 1 comment
Closed

Run internal modules and scripts in isolated manner. #10681

karthiknadig opened this issue Mar 20, 2020 · 1 comment
Labels
feature-request Request for new features or functionality

Comments

@karthiknadig
Copy link
Member

karthiknadig commented Mar 20, 2020

  1. Use runpy to run script or module without adding CWD to sys path.
  2. add method to PythonExecutionService, etc. to use that script
  3. update calls for internals scripts to use the new method
@karthiknadig karthiknadig added feature-request Request for new features or functionality needs PR labels Mar 20, 2020
@ericsnowcurrently ericsnowcurrently changed the title Add script to run modules or scripts in isolated manner Run internal modules and scripts in isolated manner. Mar 24, 2020
ericsnowcurrently added a commit that referenced this issue Mar 25, 2020
For #10681

We'll use this for our security hardening.
ericsnowcurrently added a commit that referenced this issue Apr 7, 2020
For #10681

The key change here is the separation (under src/client/common/process) of Python environment helpers from running Python processes. This helps simplify later changes needed for #10681, as well as other code health benefits.

A small related change: adding PythonExecutionInfo.python (which helps simplify composition of exec args in some situations).

There should be zero change in behavior.
ericsnowcurrently added a commit that referenced this issue Apr 7, 2020
For #10681

This makes it much easier to make changes that are specific to internal scripts generally, like send them through a separate script to run them isolated.

There should be zero change in behavior.
ericsnowcurrently added a commit that referenced this issue Apr 8, 2020
For #10681.

This makes it so that none of the extension's internal scripts get run with sys.path[0] set to CWD. Note that test adapter script is the only one that is not run isolated.
ericsnowcurrently added a commit that referenced this issue Apr 8, 2020
For #10681.

This change updates all other internal uses of Python in the extension to run "isolated".
@ericsnowcurrently
Copy link
Member

This is done now!

@ghost ghost removed the needs PR label Apr 8, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants