Skip to content
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
639000e
force full venv
rickeylev Mar 21, 2026
8eaafca
feat: make windows use full venvs
rickeylev Apr 4, 2026
27732f6
fix syntax error, sys_path order test
rickeylev Apr 4, 2026
e89f1c9
allow empty dll glob
rickeylev Apr 4, 2026
5b07725
Merge branch 'main' of https://github.com/bazel-contrib/rules_python …
rickeylev Apr 4, 2026
1f47ab5
fix is_windows bug, address gemini comments
rickeylev Apr 4, 2026
04fd4ee
format code
rickeylev Apr 4, 2026
34c7b37
fix missing arg, test_basic_windows analysis test
rickeylev Apr 4, 2026
5344aa0
fix test_debugger
rickeylev Apr 4, 2026
6fc07d7
fix/handle missing interpreter in bin
rickeylev Apr 4, 2026
a77e542
remove windows build_python_zip_true test
rickeylev Apr 4, 2026
d08770b
format
rickeylev Apr 4, 2026
815cacb
udno deleted packages change
rickeylev Apr 4, 2026
fb51a46
make zippapp + windows + venv work
rickeylev Apr 4, 2026
23783ff
Merge branch 'sys.py.win.venv' of https://github.com/rickeylev/rules_…
rickeylev Apr 4, 2026
8495123
remove extraneous zip_main logic
rickeylev Apr 5, 2026
e3ba016
Merge branch 'main' of https://github.com/bazel-contrib/rules_python …
rickeylev Apr 5, 2026
4ac1c81
Merge branch 'main' of https://github.com/bazel-contrib/rules_python …
rickeylev Apr 5, 2026
98aa09d
remove chmod+w, cleanup print_verbose
rickeylev Apr 5, 2026
27088fe
normpath, fix venv.interpreter_runfiles NPE
rickeylev Apr 5, 2026
1c069b9
special test configs
rickeylev Apr 5, 2026
fc800e8
fix zipapp bootstrap for windows
rickeylev Apr 6, 2026
d087713
cleanup python_bootstrap_template.txt a bit
rickeylev Apr 6, 2026
e0722d0
fix repl test
rickeylev Apr 6, 2026
78c62b2
doc missing arg
rickeylev Apr 6, 2026
bc9d121
format code
rickeylev Apr 6, 2026
887ebfb
fix some windows 10 settings for local_toolchains
rickeylev Apr 6, 2026
5a73954
Merge branch 'sys.py.win.venv' of https://github.com/rickeylev/rules_…
rickeylev Apr 6, 2026
085bc24
fix local toolchain
rickeylev Apr 6, 2026
132174a
fix glob for windows+linux
rickeylev Apr 6, 2026
5c51f06
format
rickeylev Apr 6, 2026
399a462
remove defunct comment
rickeylev Apr 6, 2026
96c5929
Merge branch 'sys.py.win.venv' of https://github.com/rickeylev/rules_…
rickeylev Apr 6, 2026
d771b76
fix dll include again
rickeylev Apr 6, 2026
6f26953
have a manifest of symlinks to work around windows+declare_symlink bugs
rickeylev Apr 8, 2026
711f758
format
rickeylev Apr 8, 2026
4a8260c
fix empty runtime venv symlinks handling
rickeylev Apr 8, 2026
454d3a6
fix buildifier warning
rickeylev Apr 8, 2026
b6fd07b
update zipper test
rickeylev Apr 8, 2026
4451571
re-enable zip cleanup
rickeylev Apr 8, 2026
c4d0643
have explicit symlinks add files to runfiles to ensure target exists
rickeylev Apr 8, 2026
5b4ebbb
format
rickeylev Apr 8, 2026
5093729
update zipper test
rickeylev Apr 8, 2026
9f77a5e
Merge branch 'main' of https://github.com/bazel-contrib/rules_python …
rickeylev Apr 8, 2026
2576dd1
format
rickeylev Apr 8, 2026
58307f5
fix relpath bug in zipper
rickeylev Apr 8, 2026
754790c
fix zipper test
rickeylev Apr 8, 2026
e301c14
add test to verify symlink is readable after extraction
rickeylev Apr 8, 2026
ff00bd3
fix zipapp build_manifest bad arg
rickeylev Apr 8, 2026
78eff68
fix zip_main hash calculation, was omitting inputs
rickeylev Apr 8, 2026
6110990
update zipper test
rickeylev Apr 8, 2026
c49bb5d
remove debug print
rickeylev Apr 8, 2026
8a03d79
handle symlink manifest entries in zip_main_maker
rickeylev Apr 8, 2026
23c4d87
fix zipper test for windows
rickeylev Apr 8, 2026
f5ef9d3
format code
rickeylev Apr 8, 2026
77d087d
rename specialized config
rickeylev Apr 9, 2026
93be441
add note that the file is generated
rickeylev Apr 9, 2026
49aa579
cleanup, expand nodeps test
rickeylev Apr 9, 2026
0c42698
cleanup var name
rickeylev Apr 9, 2026
311c166
Merge branch 'sys.py.win.venv' of https://github.com/rickeylev/rules_…
rickeylev Apr 9, 2026
a0f96de
make build_zip_enabled a one liner
rickeylev Apr 9, 2026
22a5d61
update changelog
rickeylev Apr 9, 2026
7696cae
copyedit changelog
rickeylev Apr 9, 2026
7deb7e2
format
rickeylev Apr 9, 2026
62b0dc9
remove defunct comment
rickeylev Apr 9, 2026
ace63ba
Merge branch 'sys.py.win.venv' of https://github.com/rickeylev/rules_…
rickeylev Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ common --enable_bzlmod
# Local disk cache greatly speeds up builds if the regular cache is lost
common --disk_cache=~/.cache/bazel/bazel-disk-cache


