the-lean-crate / cargo-diet

A cargo-companion to become a 'lean crate' (a member of The Lean Crate Initiative)
https://github.com/the-lean-crate/criner
MIT License
156 stars 3 forks source link

Feature: Automatically use lto in release #8

Closed Milo123459 closed 3 years ago

Milo123459 commented 3 years ago

Just automatically add:

[profile.release]
lto = "fat"
Byron commented 3 years ago

No argument was provided to explain why this would be valuable. When thinking about this, I can only come up with an argument against such feature: cargo diet is about keeping crates packages small, it isn't concerned with binary size.

Please feel free to provide arguments on the closed issue though, maybe I am not seeing something.

Milo123459 commented 3 years ago

Well, if you can make the binary smaller, isn't the crate smaller? Or am I missing something?

Byron commented 3 years ago

Well, if you can make the binary smaller, isn't the crate smaller?

The crate is a package containing source code to build the binary or other artifacts, not every crate produced binaries. cargo diet only means to slim down the amount of source code shipped in these crates and leaves configuring artifacts entirely to the crate owners. Changing build settings really isn't anything where one size fits all.

Milo123459 commented 3 years ago

I see, I think I must've misunderstood a few things along the line.. Mb!