Skip to content

Commit ce15684

Browse files
committed
remove custom profiles
1 parent 492e63b commit ce15684

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

text/0000-custom-cargo-profiles.md renamed to text/0000-profile-dependencies.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- Feature Name: custom_cargo_profiles
1+
- Feature Name: profile_dependencies
22
- Start Date: 2018-01-08
33
- RFC PR: (leave this empty)
44
- Rust Issue: (leave this empty)
@@ -7,7 +7,7 @@
77
# Summary
88
[summary]: #summary
99

10-
Add the ability to create custom profiles in Cargo.toml, to provide further control over how the project is built. Allow overriding profile keys for certain dependency trees.
10+
Allow overriding profile keys for certain dependencies, as well as providing
1111

1212
# Motivation
1313
[motivation]: #motivation
@@ -16,28 +16,23 @@ Currently the "stable" way to tweak build parameters like "debug symbols", "debu
1616

1717
This file is typically checked in tree, so for many projects overriding things involves making
1818
temporary changes to this, which feels hacky. On top of this, if Cargo is being called by an
19-
encompassing build system as what happens in Firefox, these changes can seem surprising. There are
20-
currently two main profiles in Cargo ("dev" and "release"), and we're forced to fit everything we
21-
need into these two categories. This isn't really enough.
19+
encompassing build system as what happens in Firefox, these changes can seem surprising.
2220

23-
Furthermore, this doesn't allow for much customization. For example, when trying to optimize for
21+
This also doesn't allow for much customization. For example, when trying to optimize for
2422
compilation speed by building in debug mode, build scripts will get built in debug mode as well. In
2523
case of complex build-time dependencies like bindgen, this can end up significantly slowing down
2624
compilation. It would be nice to be able to say "build in debug mode, but build build dependencies
2725
in release". Also, your program may have large dependencies that it doesn't use in critical paths,
2826
being able to ask for just these dependencies to be run in debug mode would be nice.
2927

28+
3029
# Guide-level explanation
3130
[guide-level-explanation]: #guide-level-explanation
3231

3332

3433
Currently, the [Cargo guide has a section on this](http://doc.crates.io/manifest.html#the-profile-sections).
3534

36-
We amend this to add that you can define custom profiles with the `profile.foo` key syntax. These can be invoked via
37-
`cargo build --profile foo`. The `dev`/`doc`/`bench`/etc profiles remain special. Each custom profile, aside from the
38-
"special" ones, gets a folder in `target/`, named after the profile. "dev" and "debug" are considered to be aliases
39-
40-
Profile keys can be "overridden":
35+
We amend this to add that you can override dependency configurations via `profile.foo.overrides`:
4136

4237
```toml
4338
[profile.dev]
@@ -59,8 +54,8 @@ opt-level = 2
5954
opt-level = 3
6055
```
6156

62-
Custom profiles _can_ be listed in a `.cargo/config`. When building cargo will calculate
63-
the current profile, and if it has changed, it will do a fresh/clean build.
57+
Additionally, profiles may be listed in `.cargo/config`. When building, cargo will calculate the
58+
current profile, and if it has changed, it will do a fresh/clean build.
6459

6560
# Reference-level explanation
6661
[reference-level-explanation]: #reference-level-explanation

0 commit comments

Comments
 (0)