# Additional config to use for readthedocs builds.
# See .readthedocs.yml for additional flags that can only be determined from
# the runtime environment.
Expand All @@ -54,3 +55,6 @@ common --incompatible_no_implicit_file_export

build --lockfile_mode=update

import %workspace%/.bazelrc.specialized_configs

try-import user.bazelrc
12 changes: 12 additions & 0 deletions .bazelrc.specialized_configs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Helper config to run most tests without waiting an inordinate amount
# of time or freezing the system
common:fast-tests --build_tests_only=true
common:fast-tests --build_tag_filters=-large,-enormous,-integration-test
common:fast-tests --test_tag_filters=-large,-enormous,-integration-test

# Helper config for running a single test locally and investigating resulting state
common:testone --test_output=streamed
common:testone --test_strategy=standalone
common:testone --spawn_strategy=standalone
common:testone --strategy=standalone
12 changes: 12 additions & 0 deletions python/private/hermetic_runtime_repo_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ def define_hermetic_runtime_toolchain_impl(
_IS_FREETHREADED_YES: "cpython-{major}{minor}t".format(**version_dict),
_IS_FREETHREADED_NO: "cpython-{major}{minor}".format(**version_dict),
}),
# On Windows, a symlink-style venv requires supporting .dll files.
venv_bin_files = select({
"@platforms//os:windows": native.glob(
include = [
"*.dll",
],
# This must be true because glob empty-ness is checked
# during loading phase, before select() filters it out.
allow_empty = True,
),
"//conditions:default": [],
}),
)

py_runtime_pair(
Expand Down
12 changes: 6 additions & 6 deletions python/private/local_runtime_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ def _norm_path(path):
def _symlink_libraries(rctx, logger, libraries, shlib_suffix):
"""Symlinks the shared libraries into the lib/ directory.

Individual files are symlinked instead of the whole directory because
shared_lib_dirs contains multiple search paths for the shared libraries,
and the python files may be missing from any of those directories, and
any of those directories may include non-python runtime libraries,
as would be the case if LIBDIR were, for example, /usr/lib.

Args:
rctx: A repository_ctx object
logger: A repo_utils.logger object
libraries: paths to libraries to attempt to symlink.
shlib_suffix: Optional. Ensure that the generated symlinks end with this suffix.
Returns:
A list of library paths (under lib/) linked by the action.

Individual files are symlinked instead of the whole directory because
shared_lib_dirs contains multiple search paths for the shared libraries,
and the python files may be missing from any of those directories, and
any of those directories may include non-python runtime libraries,
as would be the case if LIBDIR were, for example, /usr/lib.
"""
result = []
for source in libraries:
Expand Down
13 changes: 13 additions & 0 deletions python/private/local_runtime_repo_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ def define_local_runtime_toolchain_impl(
implementation_name = implementation_name,
abi_flags = abi_flags,
pyc_tag = "{}-{}{}{}".format(implementation_name, major, minor, abi_flags),
venv_bin_files = select({
"@platforms//os:windows": native.glob(
include = [
"lib/*.dll",
# The pdb files just provide debugging information
"lib/*.pdb",
],
# This must be true because glob empty-ness is checked
# during loading phase, before select() filters it out.
allow_empty = True,
),
"//conditions:default": [],
}),
)

py_runtime_pair(
Expand Down
Loading