Skip to content

fix: remove zip64 comment and add zip64 extensible data sector#747

Merged
Pr0methean merged 31 commits intomasterfrom
remove-zip64
Apr 1, 2026
Merged

fix: remove zip64 comment and add zip64 extensible data sector#747
Pr0methean merged 31 commits intomasterfrom
remove-zip64

Conversation

@Its-Just-Nans
Copy link
Copy Markdown
Member

@Its-Just-Nans Its-Just-Nans commented Mar 22, 2026

The zip64_comment is not part of the ZIP specifications, it was previously added and was overriding the zip64_extensible_data_sector without using the correct format of zip64_extensible_data_sector

These methods are now doing nothing. The method set_comment() now truncate the comment if too long (more than u16::MAX

Related to

Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer bot left a comment

Choose a reason for hiding this comment

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

This PR removes the ZIP64 comment functionality from the codebase. While the changes are mostly mechanical and remove unused functionality, there is a critical logic error in the set_raw_comment method.

The removal of ZIP64 comment support changes behavior for comments exceeding 65,535 bytes - they are now silently discarded instead of being preserved. This is a breaking behavioral change that could cause data loss without any error indication to callers.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on removing the zip64_comment field throughout the codebase. This change simplifies the code, potentially reduces memory usage, and aligns with issue #436 and related discussions in pull request #247.

Highlights

  • ZIP64 Comment Removal: This PR removes the zip64_comment field and related logic from the codebase.
  • Code Simplification: The removal of the zip64_comment simplifies the code by removing conditional logic and data structures associated with it.
  • Dependency Reduction: By removing the zip64_comment, the code reduces its dependency on potentially large comment storage, optimizing memory usage.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly removes the concept of a zip64_comment, which doesn't exist in the ZIP64 specification, and instead correctly refers to the 'extensible data sector'. The changes are well-aligned with this goal. I've provided a couple of suggestions to complete the refactoring and improve the handling of long comments to prevent silent data loss.

@Its-Just-Nans Its-Just-Nans self-assigned this Mar 22, 2026
@Its-Just-Nans Its-Just-Nans changed the title fix: remove zip64 comment fix: remove zip64 comment and add zip64 extensible data sector Mar 23, 2026
@Its-Just-Nans
Copy link
Copy Markdown
Member Author

Its-Just-Nans commented Mar 23, 2026

Hi @Pr0methean

This MR removes the zip64 comment that does not exists in the spec (can you also confirm that?).
But it adds support for the zip64_extensible_data_sector

Also this MR adds a test to the check extensible data.

BUT we are forcing a field central_header_size to the max value to force the zip64.
If we don't do that, we don't have any way of knowing that the zip64 is a zip64 and has a zip64EndOfCentralDirectory

Technically we could use any field at the MAX value to force the file as zip64. That's in one of the latest commit
c56afd7

If you agree with that, I think this MR is nearly ready

@Pr0methean
Copy link
Copy Markdown
Member

I can confirm that there's no mention of the comment field that's specific to ZIP64, having examined all instances of the word "comment" in the APPNOTE.

@stepsecurity-app
Copy link
Copy Markdown
Contributor

Security Policy Alert: Secret Policy Violation

This workflow run has been blocked by StepSecurity's secrets policy because it accesses secrets and the workflow file differs from the default branch.

To approve this workflow, please add the workflows-approved label to this PR.

Note: The label must be added by someone other than the PR author (Its-Just-Nans) or automation bots to ensure proper security review.

After the label is added, you can re-run the blocked workflow to proceed.

This workflow will be automatically approved once merged into the default branch.

For more information, see StepSecurity's Secret Exfiltration Policy documentation.

@Pr0methean
Copy link
Copy Markdown
Member

Pr0methean commented Mar 24, 2026

Security Policy Alert: Secret Policy Violation

This workflow run has been blocked by StepSecurity's secrets policy because it accesses secrets and the workflow file differs from the default branch.

To approve this workflow, please add the workflows-approved label to this PR.

Note: The label must be added by someone other than the PR author (Its-Just-Nans) or automation bots to ensure proper security review.

After the label is added, you can re-run the blocked workflow to proceed.

This workflow will be automatically approved once merged into the default branch.

For more information, see StepSecurity's Secret Exfiltration Policy documentation.

@step-security-bot It'd be nice if you'd wait for the workflow-level if: conditions to pass before announcing this; in this case they didn't, and that will probably be true for almost all of the future PRs that touch our test code.

@Its-Just-Nans
Copy link
Copy Markdown
Member Author

Its-Just-Nans commented Mar 28, 2026

Hi @Pr0methean

I updated the MR fixing the comments

For me I think this should be a major bump.

But apparently (from obi1kenobi/cargo-semver-checks#1613), this is not a breaking change, and I discovered that semver in rust is definitively weird (https://predr.ag/blog/some-rust-breaking-changes-do-not-require-major-version/)

If we consider this a minor bump, a compilation could break if

  • there is a non traditional rust code usage (as some could say "non idiomatic real usage")
  • the end user is using some lints that disallow the non-handling of the newly added Result<>
  • other cases that I don't know for now

https://semver.org/
summary: 1. MAJOR version when you make incompatible API changes
see the clause 8. Major ... MUST be incremented if any backward incompatible changes are introduced to the public API

@Pr0methean Pr0methean enabled auto-merge April 1, 2026 01:51
@Pr0methean Pr0methean added this to the 8.5.0 milestone Apr 1, 2026
@Pr0methean
Copy link
Copy Markdown
Member

I guess in this case, the version bump is a judgement call where anything we choose will lead to complaints. But I suspect a minor bump will probably give us fewer complaints than a major bump in this case.

@Pr0methean Pr0methean added this pull request to the merge queue Apr 1, 2026
Merged via the queue into master with commit 2eb28b6 Apr 1, 2026
133 checks passed
@Pr0methean Pr0methean deleted the remove-zip64 branch April 1, 2026 06:35
@Pr0methean Pr0methean mentioned this pull request Apr 1, 2026
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.

2 participants