You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 5 profiles used for various purposes, and while each is configurable, you can't make your own profile. This would be useful for defining special profiles for a specific project. I personally would find a profiling profile useful to be able to enable both debugging and optimisations.
I propose supporting custom profiles, selected using --profile. The current profiles would just be predefined ones and I don't see why they couldn't be selected as well. A set of default values for the profile options will also need to be decided upon.
Reacted by Agi Sferro, Antoine Wendlinger, Alexander Bulaev, Tomas Korcak, Joe, Lucas Kent, Ayose C., delacian, Tim Zeitz, runiq and 10 more
I do think that this was one of the original intentions of profiles (cc @wycats, @carllerche), but there's also certainly a case to be made that if there are sets of options frequently used that Cargo should bake in those profiles! (and a profiling profile does seem like something that may commonly arise).
... which is really a superset of profiling, but also useful for shipping -dbg packages, etc.
Reacted by Andrei Kononov, Maik Klein, Antoine Wendlinger, Tomas Korcak, Alexander Bulaev, Ken Reed, Takahiro Ueda, runiq, Martin Krošlák, Jay Oster and 7 more
We're in a situation with Firefox where we'd like to ship our release binaries with LTO, but we want to disable it by default for local developer builds to save on build time. Unfortunately there's no straightforward way to do that. Being able to define a custom profile would be really useful here.
Reacted by Dan Aloni, delacian, Zoey, Boscop, Marcel Märtens, John Hagen, dbartussek and Vlad Frolov
# The publish profile, used for `cargo build --publish`.
[profile.publish]
# (...) everything else the same as profile.release except:lto = true# Enable full link-time optimization.codegen-units = 1# Use only 1 codegen-unit to enable full optimizations.
Reacted by Brian Anderson, Joel Gallant, Christopher Serr, Chris Vest and Brian Bruggeman
Activity
alexcrichton commentedon Sep 29, 2015
I do think that this was one of the original intentions of profiles (cc @wycats, @carllerche), but there's also certainly a case to be made that if there are sets of options frequently used that Cargo should bake in those profiles! (and a profiling profile does seem like something that may commonly arise).
carllerche commentedon Sep 29, 2015
Yep 👍
shepmaster commentedon Oct 2, 2015
I'd definitely love to have a
profileprofile, and having custom profiles seems like a nice pluggable way to do it.whitequark commentedon Jan 27, 2016
I would really like to have a relwithdebinfo profile, like CMake does:
... which is really a superset of profiling, but also useful for shipping -dbg packages, etc.
luser commentedon Aug 1, 2017
We're in a situation with Firefox where we'd like to ship our release binaries with LTO, but we want to disable it by default for local developer builds to save on build time. Unfortunately there's no straightforward way to do that. Being able to define a custom profile would be really useful here.
da-x commentedon Feb 15, 2018
I have a draft implementation here if anyone is interested.
Boscop commentedon Apr 9, 2018
I'm also interested in this.. I need 2
devprofiles, one withopt-level = 0and one withopt-level = 1.da-x commentedon Apr 9, 2018
I have updated my implementation and opened a pull request. #5326
johnthagen commentedon Jan 31, 2019
It would be nice to be able to have a fully optimized "release/publish" profile: rust-lang/rust#47745 (comment)
da-x commentedon Apr 6, 2019
RFC 2678 for this is opened.
ehuss commentedon Nov 15, 2019
This has been implemented, closing in favor of the tracking issue #6988.