Skip to content

Commit ec4e73b

Browse files
committed
Shorten Windows wheel repositories for default path limits
1 parent d6aa126 commit ec4e73b

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ single_version_override(
1919
module_name = "rules_python",
2020
patches = [
2121
"//third_party/rules_python:pip_repository_host_platform.patch",
22+
"//third_party/rules_python:windows_short_wheel_names.patch",
2223
"//third_party/rules_python:zipapp_explicit_init.patch",
2324
],
2425
)

third_party/rules_python/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414

1515
exports_files([
1616
"pip_repository_host_platform.patch",
17+
"windows_short_wheel_names.patch",
1718
"zipapp_explicit_init.patch",
1819
])
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Keep hashed Windows wheel repository names below MAX_PATH. The pip hub already
2+
includes the Python version and the wheel digest uniquely identifies its ABI
3+
and platform, so those tags do not need to appear in the repository path too.
4+
5+
--- python/private/pypi/whl_repo_name.bzl
6+
+++ python/private/pypi/whl_repo_name.bzl
7+
@@ -55,9 +55,8 @@
8+
platform_tag, _, _ = parsed.platform_tag.partition(".")
9+
10+
parts.append(name)
11+
- parts.append(python_tag)
12+
- parts.append(abi_tag)
13+
- parts.append(platform_tag)
14+
+ if not (digest and platform_tag.startswith("win_")):
15+
+ parts.extend([python_tag, abi_tag, platform_tag])
16+
17+
if digest:
18+
parts.append(digest[:8])

0 commit comments

Comments
 (0)