Commit graph

23 commits

Author SHA1 Message Date
Eric Huss 7eb007ddbf Add reasons to all ignored tests. 2022-08-02 12:24:00 -07:00
Scott Schafer 4bc8fe85bd remove unneeded nightly flags from various tests 2022-07-14 19:55:44 -05:00
Eric Huss 595384ffda Add future compatibility warning on mixture of --release with --profile.
This was historically allowed, but it silently ignores the --release flag.
2021-09-24 10:59:00 -07:00
Eric Huss 895f52714c Stabilize named profiles. 2021-09-24 10:00:42 -07:00
Eric Huss 49cf3de927 Fix rustc --profile=dev unstable check. 2021-09-10 09:40:37 -07:00
Eric Huss 73dba767d1 Support custom profiles in legacy commands.
This makes the following changes:

- Allows `cargo check`, `cargo fix`, and `cargo rustc` to support custom
  named profiles. This retains the legacy behavior of those commands.
- Fixes `cargo bench` so that it supports custom named profiles.
2021-07-13 15:22:09 -07:00
Eric Huss 51dc5db4e2 Reserve some names for named profiles.
Just to give a little flexibility in the future in case we want to use
these, or that they could cause confusion. Also updated the error text a
little.
2021-07-13 11:59:15 -07:00
Eric Huss 090eb4277f Disable the dir-name profile setting.
dir-name primarily exists for translating the built-in profiles. In
order to simplify the UI, we would like to not expose it to the user for
the initial stabilization. The code to support it is kept in case we
want to add it in the future.
2021-07-13 11:38:11 -07:00
Eric Huss 6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Eric Huss 77ee608de3 Add named config profiles. 2020-01-13 13:27:33 -08:00
bors b35bb1b9b7 Auto merge of #7591 - ehuss:stabilize-profile-overrides, r=alexcrichton
Stabilize profile-overrides.

This stabilizes the profile-overrides feature. This was proposed in [RFC 2282](https://github.com/rust-lang/rfcs/pull/2282) and implemented in #5384. Tracking issue is https://github.com/rust-lang/rust/issues/48683.

This is intended to land in 1.41 which will reach the stable channel on Jan 30th.

This includes a new documentation chapter on profiles. See the ["Overrides" section](9c993a92ce/src/doc/src/reference/profiles.md (overrides)) in `profiles.md` file for details on what is being stabilized.

Note: The `config-profile` and `named-profiles` features are still unstable.

Closes #6214

**Concerns**
- There is some risk that `build-override` may be confusing with the [proposed future dedicated `build` profile](https://github.com/rust-lang/cargo/pull/6577). There is some more discussion about the differences at https://github.com/rust-lang/rust/issues/48683#issuecomment-445571286. I don't expect it to be a significant drawback. If we proceed later with a dedicated `build` profile, I think we can handle explaining the differences in the documentation. (The linked PR is designed to work with profile-overrides.)
- I don't anticipate any unexpected interactions with `config-profiles` or `named-profiles`.
- Some of the syntax like `"*"` or `build-override` may not be immediately obvious what it means without reading the documentation. Nobody suggested any alternatives, though.
- Configuring overrides for multiple packages is currently a pain, as you have to repeat the settings separately for each package. I propose that we can extend the syntax in the future to allow a comma-separated list of package names to alleviate this concern if it is deemed worthwhile.
- The user may not know which packages to override, particularly for some dependencies that are split across multiple crates. I think, since this is an advanced feature, the user will likely be comfortable with using things like `cargo tree` to understand what needs to be overridden. There is [some discussion](https://github.com/rust-lang/rust/issues/48683#issuecomment-473356415) in the tracking issue about automatically including a package's dependencies, but this is somewhat complex.
- There is some possibly confusing interaction with the test/bench profile. Because dependencies are always built with the dev/release profiles, overridding test/bench usually does not have an effect (unless specifying a workspace member that is being tested/benched). Overriding test/bench was previously prohibited, but was relaxed when named profiles were added.
- We may want to allow overriding the `panic`, `lto`, and `rpath` settings in the future. I can imagine a case where someone has a large workspace, and wants to override those settings for just one package in the workspace. They are currently not allowed because it doesn't make sense to change those settings for rlibs, and `panic` usually needs to be in sync for the whole profile.
- There are some strange interactions with `dylib` crates detailed in https://github.com/rust-lang/rust/issues/64319. A fix was attempted, but later reverted. Since `dylib` crates are rare (this mostly applied to `libstd`), and a workaround was implemented for `build-std` (it no longer builds a dylib), I'm not too worried about this.
- The interaction with `share-generics` can be quite confusing (see https://github.com/rust-lang/rust/issues/63484). I added a section in the docs that tries to address this concern. It's also possible future versions of `rustc` may handle this better.
- The new documentation duplicates some of the information in the rustc book.  I think it's fine, as there are subtle differences, and it avoids needing to flip back and forth between the two books to learn what the settings do.
2019-12-02 15:54:59 +00:00
Eric Huss 83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Eric Huss dda81d3177 Stabilize profile-overrides. 2019-11-15 17:13:55 -08:00
Eric Huss fcfe0b8988 Rename overrides to package in profiles. 2019-10-10 14:39:30 -07:00
Dan Aloni 3307176326 tests: profile_custom - add name validation tests 2019-09-21 10:29:32 +03:00
Dan Aloni a50be59a70 Rustfmt adjustments 2019-09-21 09:37:06 +03:00
Dan Aloni bf5f0b7c3a tests: profile_custom - add missing stdout/stderr checks 2019-09-21 09:37:06 +03:00
Dan Aloni 6cd8e87dea tests: profile_custom - test for invalid 'inherits' use on root profile 2019-09-21 09:37:06 +03:00
Dan Aloni 375a46f18b Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-18 08:56:13 +03:00
Dan Aloni ffc24e03d2 testsuite: profile_custom - add clean_custom_dirname 2019-09-12 20:40:18 +03:00
Dan Aloni ea2b1b5c2c testsuite: profile_custom - add conflicting_usage 2019-09-12 20:27:53 +03:00
Dan Aloni ac2a4382ee Rustfmt fixes 2019-09-12 17:13:40 +03:00
Dan Aloni 593641dc93 testsuite: introduce profile_custom
This suite of tests verifies various cases around the 'inherits'
keyword, and also verifies the relationship between profile overrides
and custom profiles.
2019-09-12 17:05:15 +03:00