Skip to content

Add diagnostic for missing MessagePack submodule sources - #68142

Open
PureWeen wants to merge 1 commit into
mainfrom
pureween-messagepack-submodule-diagnostic
Open

Add diagnostic for missing MessagePack submodule sources#68142
PureWeen wants to merge 1 commit into
mainfrom
pureween-messagepack-submodule-diagnostic

Conversation

@PureWeen

@PureWeen PureWeen commented Jul 31, 2026

Copy link
Copy Markdown
Member

Add diagnostic for missing MessagePack submodule sources

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

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 CS2001 compiler 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 Compile input, and validated from the same list before CoreCompile. 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-CSharp

This helps contributors and coding agents diagnose incomplete local setup quickly. It does not mutate the checkout or hide genuinely missing files.

Validation:

  • A fresh worktree with the submodule uninitialized produced repeated MessagePack CS2001 errors before this change; afterward it produces one actionable build error and zero CS2001 errors.
  • Temporarily removing a consumed non-BufferWriter file verifies that validation covers the authoritative source list rather than a single sentinel.
  • Initializing or restoring the sources allows the targeted Components.Server build to succeed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 53b20fef-abce-40ab-9b46-3d5acab87e54
@PureWeen
PureWeen marked this pull request as ready for review August 3, 2026 21:13
@PureWeen
PureWeen requested a review from a team as a code owner August 3, 2026 21:13
Copilot AI review requested due to automatic review settings August 3, 2026 21:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Compile includes into a single authoritative item list (@(_MessagePackSource)).
  • Adds a ValidateMessagePackSources target that checks for missing source files before CoreCompile and emits a focused error with the recommended git 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants