Skip to content

Commit ccbe5dc

Browse files
devtbirickeylev
andauthored
py_wheel: always generate zip64-capable wheels (#2711)
Currently, there is no possibility to pass the force zip64 option to the wheel creation. This hinders creation of packages that contain >2Gb files (e.g. large projects with debug symbols). To fix, always generate zip64 capable wheels. zip64 support is wide spread. Fixes #2852 --------- Co-authored-by: Richard Levasseur <[email protected]> Co-authored-by: Richard Levasseur <[email protected]>
1 parent 8e76bd4 commit ccbe5dc

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ END_UNRELEASED_TEMPLATE
5454

5555
{#v0-0-0-changed}
5656
### Changed
57+
5758
* (rules) On Windows, {obj}`--bootstrap_impl=system_python` is forced. This
5859
allows setting `--bootstrap_impl=script` in bazelrc for mixed-platform
5960
environments.
6061
* (rules) {obj}`pip_compile` now generates a `.test` target. The `_test` target is deprecated
6162
and will be removed in the next major release.
6263
([#2794](https://github.com/bazel-contrib/rules_python/issues/2794)
64+
* (py_wheel) py_wheel always creates zip64-capable wheel zips
6365

6466
{#v0-0-0-fixed}
6567
### Fixed

examples/wheel/test_publish.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_upload_and_query_simple_api(self):
104104
</head>
105105
<body>
106106
<h1>Links for example-minimal-library</h1>
107-
<a href="/packages/example_minimal_library-0.0.1-py3-none-any.whl#sha256=a73acae23590c7a8d4365c888c1f12f0399b7af27169ea99fc7a00f402833926">example_minimal_library-0.0.1-py3-none-any.whl</a><br>
107+
<a href="/packages/example_minimal_library-0.0.1-py3-none-any.whl#sha256=ef5afd9f6c3ff569ef7e5b2799d3a2ec9675d029414f341e0abd7254d6b9a25d">example_minimal_library-0.0.1-py3-none-any.whl</a><br>
108108
</body>
109109
</html>"""
110110
self.assertEqual(

examples/wheel/wheel_test.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_py_library_wheel(self):
8585
],
8686
)
8787
self.assertFileSha256Equal(
88-
filename, "a73acae23590c7a8d4365c888c1f12f0399b7af27169ea99fc7a00f402833926"
88+
filename, "ef5afd9f6c3ff569ef7e5b2799d3a2ec9675d029414f341e0abd7254d6b9a25d"
8989
)
9090

9191
def test_py_package_wheel(self):
@@ -110,7 +110,7 @@ def test_py_package_wheel(self):
110110
],
111111
)
112112
self.assertFileSha256Equal(
113-
filename, "a76001500453dbd1d778821dcaba165d56db502c854cef9381dd3f8f89caee11"
113+
filename, "39bec133cf79431e8d057eae550cd91aa9dfbddfedb53d98ebd36e3ade2753d0"
114114
)
115115

116116
def test_customized_wheel(self):
@@ -206,7 +206,7 @@ def test_customized_wheel(self):
206206
second = second.main:s""",
207207
)
208208
self.assertFileSha256Equal(
209-
filename, "941c0d79f4ca67cfa0028248bd0606db7fc69953ff9c7c73ac26a3e6d3c23587"
209+
filename, "685f68fc6665f53c9b769fd1ba12cce9937ab7f40ef4e60c82ef2de8653935de"
210210
)
211211

212212
def test_filename_escaping(self):
@@ -278,7 +278,7 @@ def test_custom_package_root_wheel(self):
278278
for line in record_contents.splitlines():
279279
self.assertFalse(line.startswith("/"))
280280
self.assertFileSha256Equal(
281-
filename, "7bd959b7efe9e325b30a6559177a1a4f22ac7a68fade310845916276110e9287"
281+
filename, "2fbfc3baaf6fccca0f97d02316b8344507fe6c8136991a66ee5f162235adb19f"
282282
)
283283

284284
def test_custom_package_root_multi_prefix_wheel(self):
@@ -312,7 +312,7 @@ def test_custom_package_root_multi_prefix_wheel(self):
312312
for line in record_contents.splitlines():
313313
self.assertFalse(line.startswith("/"))
314314
self.assertFileSha256Equal(
315-
filename, "caf51e22bdcd3c6c766c8903319ce717daeb6caac577d14e16326a8597981854"
315+
filename, "3e67971ca1e8a9ba36a143df7532e641f5661c56235e41d818309316c955ba58"
316316
)
317317

318318
def test_custom_package_root_multi_prefix_reverse_order_wheel(self):
@@ -346,7 +346,7 @@ def test_custom_package_root_multi_prefix_reverse_order_wheel(self):
346346
for line in record_contents.splitlines():
347347
self.assertFalse(line.startswith("/"))
348348
self.assertFileSha256Equal(
349-
filename, "9e8c0baa408b829dec691a5e8d3bc040be0bbfcc95c0eee19e1e5ffadea4a059"
349+
filename, "372ef9e11fb79f1952172993718a326b5adda192d94884b54377c34b44394982"
350350
)
351351

352352
def test_python_requires_wheel(self):
@@ -371,7 +371,7 @@ def test_python_requires_wheel(self):
371371
""",
372372
)
373373
self.assertFileSha256Equal(
374-
filename, "b47f3eaf4f9fa4685a58c7415ba1feddd39635ae26c18473504f7d7e62e8ce07"
374+
filename, "10a325ba8f77428b5cfcff6345d508f5eb77c140889eb62490d7382f60d4ebfe"
375375
)
376376

377377
def test_python_abi3_binary_wheel(self):
@@ -436,7 +436,7 @@ def test_rule_creates_directory_and_is_included_in_wheel(self):
436436
],
437437
)
438438
self.assertFileSha256Equal(
439-
filename, "d8e874b807e5574bd11a9312c58ce7fe7055afb80412d0d0e7ed21fc9223cd53"
439+
filename, "85e44c43cc19ccae9fe2e1d629230203aa11791bed1f7f68a069fb58d1c93cd2"
440440
)
441441

442442
def test_rule_expands_workspace_status_keys_in_wheel_metadata(self):

tools/wheelmaker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def arcname_from(name):
154154
hash = hashlib.sha256()
155155
size = 0
156156
with open(real_filename, "rb") as fsrc:
157-
with self.open(zinfo, "w") as fdst:
157+
with self.open(zinfo, "w", force_zip64=True) as fdst:
158158
while True:
159159
block = fsrc.read(2**20)
160160
if not block:

0 commit comments

Comments
 (0)