Skip to content

Stream ZIP release members with ZIP64 headers - #534

Merged
Pedro Henrique Penna (ppenna) merged 2 commits into
microsoft:devfrom
jay23606:pr-scout/502-track-release-archive-bugs-zip64-streami
Oct 14, 2026
Merged

Pedro Henrique Penna (ppenna) merged 2 commits into
microsoft:devfrom
jay23606:pr-scout/502-track-release-archive-bugs-zip64-streami

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

Bug

create_reproducible_release_archive writes .zip release archives by opening each member with ZipFile.open(info, "w") without force_zip64. ZipInfo.file_size is left at its default of 0, so Python writes a non-ZIP64 local header. When a member's uncompressed size exceeds zipfile.ZIP64_LIMIT (2 GiB by default), close() raises RuntimeError: File size too large, try using force_zip64. The archive-release command then fails and no archive is produced. The .tar.gz path is not affected.

Change

Pass force_zip64=True when opening each streamed ZIP member in scripts/nvx_tools/archive.py. The streaming copy, the checksum and snapshot validation, and the reproducible metadata are unchanged.

Testing

Added test_zip_release_archive_streams_members_past_zip64_limit, which patches zipfile.ZIP64_LIMIT to 1024 bytes and archives a 4096-byte member. On the unfixed code it fails with RuntimeError: File size too large, try using force_zip64. With the fix it passes.

Checks run:

  • cd scripts && python -m unittest test_nvx_tools.SharedFileTests.test_zip_release_archive_streams_members_past_zip64_limit (exit 0, OK)
  • cd scripts && python -m unittest test_nvx_tools.SharedFileTests.test_release_archives_are_reproducible_with_fixed_layout_and_modes (exit 0, OK)

Regression test: fails on base twice (/RuntimeError: File size too large, try using force_zip64/), passes on fix twice (cd scripts && python -m unittest test_nvx_tools.SharedFileTests.test_zip_release_archive_streams_members_past_zip64_limit)

Fixes #502

Copilot AI balanced review requested due to automatic review settings October 13, 2026 21:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fix addresses the reported failure and includes an effective regression test.

0 open findings

What changed in this PR

Fixes ZIP release creation for streamed members exceeding the ZIP64 size limit.

Changes:

  • Forces ZIP64 headers for streamed ZIP members.
  • Adds a regression test using a reduced ZIP64 threshold.
File Description
scripts/​nvx_tools/​archive.py Enables ZIP64 for streamed members.
scripts/​test_nvx_tools.py Verifies large streamed members archive correctly.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 14:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fix correctly addresses the ZIP64 failure and includes adequate regression coverage.

0 open findings

🧠 Review effort: Balanced

@ppenna
Pedro Henrique Penna (ppenna) merged commit 8438357 into microsoft:dev Oct 14, 2026
29 checks passed
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.

Track release archive bugs: ZIP64 streaming fails for large files

3 participants