Skip to content

fix(scripts): resolve the interpreter before building .venv - #150

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/validate-module-venv-realpath
Oct 4, 2026
Merged

rldyourmnd merged 1 commit into
mainfrom
fix/validate-module-venv-realpath

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Summary

uv python find 3.13.14 can return a symlink (here: ~/.local/bin/python3.13 → the nddev toolchain). python -m venv --copies then writes home = <link dir> into pyvenv.cfg, the copied binary resolves <link dir>/../lib/python3.13 for its stdlib, finds nothing, and ensurepip fails — which is what blocked the estate's module-pin verification lane (GDS_MODULE_VERIFICATION_COMMAND_FAILED, lane test).

Resolving os.path.realpath(sys.executable) first makes home the real toolchain bin/, and is a no-op wherever the interpreter is already a real file.

Permissions diff

None — shell script, no workflow surfaces touched.

Threat-model note

The interpreter path now passes through the interpreter's own realpath before use; it can only resolve to a target the found binary already points to — no new trust edge.

Test plan

  • Reproduced: ~/.local/bin/python3.13 -m venv --copies → encodings missing, ensurepip exit 1
  • With fix: validate_module.sh builds .venv (home = real toolchain) and validate_all (core): OK — 45 lanes green

Generated with Devin

'uv python find' may answer a symlink (for example a ~/.local/bin shim
into an extracted toolchain). A --copies venv records that link's
directory as home, so the copied binary resolves <home>/../lib and
loses its stdlib: ensurepip dies with 'no module named encodings' and
the module-pin verification lane cannot build the environment. Resolve
the real path first; on a real interpreter the call is a no-op.

Signed-off-by: rldyourmnd <danil@nddev.it.com>
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.

1 participant