Skip to content

Conversation

@weiznich
Copy link

During a dependency review we noticed that the zerocopy crate includes various development scripts and also test output for the compile tests in the published packages. Neither of that content is required for building zerocopy as dependency. Especially the development scripts shouldn't be there as they might, at some point become problematic. As of now they prevent any downstream user from enabling the [bans.build.interpreted] option of cargo deny.

I opted for using an explicit include list instead of an exclude list to prevent these files from beeing included in the published packages to make sure that everything that's included is an conscious choice.

During a dependency review we noticed that the zerocopy crate includes
various development scripts and also test output for the compile tests
in the published packages. Neither of that content is required for
building zerocopy as dependency. Especially the development scripts
shouldn't be there as they might, at some point become problematic. As
of now they prevent any downstream user from enabling the
`[bans.build.interpreted]` option of `cargo deny`.

I opted for using an explicit include list instead of an exclude list to
prevent these files from beeing included in the published packages to
make sure that everything that's included is an conscious choice.
@google-cla
Copy link

google-cla bot commented Dec 15, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @weiznich, 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 packaging process for the zerocopy crate by transitioning from a broad exclusion-based filtering mechanism to an explicit inclusion list within Cargo.toml. The primary goal is to ensure that only essential files are bundled with the published crate, thereby preventing the unintended inclusion of development scripts and test artifacts. This change significantly improves package hygiene and enhances compatibility with stricter cargo deny configurations, making the crate more robust for downstream consumers.

Highlights

  • Package Content Filtering: Switched from an exclude list to an explicit include list in Cargo.toml to precisely control which files are bundled in the published zerocopy crate.
  • Improved Package Hygiene: This change prevents the inclusion of development scripts and test output, which are not required for downstream users and can cause issues with tools like cargo deny.
  • Cargo Deny Compatibility: Resolves an issue where development scripts in published packages prevented downstream users from enabling the [bans.build.interpreted] option of cargo deny.
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 improves the packaging of the zerocopy crate by switching from an exclude list to an explicit include list in Cargo.toml. This is a best practice that ensures only necessary files are published to crates.io, excluding development scripts and other artifacts. The change is correct and effectively addresses the issue of superfluous files in the published package. The selected files for inclusion are appropriate for the crate's usage as a dependency.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.33%. Comparing base (151c20f) to head (90f1a95).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2851   +/-   ##
=======================================
  Coverage   92.33%   92.33%           
=======================================
  Files          20       20           
  Lines        5794     5794           
=======================================
  Hits         5350     5350           
  Misses        444      444           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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