Which files from the target directory are actually required by the executable?

Viewed 4111

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.

  1. What exactly are they?
  2. Are they really required?
  3. Am I going to get error during execution when those files are ignored?
  4. What are the files I should bundle for a complete executable?

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"
1 Answers
Related