Add diagnostic for missing MessagePack submodule sources - #68142
Open
PureWeen wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 53b20fef-abce-40ab-9b46-3d5acab87e54
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an early, actionable MSBuild diagnostic in Components Server to detect missing MessagePack-CSharp submodule source files and fail the build before the compiler emits a cascade of CS2001 missing-source errors.
Changes:
- Refactors the MessagePack
Compileincludes into a single authoritative item list (@(_MessagePackSource)). - Adds a
ValidateMessagePackSourcestarget that checks for missing source files beforeCoreCompileand emits a focused error with the recommendedgit submodule update --init ...command.
Show a summary per file
| File | Description |
|---|---|
| src/Components/Server/src/Microsoft.AspNetCore.Components.Server.csproj | Centralizes MessagePack source includes and adds a pre-compile validation target to emit a single actionable diagnostic when the submodule sources are missing. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
Comment on lines
+126
to
+128
| <ItemGroup> | ||
| <_MissingMessagePackSource Include="@(_MessagePackSource)" Condition="!Exists('%(Identity)')" /> | ||
| </ItemGroup> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add diagnostic for missing MessagePack submodule sources
Add a focused diagnostic for missing MessagePack submodule sources
Description
While using Copilot to reproduce an unrelated Components issue in a fresh linked worktree, incomplete local setup ended up dominating the investigation. The MessagePack-CSharp submodule was not initialized, but Components.Server reported that prerequisite as a cascade of missing-source
CS2001compiler errors with no indication of how to fix the checkout.This keeps the diagnostic close to the project that consumes the sources. The 15 MessagePack files are defined once, used as the
Compileinput, and validated from the same list beforeCoreCompile. If any consumed source is missing, the build stops with one focused message explaining that an uninitialized submodule may be the cause and provides:git submodule update --init src/submodules/MessagePack-CSharpThis helps contributors and coding agents diagnose incomplete local setup quickly. It does not mutate the checkout or hide genuinely missing files.
Validation:
CS2001errors before this change; afterward it produces one actionable build error and zeroCS2001errors.BufferWriterfile verifies that validation covers the authoritative source list rather than a single sentinel.