Skip to content

Remove images from published crates.io source code #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025

Conversation

weiznich
Copy link
Contributor

While reviewing dependencies I noticed that the published source code of the afl crate includes binary data (images). Removing them reduces the size of the published tar-ball from 1.3MB to 6KB, which is a size reduction of several orders of magnitude. This would save crates.io more than 125GB of traffik per 90 days according to their download numbers.

There are two main benifits of that change:

  • Drastical reduction of download size
  • Removes binary data from a crates that contains a build script, which hopefully makes the crate a bit more robust against potential supply chain attacks similar to the xz incident.

The images seem to be used in the Readme. I've replaced them with links to the images hosted at github there so that the readme is still rendered correctly at crates.io.

Copy link
Member

@smoelius smoelius left a comment

Choose a reason for hiding this comment

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

Thank you very much for this.

afl/Cargo.toml Outdated
@@ -11,6 +11,7 @@ description = "Fuzzing Rust code with american-fuzzy-lop"
repository = "https://github.com/rust-fuzz/afl.rs"
homepage = "https://github.com/rust-fuzz/afl.rs"
edition = "2021"
include = ["README.md", "build.rs", "src/**/*.rs", "examples/**/*.rs"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
include = ["README.md", "build.rs", "src/**/*.rs", "examples/**/*.rs"]
exclude = ["etc"]

I am afraid the include would cause something to break down the road, and that I would forget it was there.

Could I impose on you to make the same change here?

edition = "2021"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, no problem

I've pushed an update changing that.

I personally prefer the explicit include syntax as it also prevents accidentally including other stuff that happens to be around while doing a cargo publish.

Copy link
Member

Choose a reason for hiding this comment

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

I personally prefer the explicit include syntax as it also prevents accidentally including other stuff that happens to be around while doing a cargo publish.

Your point is well taken, and I might change my mind in six months. :)

Thanks again. 🙏

While reviewing dependencies I noticed that the published source code of
the `afl` crate includes binary data (images). Removing them reduces the
size of the published tar-ball from 1.3MB to 6KB, which is a size
reduction of several orders of magnitude. This would save crates.io more
than 125GB of traffik per 90 days according to their download numbers.

There are two main benifits of that change:

* Drastical reduction of download size
* Removes binary data from a crates that contains a build script, which
  hopefully makes the crate a bit more robust against potential supply
chain attacks similar to the xz incident.

The images seem to be used in the Readme. I've replaced them with links
to the images hosted at github there so that the readme is still
rendered correctly at crates.io.
@weiznich weiznich force-pushed the feature/remove_pictures branch from dfa27e6 to f662d19 Compare May 28, 2025 09:12
@smoelius smoelius added this pull request to the merge queue May 29, 2025
Merged via the queue into rust-fuzz:master with commit 484c2cd May 29, 2025
18 checks passed
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