-
-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(config): Add build.profile, install.profile #17215
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -71,6 +71,7 @@ rustc-wrapper = "…" # run this wrapper instead of `rustc` | |||||
| rustc-workspace-wrapper = "…" # run this wrapper instead of `rustc` for workspace members | ||||||
| rustdoc = "rustdoc" # the doc generator tool | ||||||
| target = "triple" # build for the target triple (ignored by `cargo install`) | ||||||
| profile = "dev" # build using the specified profile (ignored by `cargo install`) | ||||||
| target-dir = "target" # path of where to place generated artifacts | ||||||
| build-dir = "target" # path of where to place intermediate build artifacts | ||||||
| rustflags = ["…", "…"] # custom flags to pass to all compiler invocations | ||||||
|
|
@@ -119,6 +120,7 @@ user-agent = "…" # the user-agent header | |||||
|
|
||||||
| [install] | ||||||
| root = "/some/path" # `cargo install` destination directory | ||||||
| profile = "release" # build using the specified profile | ||||||
|
|
||||||
| [net] | ||||||
| retry = 3 # network retries | ||||||
|
|
@@ -544,6 +546,22 @@ Can be overridden with the `--target` CLI option. | |||||
| target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"] | ||||||
| ``` | ||||||
|
|
||||||
| #### `build.profile` | ||||||
| * Type: string | ||||||
| * Default: `"dev"` | ||||||
| * Environment: `CARGO_BUILD_PROFILE` | ||||||
|
|
||||||
| The default [profile] to compile with. | ||||||
|
Comment on lines
+551
to
+554
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this might need to be expanded. For example, explaing what scope it apply to, and the relationship with (It's okay to be a bit vague, if we plan to change it in the future) |
||||||
|
|
||||||
| Can be overridden with the `--release` or `--profile` CLI options. | ||||||
|
|
||||||
| ```toml | ||||||
| [build] | ||||||
| profile = "debug" | ||||||
| ``` | ||||||
|
|
||||||
| > **MSRV:** Respected as of 1.100. | ||||||
|
|
||||||
| #### `build.target-dir` | ||||||
| * Type: string (path) | ||||||
| * Default: `"target"` | ||||||
|
|
@@ -921,6 +939,26 @@ your home directory). | |||||
|
|
||||||
| Can be overridden with the `--root` command-line option. | ||||||
|
|
||||||
| #### `install.profile` | ||||||
| * Type: string | ||||||
| * Default: `"release"` | ||||||
| * Environment: `CARGO_INSTALL_PROFILE` | ||||||
|
|
||||||
| The default [profile] to compile with. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not clear what it is associated with. I don't think
Suggested change
|
||||||
|
|
||||||
| Can be overridden with the `--debug` or `--profile` CLI options. | ||||||
|
|
||||||
| ```toml | ||||||
| [install] | ||||||
| profile = "tool" | ||||||
|
|
||||||
| [profile.tool] | ||||||
| inherits = "release" | ||||||
| lto = true | ||||||
| ``` | ||||||
|
|
||||||
| > **MSRV:** Respected as of 1.100. | ||||||
|
|
||||||
| ### `[net]` | ||||||
|
|
||||||
| The `[net]` table controls networking configuration. | ||||||
|
|
@@ -1551,6 +1589,7 @@ Report progress to the terminal emulator for display in places like the task bar | |||||
| [source replacement]: source-replacement.md | ||||||
| [revision]: https://git-scm.com/docs/gitrevisions | ||||||
| [registries]: registries.md | ||||||
| [profile]: profiles.md | ||||||
| [`cargo:token`]: registry-authentication.md#cargotoken | ||||||
| [crates.io]: https://crates.io/ | ||||||
| [target triple]: ../appendix/glossary.md#target '"target" (glossary)' | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we communicate and document this? Do we need to decide before proceeding?
View changes since the review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My assumption is that this will behave as people expect and the only documentation burden is on the fields. If there is something I'm overlooking, let me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented in other threads.