LukeMathWalker / zero-to-production

Code for "Zero To Production In Rust", a book on API development using Rust.
https://www.zero2prod.com
Apache License 2.0
5.73k stars 491 forks source link

oversized release artifact #218

Closed danirdd92 closed 1 year ago

danirdd92 commented 1 year ago

I'm not really sure why, but I get anywhere between 1.4 to 2.5gigs worth of build artifact after cargo build --release there's absolutely no way it should be that way

LukeMathWalker commented 1 year ago

Quite possible that's correct, if you are counting the entire target folder. But the binary itself is tiny in comparison—see chapter 5 when we talk about Docker image sizes.

danirdd92 commented 1 year ago

@LukeMathWalker is the binary the only thing that's needed to run the application? what is the purpose of the rest of the artifacts?

LukeMathWalker commented 1 year ago

Yes, binaries are self-contained. The rest of the artefacts are the outputs of intermediate steps which speed up the following compilation runs.