Skip to content

Commit 7bebac8

Browse files
committed
Add section on annoyance modulation.
1 parent 65f5d53 commit 7bebac8

File tree

1 file changed

+55
-10
lines changed

1 file changed

+55
-10
lines changed

text/0000-cargo-report-future-incompat.md

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,61 @@ is already locally caching warnings emitted while building upstream
403403
path-dependencies.)
404404

405405

406+
## Annoyance modulation
407+
408+
Emitting a warning on all subsequent cargo invocations until the
409+
problem is resolved may be overkill for some users.
410+
411+
In particular, it may not be reasonable for someone to resolve the
412+
flagged problem in the short term.
413+
414+
In order to allow users to opt-out of being warned about future
415+
incompatiblity issues on every build, this RFC proposes
416+
extending the `.cargo/config` file with keys that allow
417+
the user to fine-tune the frequency of how often cargo will
418+
print the report. For example:
419+
420+
```
421+
[future_incompatibility_report]
422+
# This setting can be used to reduce the frequency with which Cargo will report
423+
# future incompatibility issues.
424+
#
425+
# The possible values are:
426+
# * "always" (default): always emit the report if any future incompatibility
427+
# lint fires,
428+
# * "never": never emit the report,
429+
# * "post-cargo-update": emit the report the first time we encounter a given
430+
# future incompatibility lint after the most recent
431+
# `cargo update` run for a crate,
432+
# * "daily": emit the report the first time any particular lint fires each day,
433+
# * "weekly": emit the report the first time any particular lint fires
434+
# each week (starting from Monday, following ISO 8601),
435+
# * "lunar": emit the report the first time any particular lint fires every
436+
# four weeks. (We recommend using this value in tandem with
437+
# an IDE that present the current phase of the moon in its UI.)
438+
frequency = "always"
439+
440+
# This allows a further fine-tuning for lints that have been given an
441+
# explicit schedule for when they will be turned into hard errors.
442+
#
443+
# If false, such scheduled lints are treated the same as unscheduled ones.
444+
#
445+
# If true, such scheduled lints issue their report more frequently
446+
# as time marches towards the release date when the warning becomes an error.
447+
#
448+
# Specifically,
449+
# * 6 weeks before that release, the report is emitted at least once per week,
450+
# * 2 weeks before that release, the report is emitted on every build.
451+
#
452+
# (Note that a consequence of the above definition, this value of this setting
453+
# has no effect if the `future_incompat_report_frequency` is "always".)
454+
telescoping_schedule = true
455+
```
456+
457+
(This RFC does not actually prescribe the precise set of keys and
458+
values laid out above. We trust the Cargo team to determine an
459+
appropriate set of knobs to expose to the user.)
460+
406461
## Policy issues
407462

408463
We probably do not want to blindly convert all lints to
@@ -425,16 +480,6 @@ stable command line flag to `rustc`; but it also may be a confusing
425480
change in compiler semantics for any non-cargo client of `rustc` that
426481
is using `--error-format=json`.
427482

428-
Emitting a warning on all subsequent cargo invocations until the
429-
problem is resolved may be overkill. In particular, it may not be
430-
reasonable for someone to resolve this problem in the short term.
431-
432-
* (Perhaps we could restrict it so that it only gets re-emitted once
433-
each day or some other way to modulate the annoyance level; but of
434-
course then the diagnostic would have to state very clearly that it
435-
is doing that strange magic.)
436-
437-
438483
# Rationale and alternatives
439484
[rationale-and-alternatives]: #rationale-and-alternatives
440485

0 commit comments

Comments
 (0)