Skip to content

"File size too large" error when making wheel #2852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tbarrella opened this issue May 2, 2025 · 3 comments · Fixed by #2711
Closed

"File size too large" error when making wheel #2852

tbarrella opened this issue May 2, 2025 · 3 comments · Fixed by #2711

Comments

@tbarrella
Copy link

🐞 bug report

Affected Rule

The issue is caused by the rule: py_wheel

Is this a regression?

Not sure

Description

Hello, it appears that when one of the deps for py_wheel has too large of a file size, building the target fails with

 raise RuntimeError("File size too large, try using force_zip64")

Docs for ZipFile.open say

When writing a file, if the file size is not known in advance but may exceed 2 GiB, pass force_zip64=True to ensure that the header format is capable of supporting large files. If the file size is known in advance, construct a ZipInfo object with file_size set, and use that as the name parameter.

Maybe it would make sense to use force_zip64=True here?

🔬 Minimal Reproduction

(don't have one currently)

🔥 Exception or Error


  ...
  File ".../external/rules_python+/tools/wheelmaker.runfiles/_main/../rules_python+/tools/wheelmaker.py", line 157, in add_file
    with self.open(zinfo, "w") as fdst:
  File "../external/rules_python++python+python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/zipfile.py", line 1201, in close
    raise RuntimeError("File size too large, try using force_zip64")

🌍 Your Environment

Operating System:

  
Linux x86_64
  

Output of bazel version:

  
8.1.1
  

Rules_python version:

  
1.3.0
  

Anything else relevant?

@rickeylev
Copy link
Collaborator

This should be fixed by #2852

However, that PR is held up on some small updates to some test hashes so some brittle tests pass.

I'm not sure when someone can get around to that last mile -- a patch/PR would be appreciated.

@rickeylev
Copy link
Collaborator

Oops, wrong link. PR #2711

github-merge-queue bot pushed a commit that referenced this issue May 3, 2025
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]>
@rickeylev
Copy link
Collaborator

One very long wait at Walgreens and one tiny phone screen web editor later, that PR is updated and merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants