-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
A-profilesArea: profilesArea: profilesC-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.
Description
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:
- Bikeshedding the
inheritskeyword 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
testandbenchoutputs intarget/debugandtarget/release? Doing so would save compilation time and space. Deferred for future target layout reorg.- If so, is the
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.
- If so, is the
- Should the
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). - Update these commands to support custom named profiles:
-
check -
rustc -
fix - Any others? Fixed Named profile updates #9685
-
- What is the interaction with the (future) build profile and unified build directories? Reserved several names in Named profile updates #9685 for adding in the future.
- Consider making an uber profile above dev/release where build settings could be set (
root?)?
- Consider making an uber profile above dev/release where build settings could be set (
- How should automatic target-based profile selection work? For example, today,
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.
petrochenkov, MOZGIII, Veetaha, vibhoothi, Ameobea and 15 morelu-zero, MOZGIII and Veetahamati865, heidezomp, GeorgeHahn, xMAC94x, DianaNites and 11 more
Metadata
Metadata
Assignees
Labels
A-profilesArea: profilesArea: profilesC-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.
Type
Projects
Status
Done