Open
Description
Summary
Original issue: #7878
Implementation: #10217
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-rustflags-option
The profile-rustflags
feature allows setting RUSTFLAGS per-profile.
Unresolved Issues
- How should things interact with rustdoc? If there is a flag that is required to correctly build a project, then
cargo test
may fail if they aren't passed to rustdoc. However, rustdoc doesn't accept all of rustc's flags. Adding arustdocflags
option seems to be adding more unwanted complexity, though. - This introduces potential backwards-compatibility hazards. For example, when Cargo adds new features or changes the way it invokes rustc, that can interfere with pre-existing flags. Is documenting this sufficient?
- What should the behavior be with build scripts and proc-macros? Those have historically been a pain point with rustflags. Perhaps there should be a default
build-override.rustflags = []
. - Profile rustflags are not considered as part of
TargetInfo
, which impacts feature resolution and other things. - Are we ok with rustflags that can be set in
Cargo.toml
Future Extensions
No response
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Metadata
Metadata
Assignees
Labels
Area: profilesArea: rustflagsCategory: A tracking issue for something unstable.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.Status: An implemented feature is waiting on community feedback for bugs or design concerns.Nightly: profile-rustflags
Type
Projects
Status
Unstable, baking