Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Packages/src/Editor/CliOnlyTools~/CompileCheck/Skill/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ again: the run reports the diagnostics recorded then, errors included. `--all` c
everything from scratch, which is the way out if a reused result ever looks wrong.

In a large assembly whose last compile-check compile succeeded, an edit that keeps every
declaration is checked on the changed files only, in a few seconds. Such a check skips a few
assembly-wide rules, so run once with `--full` before finishing. The first body edit after a Unity
declaration is checked on the changed files only, in a few seconds. Adding or removing a using
directive counts as a declaration change. Such a check skips a few assembly-wide rules, so run once
with `--full` before finishing. When the project treats warnings as errors, a rule listed in
`UncheckedCodes`, such as CS0414, can fail that `--full` run only. The first body edit after a Unity
build, after a `--full` that had errors, after a run that skipped the assembly, or after
`--all` in an assembly that references another of the project is compiled in full and records what
the next check compares against; `FastPathFallbacks` says why.
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/internal/compilecheck/fast_path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func TestFailedFullCompileLeavesNoBaseline(t *testing.T) {
recorder := newCachedSchedulerRecorder("Alpha", "Beta")
outcome := project.run(t, recorder, false)

assertFallback(t, outcome, recorder, "no baseline: the last full compile had errors")
assertFallback(t, outcome, recorder, "no baseline: the last full compile had errors; the first full compile without errors records one")
}

// Verifies that a change to an input other than source contents, such as a new source, compiles in full.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (s Store[D]) missingBaselineReason(assembly string) string {
return notOnRecord
}
if !manifest.Succeeded {
return "no baseline: the last full compile had errors"
return "no baseline: the last full compile had errors; the first full compile without errors records one"
}

return "no baseline: the last full compile did not record one"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func TestLoadBaselineExplainsAMissingBaseline(t *testing.T) {
},
"failed compile": {
record: func(t *testing.T, project projectStore) { project.recordCompile(t, "input", false) },
want: "no baseline: the last full compile had errors",
want: "no baseline: the last full compile had errors; the first full compile without errors records one",
},
"successful compile": {
record: func(t *testing.T, project projectStore) { project.recordCompile(t, "input", true) },
Expand Down
2 changes: 1 addition & 1 deletion cli/dispatcher/internal/compilecheck/resultstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// same key, a successful compile, and outputs that still match. Otherwise LoadBaseline says why
// there is none, in one of these reasons:
// "no baseline: no full compile of this assembly is on record",
// "no baseline: the last full compile had errors",
// "no baseline: the last full compile had errors; the first full compile without errors records one",
// "no baseline: the last full compile did not record one",
// "no baseline: it was recorded by another version of compile-check",
// "baseline compile is no longer on disk".
Expand Down
12 changes: 8 additions & 4 deletions docs/compile-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ The check is used when all of these hold:
list of source paths.
- 1 to 30 of its sources changed.
- Every changed file keeps its declarations: only method bodies, accessor bodies, expression
bodies, non-constant initializers outside partial types, comments, or whitespace changed.
bodies, non-constant initializers outside partial types, comments, or whitespace changed. Adding
or removing a `using` directive counts as a declaration change, because it can change what every
name in the file resolves to.

The changed files are checked by a worker built once per Editor toolchain with the Editor's own
dotnet and Roslyn. It reports their compiler and analyzer diagnostics, with `DiagnosticSuppressor`s
Expand All @@ -155,8 +157,9 @@ Otherwise the assembly is compiled in full as before, and `FastPathFallbacks` sa
- `no baseline: no full compile of this assembly is on record` (none ran yet, a later run
skipped the assembly, which removes its result and baseline, or an input changed while
the last full compile ran, so it left no record; `FastPathBaselineNotes` of that run says which)
- `no baseline: the last full compile had errors` (a full compile that fails drops the baseline an
earlier one left)
- `no baseline: the last full compile had errors; the first full compile without errors records one`
(a full compile that fails drops the baseline an earlier one left, and the assembly is
compiled in full until a compile succeeds)
- `no baseline: the last full compile did not record one` (`FastPathBaselineNotes` of that run
says why, or the assembly was compiled only because a reference changed)
- `no baseline: it was recorded by another version of compile-check`
Expand Down Expand Up @@ -205,7 +208,8 @@ What the check does not guarantee, so run `--full` before finishing:
assembly, and the rules of analyzers that use Compilation, CompilationEnd, SemanticModel, or
SymbolStart actions. `FastChecks[].UncheckedCodes` lists the IDs it could not run, leaving out
the ones the response file already turns off (with `-nowarn` or a ruleset) and analyzer rules
that are disabled, so an assembly may list fewer than these four.
that are disabled, so an assembly may list fewer than these four. In a project that treats
warnings as errors (`-warnaserror`), these are errors that only `--full` reports.
- Errors the compiler reports only while emitting, such as CS8178 and CS0656.
- Source generators. The check reads the generator output saved by the last full compile and does
not run them again; `FastChecks[].GeneratorsNotRerun` says so.
Expand Down
Loading