Skip to content

Enable true Zip64 support. #2714

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

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Enable true Zip64 support. #2714

merged 1 commit into from
Mar 10, 2025

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Mar 10, 2025

Allow the full range of PEXes under the Zip64 limit even on old Pythons.

Allow the full range of PEXes under the Zip64 limit even on old Pythons.
@jsirois
Copy link
Member Author

jsirois commented Mar 10, 2025

For example:

# N.B.: torch.pex build using Pex without this change and torch-zip64-mp.pex built with this change.
:; ls -1sb torch.pex torch-zip64-mp.pex
2991260 torch.pex
2990100 torch-zip64-mp.pex

# Note that the non-monkeypatched PEX is bigger.
# This is because Python thought it needed to write the extra Zip64 entries since the file
# was bigger than 2GB - the fake limit baked into Python we monkeypatched around here.

# The PEX _should_ be usable even by zip implementations without Zip64 support like the
# Python zipimporter C module, but it isn't.
:; python2.7 torch.pex -c ''
/home/jsirois/.pyenv/versions/2.7.18/bin/python2.7: can't find '__main__' module in 'torch.pex'

:; python3.13 torch.pex -c ''

# All fixed!
:; python2.7 torch-zip64-mp.pex -c ''

:; python3.13 torch-zip64-mp.pex -c ''

@jsirois jsirois merged commit 340ff65 into pex-tool:main Mar 10, 2025
26 checks passed
@jsirois jsirois deleted the zipapp/enable4G branch March 10, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant