Skip to content

Revert sharedfx.targets property differentiation from #6697 - #6752

Merged
lewing merged 1 commit into
mainfrom
revert-6697
May 22, 2026
Merged

lewing merged 1 commit into
mainfrom
revert-6697

Conversation

@lewing

@lewing lewing commented May 21, 2026

Copy link
Copy Markdown
Member

Summary

Partial revert of #6697 to fix the deterministic file-lock build failures on main (6/6 internal rolling builds failed in the last 24h).

Problem

PR #6697 added _GettingFilesForPackage=true / _GettingFilesForPublish=true properties to nested <MSBuild> calls in sharedfx.targets to fix an intermittent MSB4006 circular dependency. However, this caused MSBuild's scheduler to treat the nested calls as separate project instances (different global properties = different cache entries), allowing them to run concurrently on different worker nodes. Both instances execute _GenerateSharedFrameworkDepsFile and write to the same .deps.json file with FileShare.None, producing deterministic file-lock crashes.

See: #6697 (comment)

What this PR does

  • Reverts the _GettingFilesForPackage / _GettingFilesForPublish property additions in sharedfx.targets
  • Restores _PublishingToLayout=true in aspnetcore's Microsoft.AspNetCore.App.Runtime.sfxproj (was removed by Fix intermittent circular dependency in sharedfx.targets (MSB4006) #6697)
  • Keeps the PlatformManifestFileEntry addition for Microsoft.NETCore.App.Runtime.CoreCLR.r2r.dylib (that was a real bug fix)

Trade-off

The intermittent MSB4006 (false circular dependency) may return, but it's far less damaging than 100% deterministic build failure. The underlying MSBuild scheduling issue is tracked at dotnet/msbuild#13599.

cc @wtgodbe @dotnet/dnceng

Reverts the _GettingFilesForPackage/_GettingFilesForPublish property
additions in sharedfx.targets and restores _PublishingToLayout in
aspnetcore sfxproj. These changes caused MSBuild to schedule the nested
calls as separate project instances, leading to concurrent writes to
the same deps.json file — producing deterministic file-lock failures
on all main rolling builds (6/6 failed in 24h).

Keeps the PlatformManifestFileEntry addition for
Microsoft.NETCore.App.Runtime.CoreCLR.r2r.dylib (real bug fix).

The original MSB4006 intermittent circular dependency is tracked at
dotnet/msbuild#13599 and needs a fix that
doesn't create concurrent project instances.

Partial revert of #6697.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings May 21, 2026 22:26
@dotnet-policy-service
dotnet-policy-service Bot requested review from a team May 21, 2026 22:26

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

This PR partially reverts #6697 to address deterministic file-lock build failures caused by MSBuild scheduling nested self-builds as distinct project instances (due to differing global properties), allowing concurrent execution that writes the same shared-framework .deps.json outputs.

Changes:

  • Revert _GettingFilesForPackage / _GettingFilesForPublish global property differentiation on nested self-<MSBuild> calls in sharedfx.targets to prevent concurrent duplicate project instances.
  • Restore _PublishingToLayout=true on the aspnetcore Microsoft.AspNetCore.App.Runtime.sfxproj nested publish-to-layout call (to retain the circular-dependency workaround for that scenario).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj Re-adds _PublishingToLayout=true to the nested publish MSBuild invocation to differentiate global properties and avoid intermittent circular dependency scenarios.
src/arcade/src/Microsoft.DotNet.SharedFramework.Sdk/targets/sharedfx.targets Removes the dummy differentiating properties from nested self-builds to avoid MSBuild scheduling concurrent project instances that contend on shared outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lewing
lewing requested a review from wtgodbe May 21, 2026 22:47
@lewing
lewing enabled auto-merge May 21, 2026 23:09
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team May 21, 2026 23:09
@lewing
lewing merged commit 3b3c308 into main May 22, 2026
12 checks passed
@lewing
lewing deleted the revert-6697 branch May 22, 2026 00:54
@lewing

lewing commented May 22, 2026

Copy link
Copy Markdown
Member Author

/backport to release/11.0-preview5

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0-preview5 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@lewing an error occurred while backporting to release/11.0-preview5. See the workflow output for details.

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