-
Notifications
You must be signed in to change notification settings - Fork 555
[builds] Fix parallel make race condition in apidiff build #24673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The .stamp-workload-replace-* targets delete SDK workload manifests and workloadsets directories while .stamp-workaround-for-maccore-issue-2427 runs 'dotnet restore' concurrently, causing the SDK's workload manifest resolver to crash with: ``` error MSB4242: SDK Resolver Failure: "The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed while attempting to resolve the SDK "Microsoft.NET.SDK.WorkloadManifestTargetsLocator". Exception: "System.InvalidOperationException: Sequence contains no elements at System.Linq.ThrowHelper.ThrowNoElementsException() at System.Linq.Enumerable.Aggregate[TSource](IEnumerable`1 source, Func`3 func) at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.ResolveManifestDirectory(String manifestDirectory) at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.<>c__DisplayClass35_0.<FallbackForMissingManifest>b__5(ValueTuple`2 t) at System.Linq.Enumerable.IEnumerableWhereSelectIterator`2.MoveNext() at System.Linq.Enumerable.IEnumerableWhereIterator`1.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.FallbackForMissingManifest(String manifestId) at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests() at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, IWorkloadManifestProvider manifestProvider, IWorkloadResolver workloadResolver) at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.CachingWorkloadResolver.Resolve(String sdkReferenceName, String dotnetRootPath, String sdkVersion, String userProfileDir, String globalJsonPath) at Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.WorkloadSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory) at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IReadOnlyList`1 resolvers, Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable`1& errors, IEnumerable`1& warnings)"" ``` Add $(INSTALLED_SDK_MANIFESTS) as a dependency to ensure the full workload replacement cycle (delete old manifests, create symlinks to local workloads) completes before the restore runs.
There was a problem hiding this comment.
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 fixes a parallel make race condition where SDK workload manifest deletion and dotnet restore could run concurrently, causing MSBuild SDK resolver crashes. The fix introduces a new variable INSTALLED_SDK_MANIFESTS to track SDK manifest symlink creation and adds it as a dependency to ensure the complete workload replacement cycle finishes before restore runs.
Changes:
- Introduce
INSTALLED_SDK_MANIFESTSvariable to track SDK manifest installation targets - Add
INSTALLED_SDK_MANIFESTSas a dependency to.stamp-workaround-for-maccore-issue-2427to prevent race condition
✅ [PR Build #48a6c9d] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #48a6c9d] Build passed (Build packages) ✅Pipeline on Agent |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #48a6c9d] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #48a6c9d] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #48a6c9d] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #48a6c9d] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #48a6c9d] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
💻 [CI Build #48a6c9d] Tests on macOS arm64 - Mac Tahoe (26) passed 💻✅ All tests on macOS arm64 - Mac Tahoe (26) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #48a6c9d] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 117 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
The .stamp-workload-replace-* targets delete SDK workload manifests and
workloadsets directories while .stamp-workaround-for-maccore-issue-2427
runs 'dotnet restore' concurrently, causing the SDK's workload manifest
resolver to crash with:
Add $(INSTALLED_SDK_MANIFESTS) as a dependency to ensure the full
workload replacement cycle (delete old manifests, create symlinks to
local workloads) completes before the restore runs.