-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
set -Zmtime_on_use from config or ENV #7411
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
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.
We don't really have a ton of precedent for this in terms of an [unstable]
section of the config, almost everything requires some sort of opt-in via -Z
which this does already have. The ask here I think is for something where you don't have to say anything on each invocation of cargo
and you still get access to unstable features. That somewhat goes against how we've viewed unstable features historically (you need to constantly opt-in), but that's also the purpose of [unstable]
vs something more bland like [build]
.
I don't really mind too much one way or the other myself, this is pretty minor
src/cargo/util/config.rs
Outdated
@@ -626,6 +626,12 @@ impl Config { | |||
self.target_dir = cli_target_dir; | |||
self.cli_flags.parse(unstable_flags)?; | |||
|
|||
if nightly_features_allowed() { | |||
if let Some(val) = self.get_bool("unstable.mtime_on_use")?.map(|t| t.val) { |
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.
Could this try using the newer .get::<Option<bool>>
API as well?
@@ -386,6 +386,7 @@ impl CliUnstable { | |||
"advanced-env" => self.advanced_env = true, | |||
"config-profile" => self.config_profile = true, | |||
"dual-proc-macros" => self.dual_proc_macros = true, | |||
// can also be set in .cargo/config or with and ENV |
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.
Could the unstable documentation be updated as well?
Pipelining was unstable and used this model for testing instead of a I will fix your other comments when I next have my editor open. |
Nah that all sounds good to me! I had forgotten about that! r=me with the nits updated |
@bors r=alexcrichton |
📌 Commit 473f999 has been approved by |
set -Zmtime_on_use from config or ENV This lets you set the `-Zmtime_on_use` in config, it worked for me with ```toml [unstable] mtime_on_use=true ``` I did not find the ENV that would allow work. Suggestions? Does this need tests? Closes: #6978
☀️ Test successful - checks-azure |
4 commits in aa6b7e01abce30091cc594cb23a15c46cead6e24..ab6fa8908c9b6c8f7e2249231c395eebfbc49891 2019-09-24 17:19:12 +0000 to 2019-09-25 17:00:56 +0000 - Fix macOS collection of CPU data (rust-lang/cargo#7429) - Don't ever capture CPU state if timings are disabled (rust-lang/cargo#7428) - Change build-std to use --sysroot (rust-lang/cargo#7421) - set -Zmtime_on_use from config or ENV (rust-lang/cargo#7411)
Update cargo 4 commits in aa6b7e01abce30091cc594cb23a15c46cead6e24..ab6fa8908c9b6c8f7e2249231c395eebfbc49891 2019-09-24 17:19:12 +0000 to 2019-09-25 17:00:56 +0000 - Fix macOS collection of CPU data (rust-lang/cargo#7429) - Don't ever capture CPU state if timings are disabled (rust-lang/cargo#7428) - Change build-std to use --sysroot (rust-lang/cargo#7421) - set -Zmtime_on_use from config or ENV (rust-lang/cargo#7411)
This lets you set the
-Zmtime_on_use
in config, it worked for me withI did not find the ENV that would allow work. Suggestions?
Does this need tests?
Closes: #6978