Skip to content

Write unsupported ProjectData markers during opted-in builds - #86463

Merged
emaf merged 4 commits into
dotnet:mainfrom
emaf:emaf-projectdata-unsupported-markers-on-build
Nov 20, 2026
Merged

emaf merged 4 commits into
dotnet:mainfrom
emaf:emaf-projectdata-unsupported-markers-on-build

Conversation

@emaf

@emaf emaf commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Normal builds with EnableProjectDataOnBuild=true write caches for supported projects but previously omitted markers for unsupported projects, requiring another ProjectDataBuild to discover them.

  • Hook unsupported marker cleanup and writes after CoreCompile and outer cross-targeting dispatch, writing once per project and preserving existing cache-cleanup behavior.
  • Skip atomic replacement when the full marker content is unchanged, while continuing to fingerprint project and ancestor inputs.
  • Cover opted-in and opted-out builds, unsupported single/multi-targeting projects, stale caches, supported C# builds, precompile failures, and marker freshness/corruption.

This change is limited to the ProjectData producer; consumer package updates are separate.

Microsoft Reviewers: Open in CodeFlow

Hook unsupported marker cleanup and writes into normal build completion, and preserve marker timestamps when fingerprinted content is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 23:52
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟡 Changes recommended

Cleanup gaps allow stale framework slices to reenter the outer cache and leave user-folder caches taking precedence over unsupported-project markers.

2 open issues
What changed in this PR

This PR extends the ProjectData producer so opted-in normal builds record unsupported projects, reducing the need for a separate ProjectDataBuild to discover them.

Changes:

  • Adds unsupported-marker cleanup and write hooks after compilation and outer cross-targeting dispatch.
  • Avoids rewriting markers when their full content is unchanged.
  • Adds build-scenario tests and marker freshness/corruption coverage.
File Description
src/​ProjectData/​Microsoft.NET.ProjectData/​UnsupportedProjectDataMarker.cs Skips atomic replacement for unchanged marker content.
src/​ProjectData/​Microsoft.NET.ProjectData.Tests/​UnsupportedProjectDataMarkerTests.cs Tests timestamp preservation, changed inputs, and corrupt-marker replacement.
src/​ProjectData/​Microsoft.NET.ProjectData.Tasks/​WriteUnsupportedProjectDataMarkerTask.cs Changes logging to “recorded” to accommodate unchanged markers.
src/​ProjectData/​Microsoft.NET.ProjectData.Tasks/​build/​Microsoft.NET.ProjectData.targets Hooks unsupported-project cleanup and marker recording into opted-in builds.
src/​ProjectData/​Microsoft.NET.ProjectData.Tasks.Tests/​TargetsFileSmokeTests.cs Covers build opt-in behavior, supported and unsupported projects, stale caches, and precompile failures.

Review effort: Balanced

Delete user-folder cache data before recording unsupported status and allow normal-build cleanup in unsupported inner evaluations. Cover supported-to-unsupported transitions while preserving Unix project-folder slice behavior and user-folder-only markers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 14, 2026 00:48

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.

🟡 Changes recommended

A critical cache-invalidation bug can leave opted-in C# projects incorrectly reported as unsupported on subsequent up-to-date builds after ExcludeFromBuild=true is removed.

2 open issues
1 resolved since last review

Review effort: Balanced

Recapture compiler arguments when opted-in builds lack their cache or slice, or still have an unsupported marker. Cover recovery in both cache locations and verify subsequent builds skip compilation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 18:40

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.

🟢 Approval recommended

No active review issues were identified for the unsupported-project build marker changes.

1 open issue
1 resolved since last review

Review effort: Balanced

@emaf
emaf enabled auto-merge (squash) November 16, 2026 19:06
@emaf
emaf requested a review from jasonmalinowski November 16, 2026 19:07
Copilot AI balanced review requested due to automatic review settings November 19, 2026 00:40

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.

🔵 Needs a closer look

File-only validation fingerprints may miss transient build-property changes that affect exclusion, so a maintainer should confirm refresh behavior for downstream consumers outside this PR.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants