Commit 8d3e73f
authored
feat(build-analysis): emit rebuild reason log entry (#16203)
### What does this PR try to resolve?
This implements a basic emission for rebuild reasons.
It reuses the `DirtyReason` enum in the log messages.
Hence the serialization change.
Part of #15844
### How to test and review this PR?
The schema is not final, subject to change,
but at least this PR unblocks us the exploration of `cargo report`
commands.
See tests in dirty_reason.rs for the shape of the JSON message.
#### Schema decisions
We may need to review this before stabilization:
* `FileTime`: serialize as f64 milliseconds
Millisecond precision should be sufficient for mtime comparison,
if not we can change to nanosecond
* `Checksum`: serializing to Display format
(e.g., "sha256=abc123...")
* `StaleItem`: with internally tagged format, for example
```
{"stale-item":"missing-file","path":"src/lib.rs"}
{"stale-item":"changed-file","reference_mtime":"...", ...}
```
* `FsStatus`: with internally tagged format, for example
```
{"fs-status":"stale-item","type":"missing-file","path":"..."}
```
The `UpToDate` variant is skipped
since it's not relevant for rebuild reason logging.File tree
5 files changed
+784
-71
lines changed- src/cargo
- core/compiler/fingerprint
- util
- tests/testsuite
5 files changed
+784
-71
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
660 | 661 | | |
661 | 662 | | |
662 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
663 | 673 | | |
664 | 674 | | |
665 | 675 | | |
| |||
0 commit comments