Repository navigation
Write unsupported ProjectData markers during opted-in builds - #86463
Conversation
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>
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 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>
There was a problem hiding this comment.
🟡 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>
There was a problem hiding this comment.
🔵 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

Summary
Normal builds with EnableProjectDataOnBuild=true write caches for supported projects but previously omitted markers for unsupported projects, requiring another ProjectDataBuild to discover them.
This change is limited to the ProjectData producer; consumer package updates are separate.
Microsoft Reviewers: Open in CodeFlow