You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes Windows use a lite venv to better align it with the unixy
implementations. A lite venv is one that has the interpreter and
pyvenv.cfg file, but site-packages isn't populated.
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.
A particularity of venvs on Windows is that various supporting `.dll`
files *must* be in the same directory as `python.exe`. A new
attribute (and associated provider plumbing) is added to `py_runtime`
to capture these extra files.
Note that this **requires** symlink support be enabled in Bazel and
Windows. If both aren't enabled, then weird errors will occur because
junctions (instead of symlinks) are created that point to files
(junctions can only point to directories).
Zipapp support for these venvs is also added. This required adding
`PyExecutableInfo.venv_interpreter_symlinks` to keep track of relative
symlinks that need to be created. Tracking them separately is needed
because Bazel has a bug where relative symlinks are made absolute
on Windows.
The internal plumbing for these symlinks is kept relatively generic
to support using such symlinks in site-packages in a future change.
Along the way...
* Hash-based extract support is added for zipapps passed to Python.
* Fixed manually passing a zipapp to Python to bootstrap it. This was
previously broken because the launcher doesn't know how to look
inside the zip file.
* Added `RULES_PYTHON_EXTRACT_ROOT` support when manually passing
a zipapp to Python.
* Fix several issues with forward-slashes being used on Windows.
* Cleanup and improve bootstrap scripts in various ways.
* Cleanup some doc in local_runtime_repo.
* Have repo_utils.which print nicely formatted path entries on
failure.
* Add --config=fast-tests to make it easier to run small/medium tests
* And --config=testone to make it easier to run a specific test
---------
Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
0 commit comments