Skip to content

Commit 86c65d7

Browse files
committed
cleanup debug stuff
1 parent 4207b10 commit 86c65d7

4 files changed

Lines changed: 24 additions & 7 deletions

File tree

python/private/py_executable_info.bzl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,17 @@ implementation isn't being used.
7979
:::
8080
""",
8181
"venv_app_symlinks": """
82-
todo
82+
:type: depset[ExplicitSymlink] | None
83+
84+
Symlinks that are specific to the application within the venv (e.g.
85+
dependencies).
86+
87+
Only used with Windows for files that would have used `declare_symlink()`
88+
to create relative symlinks. These may overlap with paths in runfiles; it's
89+
up to the consumer to determine how to handle such overlaps.
90+
91+
:::{versionadded} VERSION_NEXT_FEATURE
92+
:::
8393
""",
8494
"venv_interpreter_runfiles": """
8595
:type: runfiles | None

python/private/python_bootstrap_template.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,13 @@ def create_runfiles_root():
310310
return join(temp_dir, 'runfiles')
311311

312312
def _symlink_tree(link_from, link_to):
313-
# Ensure the source is an absolute path for valid symlinking
313+
# Ensure the source is an absolute path to simplify symlinking
314314
link_to_root = abspath(link_to)
315315
link_from_root = abspath(link_from)
316316

317317
# This is non-optimal because it recreates the entire
318318
# venv site-packages tree (as opposed to finding a highest-common
319-
# directory to symlink). But its easy and safe.
319+
# directory to symlink). But its easy and understandable.
320320
for root, dirs, files in os.walk(link_to_root):
321321
rel_path = os.path.relpath(root, link_to_root)
322322
link_from_dir = join(link_from_root, rel_path)

python/private/zipapp/py_zipapp_rule.bzl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
44
load("@rules_python_internal//:rules_python_config.bzl", rp_config = "config")
55
load("//python/private:attributes.bzl", "apply_config_settings_attr")
66
load("//python/private:builders.bzl", "builders")
7-
load("//python/private:common.bzl", "BUILTIN_BUILD_PYTHON_ZIP", "actions_run", "create_windows_exe_launcher", "is_windows_platform", "maybe_builtin_build_python_zip", "maybe_create_repo_mapping", "runfiles_root_path")
7+
load(
8+
"//python/private:common.bzl",
9+
"BUILTIN_BUILD_PYTHON_ZIP",
10+
"actions_run",
11+
"create_windows_exe_launcher",
12+
"is_windows_platform",
13+
"maybe_builtin_build_python_zip",
14+
"maybe_create_repo_mapping",
15+
"runfiles_root_path",
16+
)
817
load("//python/private:common_labels.bzl", "labels")
918
load("//python/private:py_executable_info.bzl", "PyExecutableInfo")
1019
load("//python/private:py_internal.bzl", "py_internal")

python/private/zipapp/zip_main_template.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ def extract_zip(zip_path, dest_dir):
194194
with open(file_path, "r") as f:
195195
target = f.read()
196196
os.remove(file_path)
197-
print_verbose("link", file_path, "to", target)
198197
if IS_WINDOWS:
199198
entry_path = normpath(join(dirname(info.filename), target))
200199
# Zip lookup uses forward slashes, target has backslashes.
@@ -227,7 +226,7 @@ def create_runfiles_root():
227226
extract_root = get_windows_path_with_unc_prefix(extract_root)
228227
else:
229228
extract_root = tempfile.mkdtemp("", "Bazel.runfiles_")
230-
shutil.rmtree(extract_root, True)
229+
231230
extract_zip(dirname(__file__), extract_root)
232231
print_verbose("extracted to:", extract_root)
233232
# IMPORTANT: Later code does `rm -fr` on dirname(runfiles_root) -- it's
@@ -368,7 +367,6 @@ def main():
368367
if _PYTHON_BINARY_VENV:
369368
python_program = finish_venv_setup(runfiles_root)
370369
else:
371-
assert False, "should be using venv"
372370
python_program = find_binary(runfiles_root, _PYTHON_BINARY_ACTUAL)
373371
if python_program is None:
374372
raise AssertionError(

0 commit comments

Comments
 (0)