Repository navigation
fix(hr): Embed Roslyn 5.12 in the net11 dev-server (backport #26318) - #26334
Conversation
Plans aligning the net11 dev-server host with the SDK 11 compiler (Roslyn 5.12) and the checks carried over from the spec 053 bump. Refs #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 25e5a6b)
SDK 11.0.100 defaults net11.0 projects to C# 15, which the embedded Roslyn 5.6 cannot parse: any C# 15 syntax blocked every hot reload of the project. 5.12 is not on nuget.org yet, so the exact SDK build comes from the dotnet-tools feed. Microsoft.Extensions pins are raised to the floor 5.12 requires, for the dev-server projects only. Fixes #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit d912e08)
The workspace drops a /langversion the embedded Roslyn cannot parse without any diagnostic. Warn once per project whose target framework defaults to a newer C# than the embedded compiler, and add a guard test that the embedded Roslyn accepts the SDK's default C# version. Refs #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit bde97a9)
HRApp inherited LangVersion 13.0, so the end-to-end hot reload tests could not catch a dev-server compiler older than the SDK default. Refs #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit b06f787)
The feed in NuGet.Config made every restore in the repository depend on it, for a pin only the net11 dev-server needs. It now comes from RestoreAdditionalProjectSources in the net11 block of Uno.DevServer.Roslyn.props, which the projects restoring Roslyn 5.12 import; Uno.HotReload.Tests now imports it too. Refs #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 9f9faae)
The load-time warning was the only line naming the cause, while every blocked edit listed only compile errors the build does not have. A blocked reload of a project whose target framework defaults to a C# version above the embedded compiler is now followed by a hint saying so. The check also covers LangVersion=preview, reuses the existing target-framework parser, honors cancellation and logs the exception type when it fails. Refs #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 87403dc)
Describes the scoped feed, the blocked-reload hint and the case R5 cannot detect, and replaces the status table with the unit, restore, build and runtime results on SDK 11.0.100. Refs #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 8ec8bac)
The HRApp tests only recompiled CSharpLatestSyntax.cs around other edits. This test edits the method that uses a labeled continue and checks the new body runs, so a dev-server compiler older than the SDK default fails it directly. Passes on Roslyn 5.12, fails on 5.6 with the issue's errors. Refs #26316 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 5bcf4c3)
The blocked-reload hint only reached the dev-server console. It is now
also a UNOHR0002 warning in the operation's diagnostics, so the IDE, the
in-app indicator and uno_app_hot_reload_status show why the reload
failed, not only "Failed". The new assertion fails without the
HotReloadManager change ("the collection is empty").
The negative test now matches "supports up to C#", which the positive
test also checks, so rewording the hint cannot empty it silently.
Review: #26318 (comment)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ac069f7)
Every blocked edit now repeats the fix ("Update Uno.Sdk, or set
<LangVersion>…"), which only the load-time warning gave before. That
warning now says Uno.Sdk instead of "the Uno Platform packages": in an
Uno.Sdk project there is no dev-server package reference to bump.
Also from the review: log the language-version sweep's exception at
Verbose, name the "net" prefix length, explain the LanguageVersion
division, and reword two comments that would go stale.
Review: #26318 (comment)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 1e62688)
7.0 SR1 ships the net11 host on the dotnet-tools build of Roslyn 5.12; the switch to the nuget.org 5.12.0 is tracked in #26328, now linked from the props comment and the spec. The open questions become decisions. The status table records the CI package inspection and the issue's end-to-end repro. R5, G2 and G3 describe UNOHR0002, the undetected "latest on a newer SDK" case, and that no CI job runs HRApp yet. Review: #26318 (review) Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 25c312f)
A reload blocked by a XAML generator error got no C# version hint, only the compile-error path had it. Such an error, like an unresolved x:Bind member, can come from code-behind the embedded compiler cannot parse, so that blocked line now gets the same hint and UNOHR0002 diagnostic, for the change-set's projects. Both paths share one helper, which never fails the pass it explains: an exception computing the hint is logged at Verbose and the pass stays blocked. The new test fails without the generator-path change (only UXAML0001 is reported). Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit cb8163f)
The load warning and the blocked-reload hint built the same "Update Uno.Sdk, or set <LangVersion>" sentence separately. One property now serves both, so the two messages cannot drift. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 0bd1e40)
Adds [GitHubWorkItem] for #26316 to Given_CSharpLatestSyntax, as the runtime-test rules ask for tests that guard an issue. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 2e3dc4b)
Addresses two code-quality findings on Given_CSharpLatestSyntax: the CancellationTokenSource is now disposed, and the file path uses Path.Join, which never drops the project path. The third finding, an unused label in CSharpLatestSyntax.cs, is a false positive: the label is used by C# 15's `continue outer;`, which the analyzer does not parse yet. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 003fa00)
After a XAML generator error, the language-version hint now names only the projects that own the failing XAML files, not every project in the change set, as the compile-error path already does with its blocking projects. The UNOHR0002 doc entry now says a XAML error can come from the same cause, and the helper's comment no longer claims errors are filtered out by the tracker (they are just never carried, see FIXME). Spec 061 G2 is corrected: CI does run HRApp. The Windows Skia runtime-tests job sets UnoEnableHRuntimeTests and runs it through Given_HotReloadWorkspace.When_HotReloadScenario, which passed in build 245527. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit e225e0d)
|
Claude finished @agneszitte's task in 14s —— View job Review of #26334 (backport of #26318 to 7.0)Verdict: ship. I found no blocking issues, so I posted no inline comments (0 critical, 0 major, 0 minor). I read the non-test source diff against
Points to confirm before merge
|
|
This pull request is merged. |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26334/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 245618 did not find any UI Test snapshots differences. |
Xiaoy312
left a comment
There was a problem hiding this comment.
LGTM. The net11 host now matches SDK 11.0.100's Roslyn/MSBuild, the dotnet-tools feed stays scoped to the projects restoring that line, and the version math (9 + (major − 5) against LatestMajor) lines up with the SDK. Since the tests are written relative to MaxCSharpVersion, the guard and the UNOHR0002 hint should keep catching the next time the host falls behind the SDK.
GitHub Issue: related to #26316
Backport of #26318 to
release/stable/7.0, for 7.0 SR1.PR Type:
🐞 Bugfix
What changed? 🚀
All 16 commits of #26318, cherry-picked with
-x. They applied cleanly, with no changes. The full description, review and decisions are on #26318.Before: on SDK 11.0.100,
net11.0projects default to C# 15, but the net11 dev-server compiled Hot Reload changes with Roslyn 5.6 (up to C# 14). One line of C# 15 blocked every Hot Reload edit to that project, XAML-only edits included.After:
5.12.0-1.26529.118and MSBuild18.12.2, the builds SDK 11.0.100 ships. The Roslyn build comes from thedotnet-toolsfeed, scoped to the four projects that restore it, until5.12.0reaches nuget.org (Switch the net11 dev-server to the nuget.org Roslyn 5.12.0 and remove the dotnet-tools feed #26328, to be backported here as well). The DevServer package declares no Roslyn dependency, so customers never need the feed.UNOHR0002, so the IDE and the app status show it.UNOHR0002is documented in the error-codes page.Validation on this branch (SDK 11.0.100, Windows)
Uno.HotReload.Tests: 176 passed, 0 failed, 1 skipped (Unix-only)Uno.HotReload, all target frameworks, warnings as errors: 0 warnings, 0 errorsThe end-to-end repro of #26316 (blocked on the stock 7.0.32 dev-server, applied with the fix) was run against the CI package of #26318: see this comment.
PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code