Skip to content

deps: avoid pulling in zeroize_derive#720

Open
CathalMullan wants to merge 1 commit intozip-rs:masterfrom
CathalMullan:zeroize
Open

deps: avoid pulling in zeroize_derive#720
CathalMullan wants to merge 1 commit intozip-rs:masterfrom
CathalMullan:zeroize

Conversation

@CathalMullan
Copy link

This prevents pulling in any heavy proc macro deps (syn, quote, proc-macro2, etc).

@gemini-code-assist
Copy link
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 refines the project's dependency management by explicitly disabling an unnecessary feature flag for the zeroize crate. The primary goal is to reduce the overall build footprint and avoid pulling in large, often transitive, procedural macro dependencies, thereby contributing to a more efficient and streamlined build process.

Highlights

  • Dependency Optimization: Removed the zeroize_derive feature from the zeroize dependency in Cargo.toml. This change prevents the inclusion of heavy procedural macro dependencies such as syn, quote, and proc-macro2.
Changelog
  • Cargo.toml
    • Removed the zeroize_derive feature from the zeroize dependency declaration.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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
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 removes the zeroize_derive feature from the zeroize dependency to avoid pulling in heavy proc-macro dependencies. This is a good optimization. My review includes a suggestion to further minimize the dependency footprint by also disabling default features for zeroize, which is consistent with how other dependencies are configured in Cargo.toml.

Note: Security Review has been skipped due to the limited scope of the PR.

pbkdf2 = { version = "0.12", optional = true }
sha1 = { version = "0.10", optional = true }
zeroize = { version = "1.8", optional = true, features = ["zeroize_derive"] }
zeroize = { version = "1.8", optional = true }
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To further align with the goal of minimizing dependencies, consider adding default-features = false. This would disable the default std feature of the zeroize crate. Other dependencies in this file, such as nt-time and zstd, already use this setting, so making this change would improve consistency and further reduce the dependency footprint, which is particularly beneficial for no_std compatibility.

Suggested change
zeroize = { version = "1.8", optional = true }
zeroize = { version = "1.8", optional = true, default-features = false }

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