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

Additional graceful handling for pixi #23942

Merged
merged 9 commits into from
Aug 20, 2024

Conversation

anthonykim1
Copy link

@anthonykim1 anthonykim1 commented Aug 12, 2024

In addition to first PR #23937

I've been able to repro aggressive errors of

2024-08-12 13:59:21.087 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
2024-08-12 13:59:20.794 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
	at Object.readdirSync (node:fs:1509:26)
	at t.readdirSync (node:electron/js2c/node_init:2:11418)
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583006
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583197
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:582915)
	at async d.ensureWatchersReady (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:539326)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
}

even when I dont have pixi in my workspace. Changing the log level on this and adding more wraps around that should give necessary hint/message when needed without crashing program.

@anthonykim1 anthonykim1 self-assigned this Aug 12, 2024
@anthonykim1 anthonykim1 added bug Issue identified by VS Code Team member as probable bug area-environments Features relating to handling interpreter environments labels Aug 12, 2024
@anthonykim1 anthonykim1 marked this pull request as ready for review August 12, 2024 22:45
@anthonykim1 anthonykim1 added the skip tests Updates to tests unnecessary label Aug 12, 2024
@anthonykim1
Copy link
Author

This is what it output panel looks with changes in effect: (You wont see the errors mentioned above)

2024-08-12 15:45:20.121 [info] Experiment 'All' is active
2024-08-12 15:45:20.121 [warning] Reading directory failed /Users/anthonykim/Desktop/Skeleton/.pixi/envs
2024-08-12 15:45:20.121 [warning] Dir "/Users/anthonykim/Desktop/Skeleton/.pixi/envs" is not watchable (directory does not exist)
2024-08-12 15:45:20.121 [info] Default formatter is set to null for workspace /Users/anthonykim/Desktop/Skeleton
2024-08-12 15:45:20.121 [info] Starting Environment refresh
2024-08-12 15:45:20.121 [info] Searching for interpreters in posix paths locator
2024-08-12 15:45:20.121 [info] Searching for pyenv environments
2024-08-12 15:45:20.121 [info] Searching for conda environments
2024-08-12 15:45:20.121 [info] Searching for global virtual environments
2024-08-12 15:45:20.121 [info] Searching for custom virtual environments
2024-08-12 15:45:20.121 [info] Finished searching for custom virtual envs: 78 milliseconds
2024-08-12 15:45:20.121 [info] Python interpreter path: ./.venv/bin/python
2024-08-12 15:45:20.121 [info] Finished searching for global virtual envs: 489 milliseconds
2024-08-12 15:45:20.143 [info] > conda info --json
2024-08-12 15:45:20.144 [info] > pixi --version
2024-08-12 15:45:20.144 [warning] Failed to get pixi version
2024-08-12 15:45:20.145 [info] Found: /usr/bin/python3 --> /usr/bin/python3
2024-08-12 15:45:20.145 [info] > hatch env show --json
2024-08-12 15:45:20.145 [info] cwd: .
2024-08-12 15:45:20.191 [warning] could not find a pixi interpreter for the interpreter at /Users/anthonykim/Desktop/Skeleton/.venv/bin/python
2024-08-12 15:45:20.194 [info] > pyenv which python
2024-08-12 15:45:20.194 [info] cwd: .
2024-08-12 15:45:20.213 [info] Found: /usr/local/bin/python3 --> /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
2024-08-12 15:45:20.214 [info] > . ./.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/Desktop/vscode-python/python_files/printEnvVariables.py
2024-08-12 15:45:20.214 [info] shell: bash
2024-08-12 15:45:20.232 [info] Found: /usr/local/bin/python3.13 --> /Library/Frameworks/Python.framework/Versions/3.13/bin/python3.13
2024-08-12 15:45:20.819 [warning] could not find a pixi interpreter for the interpreter at /Users/anthonykim/Desktop/Skeleton/.venv/bin/python

@vs-code-engineering vs-code-engineering bot added this to the August 2024 milestone Aug 12, 2024
@anthonykim1 anthonykim1 marked this pull request as draft August 12, 2024 23:23
@anthonykim1 anthonykim1 marked this pull request as ready for review August 12, 2024 23:23
@anthonykim1 anthonykim1 marked this pull request as draft August 19, 2024 01:34
@anthonykim1 anthonykim1 marked this pull request as ready for review August 19, 2024 01:37
@eightysteele
Copy link

@anthonykim1 (and @karthiknadig) thank you for the work on this. let me know if there's anything i can do from my side to help test out these changes.

justschen
justschen previously approved these changes Aug 20, 2024
@anthonykim1 anthonykim1 merged commit fdddaf9 into microsoft:main Aug 20, 2024
40 checks passed
anthonykim1 added a commit to anthonykim1/vscode-python that referenced this pull request Sep 13, 2024
In addition to first PR
microsoft#23937

I've been able to repro aggressive errors of 
```
2024-08-12 13:59:21.087 [error] [Error: spawn pixi ENOENT
	at ChildProcess._handle.onexit (node:internal/child_process:286:19)
	at onErrorNT (node:internal/child_process:484:16)
	at process.processTicksAndRejections (node:internal/process/task_queues:82:21)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn pixi',
  path: 'pixi',
  spawnargs: [ '--version' ]
}
```

```
2024-08-12 13:59:20.794 [error] Reading directory to watch failed [Error: ENOENT: no such file or directory, scandir '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
	at Object.readdirSync (node:fs:1509:26)
	at t.readdirSync (node:electron/js2c/node_init:2:11418)
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583006
	at /Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:583197
	at Array.map (<anonymous>)
	at d.initWatchers (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:582915)
	at async d.ensureWatchersReady (/Users/anthonykim/.vscode/extensions/ms-python.python-2024.13.2024080901-darwin-arm64/out/client/extension.js:2:539326)] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/anthonykim/Desktop/vscode-python/.pixi/envs'
}
```

even when I dont have pixi in my workspace. Changing the log level on
this and adding more wraps around that should give necessary
hint/message when needed without crashing program.

---------

Co-authored-by: Karthik Nadig <kanadig@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug skip tests Updates to tests unnecessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants