Skip to content

Conversation

@weiznich
Copy link

During a dependency review I noticed that thiserror includes the output of it's compile tests in the published package. These files are not required for building thiserror as dependency and make it a bit harder to review the code.

This commit introduces a include directive in the Cargo.toml file to explicitly include only those files required to build thiserror. This excludes the compile test artifacts and also reduces the size of the published crate from 105 files, 113.9KiB (28.2KiB compressed) to 26 files, 86.6KiB (21.5KiB compressed) which results in a 217GB/Month traffic reduction for crates.io assuming the current 34 million downloads and the difference in the compressed package size.


Completely removing the tests would reduce the package size to 15 files, 49.1KiB (14.9KiB compressed), although I'm not sure if you are open to do that.

During a dependency review I noticed that thiserror includes the output
of it's compile tests in the published package. These files are not
required for building thiserror as dependency and make it a bit harder
to review the code.

This commit introduces a `include` directive in the `Cargo.toml` file to
explicitly include only those files required to build `thiserror`. This
excludes the compile test artifacts and also reduces the size of the
published crate from 105 files, 113.9KiB (28.2KiB compressed) to
26 files, 86.6KiB (21.5KiB compressed) which results in a 217GB/Month
traffic reduction for crates.io assuming the current 34 million
downloads and the difference in the compressed package size.
Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Closing along with dtolnay/quote#304.

@dtolnay dtolnay closed this Oct 20, 2025
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