You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crack the project when its MSBuild inputs change, and only once
The design time build cache key took its list of dependent files from
MSBuildAllProjects. Since MSBuild 16.9 an import no longer adds itself to
that property, so the list was the fsproj plus a handful of SDK targets and
nothing else: editing a Directory.Build.props neither invalidated the cache
nor re-cracked the project, because nothing knew the file existed. The
convention imports are now asked for by name instead, and the packages props
only when central package management is actually on, so watching it cannot
re-crack for an edit that changes nothing.
The keys themselves were built once per daemon lifetime. Which files an
evaluation depends on is decided by the evaluation, so a key kept across
cracks describes the project as it was, and a file added to the build was
never noticed. They are now forgotten at the start of every crack, which
still leaves them memoised for the length of one, where the same project can
be visited more than once.
A dev server calls watchChange on top of calling hotUpdate for every
environment, so one touch of an fsproj arrived three times and cracked the
project three times over, each one a full design time build. Deduplicating a
change across environments already existed for source files; re-cracks now go
through the same window, and watchChange defers to hotUpdate in dev, where it
is the better of the two because it can reload the browser afterwards.
Reading msbuild's stdout to the end before touching stderr can deadlock: a
child that fills the other pipe blocks writing while this side blocks
reading, and nothing between the daemon and the plugin times out. Both pipes
are now drained together. A non-empty stderr also no longer fails the call,
since msbuild and NuGet write warnings there on runs that succeed, and a real
failure is reported on stdout with the exit code set, which is why the old
message quoted stderr and named no reason at all.
Copy file name to clipboardExpand all lines: ROADMAP.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,7 @@ The contract is hand-mirrored today and the mirroring is positional, which is wh
172
172
173
173
## 9. Cache invalidation questions
174
174
175
-
- The design-time build cache key (`Caching.fs`) hashes MSBuild inputs only. Adding/removing a `<Compile Include>` changes the fsproj hash so that is covered, but `Directory.Build.props` files outside `MSBuildAllProjects` (for instance ones pulled in via `Import` with a condition that is false at evaluation time) are not.
175
+
- The design-time build cache key (`Caching.fs`) hashes MSBuild inputs only, and the list of inputs comes from `MSBuildAllProjects`. Since MSBuild 16.9 an import no longer adds itself to that property, so it now reports the fsproj and a handful of SDK targets and nothing else. `Directory.Build.props`, `Directory.Build.targets` and `Directory.Packages.props` are asked for by name (`DirectoryBuildPropsPath` and friends), which covers what people actually edit, but a file pulled in by an explicit `<Import>` is still invisible: changing it neither invalidates the cache nor re-cracks the project. Getting the real list means `dotnet msbuild -preprocess` or an equivalent, which is a much heavier query than the one property read the cache key does today.
176
176
-`tryCompileProject` compiles with `NoCache = true` in `CliArgs` while the daemon maintains its own cache; confirm nothing in newer Fable.Compiler versions relies on that flag for correctness.
0 commit comments