Skip to content

Fix install state path resolving symlinks to unwritable system Python#24

Open
kinto0 wants to merge 2 commits into
microsoft:mainfrom
kinto0:fix/environments-symlink-resolve
Open

Fix install state path resolving symlinks to unwritable system Python#24
kinto0 wants to merge 2 commits into
microsoft:mainfrom
kinto0:fix/environments-symlink-resolve

Conversation

@kinto0

@kinto0 kinto0 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • _install_state_path() called Path.resolve() on the suite venv's python executable, which follows symlinks to the base interpreter
  • On systems where the base interpreter lives in a read-only location (e.g. /usr/local/fbcode/), this causes a PermissionError when writing the per-suite install state file
  • Drop .resolve() so the state file is written relative to the venv path, which is always writable

Test plan

  • Before: bench-servers crashes immediately with PermissionError: [Errno 1] Operation not permitted: '/usr/local/fbcode/platform010/Python3.12.framework/.../.python-lsp-compare-install.json'
  • After: bench-servers completes successfully across all 4 servers. Pyrefly: 1 failed point (tsp_core/generic specialization — pre-existing config bug, not caused by this change). 43 unit tests pass.

_install_state_path() called Path.resolve() on the suite venv's python
executable, which follows symlinks to the base interpreter. On systems
where the base interpreter lives in a read-only location (e.g. a system
Python framework at /usr/local/fbcode/), this causes a PermissionError
when writing the per-suite install state file.

Drop .resolve() so the state file is written relative to the venv path,
which is always writable.

Test plan:
  Before: bench-servers crashes immediately with PermissionError:
    [Errno 1] Operation not permitted:
    '/usr/local/fbcode/platform010/Python3.12.framework/...
    /.python-lsp-compare-install.json'
  After:  bench-servers completes successfully across all 4 servers.
    Pyrefly: 1 failed point (tsp_core/generic specialization —
    pre-existing config bug, not caused by this change).
    43 unit tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants