After compiling my program 'zagir', the release folder has the size of more than 200MiB, which is ridiculous for the program I have written. So, I tried to check whether only the 'zagir' executable runs in isolation and it did.
But the confusion is that, release folder also includes libzagir.rlib file along with .d files and a bunch of other folders.
Cargo.toml
[package]
authors = ["Sharad Chand"]
name = "zagir"
version = "0.1.0"
[dependencies]
bcrypt = "0.1.3"
dotenv = "0.10.1"
image = "0.17.0"
log = "0.3.8"
r2d2 = "0.7.3"
r2d2-diesel = "0.16.0"
rand = "0.3.16"
rocket = "0.3.2"
rocket_codegen = "0.3.2"
serde = "1.0.11"
serde_derive = "1.0.11"
serde_json = "1.0.2"
validator = "0.6.0"
validator_derive = "0.6.0"
[dependencies.bigdecimal]
features = ["serde"]
version = "0.0.10"
[dependencies.chrono]
features = ["serde"]
version = "0.4.0"
[dependencies.diesel]
features = [
"mysql",
"chrono",
"unstable",
"numeric",
"huge-tables",
]
version = "0.16.0"
[dependencies.diesel_codegen]
features = ["mysql"]
version = "0.16.0"
[dependencies.rocket_contrib]
features = ["handlebars_templates"]
version = "0.3.2"
[dependencies.uuid]
features = ["v4"]
version = "0.4"
The destination directory/folder to which files are sent.
*. d — Makefile-compatible dependency lists. *. rlib — Rust library files. Contain the compiled code of a dependency.
Which files from the target directory are actually required by the executable
None of them, other than the executable itself. By default, Rust produces statically-linked binaries.
The other files are merely build artifacts maintained by Cargo in order to make rebuilding your code more efficient. They include things like your dependencies.
A non-exhaustive sampling of some of the files you might find:
*.d
— Makefile-compatible dependency lists*.rlib
— Rust library files. Contain the compiled code of a dependencybuild
— Directories for build scripts to use as scratch spacedeps
— Your compiled dependenciesexamples
— Binaries from the examples
directoryincremental
— A directory for the incremental compilation cache*-{hash}
— Binaries from cargo test
Some of this is documented in the Cargo source code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With