Skip to content

feat!: make windows use full venvs#3680

Open
rickeylev wants to merge 17 commits intobazel-contrib:mainfrom
rickeylev:sys.py.win.venv
Open

feat!: make windows use full venvs#3680
rickeylev wants to merge 17 commits intobazel-contrib:mainfrom
rickeylev:sys.py.win.venv

Conversation

@rickeylev
Copy link
Copy Markdown
Collaborator

This makes Windows use a full venv to better align it with the unixy
implementations.

Unfortunately, it has to recreate the venv at runtime because Bazel
incorrectly canonicalizes relative symlinks on Windows. This isn't ideal,
however, Windows builds were already going through a zip-unzip process,
so creating a handful of symlinks seems like an improvement overall.

Note that this requires symlink support be enabled in Bazel and Windows.
If both aren't enabled, then weird errors will occur due to junctions pointing
to files being created instead of symlinks.

@rickeylev rickeylev requested a review from aignas as a code owner April 4, 2026 04:22
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors Python virtual environment (venv) creation to support platform-specific requirements, particularly for Windows, including the addition of a venv_bin_files attribute to PyRuntimeInfo for including DLLs and PDBs. The changes also update the bootstrap templates to handle Windows-specific pathing, pyvenv.cfg generation, and zip-app execution. Feedback from the review points out a global hardcoding of build_zip_enabled that should be restricted to Windows, redundant logic in the Unix venv creation path, and a bug in the bootstrap template where a function was incorrectly evaluated as a variable. Additionally, minor issues regarding PEP 8 formatting and a placeholder version string in the documentation were noted.

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