Exclude compile tests from the published package #436
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
includedirective in theCargo.tomlfile to explicitly include only those files required to buildthiserror. 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.