-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Change the documented implicit value of -C instrument-coverage
to =yes
#117199
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
@rustbot label +A-code-coverage |
This changes the documented meaning of |
-C instrument-coverage
to =on
-C instrument-coverage
to =yes
7de0e6a
to
40d8911
Compare
The choice between |
This comment was marked as outdated.
This comment was marked as outdated.
The value of `-Cinstrument-coverage=` doesn't need to be `Option` (Extracted from rust-lang#117199, since this is a purely internal cleanup that can land independently.) Not using this flag is identical to passing `-Cinstrument-coverage=off`, so there's no need to distinguish between `None` and `Some(Off)`.
Rollup merge of rust-lang#117207 - Zalathar:no-option, r=compiler-errors The value of `-Cinstrument-coverage=` doesn't need to be `Option` (Extracted from rust-lang#117199, since this is a purely internal cleanup that can land independently.) Not using this flag is identical to passing `-Cinstrument-coverage=off`, so there's no need to distinguish between `None` and `Some(Off)`.
40d8911
to
39b9cb4
Compare
39b9cb4
to
7a4ce83
Compare
The change seems reasonable to me. I'm not completely sure whether this needs an MCP though. You write that '-Cinstrument-coverage is not really intended as a directly user-facing feature;', but strictly speaking it still is a user-facing feature, isn't it? |
Yes, ultimately it is a user-facing feature. All I mean by that comment is that the flag is mainly used by tools like |
If we’re not sure about the process, I’m not opposed to doing an MCP just to be safe. I’ve already done most of the hard work of writing up the proposal, and there’s no particular urgency. |
Yes, user-facing changes do require an MCP: https://rustc-dev-guide.rust-lang.org/contributing.html?highlight=Mcp#major-changes |
MCP filed as rust-lang/compiler-team#690. |
7a4ce83
to
b2c67f6
Compare
The MCP has been seconded, so I've rebased this PR to make sure it's still in good shape. |
b2c67f6
to
474d660
Compare
474d660
to
1130e46
Compare
#120690 |
Might as well rebase again; no changes. |
1130e46
to
9f287dd
Compare
r? @oli-obk since you seconded the MCP Fwiw the implementation looks good to me |
@bors r=oli-obk,Nadrieril |
…=oli-obk,Nadrieril Change the documented implicit value of `-C instrument-coverage` to `=yes` The option-value parser for `-Cinstrument-coverage=` currently accepts the following stable values: - `all` (implicit value of plain `-Cinstrument-coverage`) - `yes`, `y`, `on`, `true` (undocumented aliases for `all`) - `off` (default; same as not specifying `-Cinstrument-coverage`) - `no`, `n`, `false`, `0` (undocumented aliases for `off`) I'd like to rearrange and re-document the stable values as follows: - `no` (default; same as not specifying `-Cinstrument-coverage`) - `n`, `off`, `false` (documented aliases for `no`) - `0` (undocumented alias for `no`) - `yes` (implicit value of plain `-Cinstrument-coverage`) - `y`, `on`, `true` (documented aliases for `yes`) - `all` (documented as *currently* an alias for `yes` that may change; discouraged but not deprecated) The main changes being: - Documented default value changes from `off` to `no` - Documented implicit value changes from `all` to `yes` - Other boolean aliases (`n`, `off`, `false`, `y`, `on`, `true`) are explicitly documented - `all` remains currently an alias for `yes`, but is explicitly documented as being able to change in the future - `0` remains an undocumented but stable alias for `no` - The actual behaviour of coverage instrumentation does not change # Why? The choice of `all` as the implicit value only really makes sense in the context of the unstable `except-unused-functions` and `except-unused-generics` values. That arrangement was fine for an unstable flag, but it's confusing for a stable flag whose only other stable value is `off`, and will only become more confusing if we eventually want to stabilize other fine-grained coverage option values. (Currently I'm not aware of any plans to stabilize other coverage option values, but that's why I think now is a fine time to make this change, well before anyone actually has to care about it.) For example, if we ever add support for opt-in instrumentation of things that are *not* instrumented by `-Cinstrument-coverage` by default, it will be very strange for the `all` value to not actually instrument all things that we know how to instrument. # Compatibility impact Because this is not a functional change, there is no immediate compatibility impact. However, changing the documented semantics of `all` opens up the possibility of future changes that could be considered retroactively breaking. I don't think this is going to be a big deal in practice, for a few reasons: - The exact behaviour of coverage instrumentation is allowed to change, so changing the behaviour of `all` is not a *stability-breaking* change, as long as it still exists and does something reasonable. - `-Cinstrument-coverage` is mainly used by tools or scripts that can be easily updated if necessary. It's unusual for users to pass the flag directly, because processing the profiler output is complicated enough that tools/scripts tend to be necessary anyway. - Most people who are using coverage are probably relying on `-Cinstrument-coverage` rather than explicitly passing `-Cinstrument-coverage=all`, so the number of users actually affected by this change is likely to be low, and plausibly zero.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#113518 (bootstrap/libtest: print test name eagerly on failure even with `verbose-tests=false` / `--quiet`) - rust-lang#117199 (Change the documented implicit value of `-C instrument-coverage` to `=yes`) - rust-lang#121190 (avoid overlapping privacy suggestion for single nested imports) - rust-lang#121382 (Rework `untranslatable_diagnostic` lint) - rust-lang#121833 (Suggest correct path in include_bytes!) - rust-lang#121959 (Removing absolute path in proc-macro) - rust-lang#122038 (Fix linting paths with qself in `unused_qualifications`) - rust-lang#122051 (cleanup: remove zero-offset GEP) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#113518 (bootstrap/libtest: print test name eagerly on failure even with `verbose-tests=false` / `--quiet`) - rust-lang#117199 (Change the documented implicit value of `-C instrument-coverage` to `=yes`) - rust-lang#121190 (avoid overlapping privacy suggestion for single nested imports) - rust-lang#121382 (Rework `untranslatable_diagnostic` lint) - rust-lang#121959 (Removing absolute path in proc-macro) - rust-lang#122038 (Fix linting paths with qself in `unused_qualifications`) - rust-lang#122051 (cleanup: remove zero-offset GEP) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#117199 - Zalathar:instrument-coverage-on, r=oli-obk,Nadrieril Change the documented implicit value of `-C instrument-coverage` to `=yes` The option-value parser for `-Cinstrument-coverage=` currently accepts the following stable values: - `all` (implicit value of plain `-Cinstrument-coverage`) - `yes`, `y`, `on`, `true` (undocumented aliases for `all`) - `off` (default; same as not specifying `-Cinstrument-coverage`) - `no`, `n`, `false`, `0` (undocumented aliases for `off`) I'd like to rearrange and re-document the stable values as follows: - `no` (default; same as not specifying `-Cinstrument-coverage`) - `n`, `off`, `false` (documented aliases for `no`) - `0` (undocumented alias for `no`) - `yes` (implicit value of plain `-Cinstrument-coverage`) - `y`, `on`, `true` (documented aliases for `yes`) - `all` (documented as *currently* an alias for `yes` that may change; discouraged but not deprecated) The main changes being: - Documented default value changes from `off` to `no` - Documented implicit value changes from `all` to `yes` - Other boolean aliases (`n`, `off`, `false`, `y`, `on`, `true`) are explicitly documented - `all` remains currently an alias for `yes`, but is explicitly documented as being able to change in the future - `0` remains an undocumented but stable alias for `no` - The actual behaviour of coverage instrumentation does not change # Why? The choice of `all` as the implicit value only really makes sense in the context of the unstable `except-unused-functions` and `except-unused-generics` values. That arrangement was fine for an unstable flag, but it's confusing for a stable flag whose only other stable value is `off`, and will only become more confusing if we eventually want to stabilize other fine-grained coverage option values. (Currently I'm not aware of any plans to stabilize other coverage option values, but that's why I think now is a fine time to make this change, well before anyone actually has to care about it.) For example, if we ever add support for opt-in instrumentation of things that are *not* instrumented by `-Cinstrument-coverage` by default, it will be very strange for the `all` value to not actually instrument all things that we know how to instrument. # Compatibility impact Because this is not a functional change, there is no immediate compatibility impact. However, changing the documented semantics of `all` opens up the possibility of future changes that could be considered retroactively breaking. I don't think this is going to be a big deal in practice, for a few reasons: - The exact behaviour of coverage instrumentation is allowed to change, so changing the behaviour of `all` is not a *stability-breaking* change, as long as it still exists and does something reasonable. - `-Cinstrument-coverage` is mainly used by tools or scripts that can be easily updated if necessary. It's unusual for users to pass the flag directly, because processing the profiler output is complicated enough that tools/scripts tend to be necessary anyway. - Most people who are using coverage are probably relying on `-Cinstrument-coverage` rather than explicitly passing `-Cinstrument-coverage=all`, so the number of users actually affected by this change is likely to be low, and plausibly zero.
…hercote coverage: Remove or migrate all unstable values of `-Cinstrument-coverage` (This PR was substantially overhauled from its original version, which migrated all of the existing unstable values intact.) This PR takes the three nightly-only values that are currently accepted by `-Cinstrument-coverage`, completely removes two of them (`except-unused-functions` and `except-unused-generics`), and migrates the third (`branch`) over to a newly-introduced unstable flag `-Zcoverage-options`. I have a few motivations for wanting to do this: - It's unclear whether anyone actually uses the `except-unused-*` values, so this serves as an opportunity to either remove them, or prompt existing users to object to their removal. - After rust-lang#117199, the stable values of `-Cinstrument-coverage` treat it as a boolean-valued flag, so having nightly-only extra values feels out-of-place. - Nightly-only values also require extra ad-hoc code to make sure they aren't accidentally exposed to stable users. - The new system allows multiple different settings to be toggled independently, which isn't possible in the current single-value system. - The new system makes it easier to introduce new behaviour behind an unstable toggle, and then gather nightly-user feedback before possibly making it the default behaviour for all users. - The new system also gives us a convenient place to put relatively-narrow options that won't ever be the default, but that nightly users might still want access to. - It's likely that we will eventually want to give stable users more fine-grained control over coverage instrumentation. The new flag serves as a prototype of what that stable UI might eventually look like. The `branch` option is a placeholder that currently does nothing. It will be used by rust-lang#122322 to opt into branch coverage instrumentation. --- I see `-Zcoverage-options` as something that will exist more-or-less indefinitely, though individual sub-options might come and go as appropriate. I think there will always be some demand for nightly-only toggles, so I don't see `-Zcoverage-options` itself ever being stable, though we might eventually stabilize something similar to it.
…hercote coverage: Remove or migrate all unstable values of `-Cinstrument-coverage` (This PR was substantially overhauled from its original version, which migrated all of the existing unstable values intact.) This PR takes the three nightly-only values that are currently accepted by `-Cinstrument-coverage`, completely removes two of them (`except-unused-functions` and `except-unused-generics`), and migrates the third (`branch`) over to a newly-introduced unstable flag `-Zcoverage-options`. I have a few motivations for wanting to do this: - It's unclear whether anyone actually uses the `except-unused-*` values, so this serves as an opportunity to either remove them, or prompt existing users to object to their removal. - After rust-lang#117199, the stable values of `-Cinstrument-coverage` treat it as a boolean-valued flag, so having nightly-only extra values feels out-of-place. - Nightly-only values also require extra ad-hoc code to make sure they aren't accidentally exposed to stable users. - The new system allows multiple different settings to be toggled independently, which isn't possible in the current single-value system. - The new system makes it easier to introduce new behaviour behind an unstable toggle, and then gather nightly-user feedback before possibly making it the default behaviour for all users. - The new system also gives us a convenient place to put relatively-narrow options that won't ever be the default, but that nightly users might still want access to. - It's likely that we will eventually want to give stable users more fine-grained control over coverage instrumentation. The new flag serves as a prototype of what that stable UI might eventually look like. The `branch` option is a placeholder that currently does nothing. It will be used by rust-lang#122322 to opt into branch coverage instrumentation. --- I see `-Zcoverage-options` as something that will exist more-or-less indefinitely, though individual sub-options might come and go as appropriate. I think there will always be some demand for nightly-only toggles, so I don't see `-Zcoverage-options` itself ever being stable, though we might eventually stabilize something similar to it.
Rollup merge of rust-lang#122226 - Zalathar:zcoverage-options, r=nnethercote coverage: Remove or migrate all unstable values of `-Cinstrument-coverage` (This PR was substantially overhauled from its original version, which migrated all of the existing unstable values intact.) This PR takes the three nightly-only values that are currently accepted by `-Cinstrument-coverage`, completely removes two of them (`except-unused-functions` and `except-unused-generics`), and migrates the third (`branch`) over to a newly-introduced unstable flag `-Zcoverage-options`. I have a few motivations for wanting to do this: - It's unclear whether anyone actually uses the `except-unused-*` values, so this serves as an opportunity to either remove them, or prompt existing users to object to their removal. - After rust-lang#117199, the stable values of `-Cinstrument-coverage` treat it as a boolean-valued flag, so having nightly-only extra values feels out-of-place. - Nightly-only values also require extra ad-hoc code to make sure they aren't accidentally exposed to stable users. - The new system allows multiple different settings to be toggled independently, which isn't possible in the current single-value system. - The new system makes it easier to introduce new behaviour behind an unstable toggle, and then gather nightly-user feedback before possibly making it the default behaviour for all users. - The new system also gives us a convenient place to put relatively-narrow options that won't ever be the default, but that nightly users might still want access to. - It's likely that we will eventually want to give stable users more fine-grained control over coverage instrumentation. The new flag serves as a prototype of what that stable UI might eventually look like. The `branch` option is a placeholder that currently does nothing. It will be used by rust-lang#122322 to opt into branch coverage instrumentation. --- I see `-Zcoverage-options` as something that will exist more-or-less indefinitely, though individual sub-options might come and go as appropriate. I think there will always be some demand for nightly-only toggles, so I don't see `-Zcoverage-options` itself ever being stable, though we might eventually stabilize something similar to it.
The option-value parser for
-Cinstrument-coverage=
currently accepts the following stable values:all
(implicit value of plain-Cinstrument-coverage
)yes
,y
,on
,true
(undocumented aliases forall
)off
(default; same as not specifying-Cinstrument-coverage
)no
,n
,false
,0
(undocumented aliases foroff
)I'd like to rearrange and re-document the stable values as follows:
no
(default; same as not specifying-Cinstrument-coverage
)n
,off
,false
(documented aliases forno
)0
(undocumented alias forno
)yes
(implicit value of plain-Cinstrument-coverage
)y
,on
,true
(documented aliases foryes
)all
(documented as currently an alias foryes
that may change; discouraged but not deprecated)The main changes being:
off
tono
all
toyes
n
,off
,false
,y
,on
,true
) are explicitly documentedall
remains currently an alias foryes
, but is explicitly documented as being able to change in the future0
remains an undocumented but stable alias forno
Why?
The choice of
all
as the implicit value only really makes sense in the context of the unstableexcept-unused-functions
andexcept-unused-generics
values. That arrangement was fine for an unstable flag, but it's confusing for a stable flag whose only other stable value isoff
, and will only become more confusing if we eventually want to stabilize other fine-grained coverage option values.(Currently I'm not aware of any plans to stabilize other coverage option values, but that's why I think now is a fine time to make this change, well before anyone actually has to care about it.)
For example, if we ever add support for opt-in instrumentation of things that are not instrumented by
-Cinstrument-coverage
by default, it will be very strange for theall
value to not actually instrument all things that we know how to instrument.Compatibility impact
Because this is not a functional change, there is no immediate compatibility impact. However, changing the documented semantics of
all
opens up the possibility of future changes that could be considered retroactively breaking.I don't think this is going to be a big deal in practice, for a few reasons:
all
is not a stability-breaking change, as long as it still exists and does something reasonable.-Cinstrument-coverage
is mainly used by tools or scripts that can be easily updated if necessary. It's unusual for users to pass the flag directly, because processing the profiler output is complicated enough that tools/scripts tend to be necessary anyway.-Cinstrument-coverage
rather than explicitly passing-Cinstrument-coverage=all
, so the number of users actually affected by this change is likely to be low, and plausibly zero.