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
Bikeshedding the inherits keyword name. Decided it should be fine.
Should we keep user profiles under a Toml namespace of their own? Decided to use a flat namespace for simplicity.
For example:
[profile.custom.release-lto]
inherits = "release"
lto = true
* If so, should the `inherits` keyword be able to refer to custom and pre-defined profiles differently?
Profile names would collide with rustc target names under target/. Should
the output directory be also under a different namespace, e.g. target/custom/release-lto? Decided to use a flat namespace.
Do we really need pre-defined profiles for test, bench, or can we make them obsolete? Will keep them for now.
Is it worthwhile keeping test and bench outputs in target/debug and target/release? Doing so would save compilation time and space. Deferred for future target layout reorg.
If so, is the dir-name keyword necessary? Alternatively, we can hand-code the output directory of bench and test to be release and debug to keep the current behavior. This may be sufficient until a "global binary cache" feature is implemented, or a per-workspace target/.cache (related discussion). Decided to not expose dir-name and just leave it as a special-case for the built-in profiles.
Should the PROFILE environment variable in build scripts be deprecated? Currently it only sets DEBUG or RELEASE, which isn't really useful. Should guide users to use DEBUG and OPT_LEVEL instead. Decided to deprecate PROFILE (via documentation).
Update these commands to support custom named profiles:
Consider making an uber profile above dev/release where build settings could be set (root?)?
How should automatic target-based profile selection work? For example, today, cargo build --all-targets automatically uses the "test" profile for tests. IIRC, named-profiles changes that behavior. I lean towards the original RFC, where it retains the original behavior, unless --profile is specified, but I am uncertain. Decided to go with a single profile per cargo invocation.
test inheriting from dev is a change in behavior, will that be a problem? Decided it shouldn't be a major issue.
RFC: rust-lang/rfcs#2678
Implementation: #6989
Docs: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#custom-named-profiles
Summary
Adds user-defined profile names.
Unresolved questions:
inheritskeyword name. Decided it should be fine.For example:
target/. Shouldthe output directory be also under a different namespace, e.g.
target/custom/release-lto? Decided to use a flat namespace.test,bench, or can we make them obsolete? Will keep them for now.testandbenchoutputs intarget/debugandtarget/release? Doing so would save compilation time and space. Deferred for future target layout reorg.dir-namekeyword necessary? Alternatively, we can hand-code the output directory ofbenchandtestto bereleaseanddebugto keep the current behavior. This may be sufficient until a "global binary cache" feature is implemented, or a per-workspacetarget/.cache(related discussion). Decided to not exposedir-nameand just leave it as a special-case for the built-in profiles.PROFILEenvironment variable in build scripts be deprecated? Currently it only setsDEBUGorRELEASE, which isn't really useful. Should guide users to useDEBUGandOPT_LEVELinstead. Decided to deprecate PROFILE (via documentation).checkrustcfixroot?)?cargo build --all-targetsautomatically uses the "test" profile for tests. IIRC, named-profiles changes that behavior. I lean towards the original RFC, where it retains the original behavior, unless--profileis specified, but I am uncertain. Decided to go with a single profile per cargo invocation.testinheriting fromdevis a change in behavior, will that be a problem? Decided it shouldn't be a major issue.