-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo new: add a [profile.release]
section with commented out suggestions
#12769
Comments
In my experience, one of the biggest annoyances of package scaffolding is boilerplate that I have to remove. For example, I'm for removing the existing comment we have in #12210. If we were to do something like this, we'd need to keep in mind that |
I think rather than add this boilerplate to every
Various other options would be possible, such as Anyway regardless of the precise naming and semantics, I think the place to put this functionality is in Cargo itself, not in Cargo.toml when you first set up a project. |
I'm going to move to close this, and defer to #5151. In #6881 the team explicitly decided not to add more boilerplate or content to the default manifest beyond the link to the documentation. I realize discovery and education is difficult, but I think on balance adding a large section that everyone will need to delete has its own downsides. I'm not sure if configurable templates would be the solution, but I think it would be a pre-requisite if we were to decide to make this default to offer a simple way to turn it off. |
@rben01, thanks for the suggestion. Just FYI, there are some discussion out there in #12114 (comment), which is essentially |
Make sense. Thank you people for thinking over this issue. Going to close this in favor of #5151. See #12769 (comment). |
Problem
There are various options you can use to optimize a release build's runtime speed or binary size. I recently rewrote the section in The Rust Performance Book that discusses them. But lots of people don't know about them. We could make them more discoverable.
Proposed Solution
The
Cargo.toml
produced bycargo new
could include a[profile.release]
section with some of these options present but commented out, with a brief explanation. This idea was inspired by theconfig.example.toml
file in rustc, which does something similar and which I find extremely useful.Here is some possible text:
Notes
No response
The text was updated successfully, but these errors were encountered: