microsoft / devhome

The new Dev Home experience for Windows!
https://aka.ms/devhomedocs
MIT License
3.6k stars 320 forks source link

Dev Drive Package caches not recognized if set as Machine Level environment variables #3944

Open kevincathcart-cas opened 4 days ago

kevincathcart-cas commented 4 days ago

Dev Home version

0.1801.640.0

Windows build number

10.0.22631.4317

Other software

No response

Steps to reproduce the bug

  1. Create a Dev Drive via windows settings. (will assume it became drive letter D).
  2. Install Python from the windows store.
  3. Open windows terminal.
  4. Run mkdir D:\packages\pip\ && setx /M PIP_CACHE_DIR D:\packages\pip (as suggested by the official Dev Drive documentation).
  5. Install some packe with pip, for example: pip install uv.
  6. Open Dev Home, and navigate to Dev Drive insights.

Expected result

The PIP package cache should show up in the list of package caches. It does show up if step 4 were skipped (with the option to move the cache).

Actual result

The package cache does not show up. This is because this code only looks for the cache environment variables set at the user level, not the machine level, even though the official Dev Drive documentation suggests using /M with setx, which sets the variables at the machine level. This seems unnecessarily confusing.

I've no qualms about Dev Home preferring the user level variable setting, since it does not need admin rights, etc. But it should recognize such variables if set at the machine level.

Included System Information

No response

Included Extensions Information

No response

similar-issues-ai[bot] commented 4 days ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by šŸ‘ or šŸ‘Ž this comment.