Use dotnet cake for SDK provisioning to fix workload resolver issues - #35264
Closed
PureWeen wants to merge 1 commit into
Closed
Use dotnet cake for SDK provisioning to fix workload resolver issues#35264PureWeen wants to merge 1 commit into
PureWeen wants to merge 1 commit into
Conversation
MSBuild caches workload manifests at evaluation time and cannot refresh mid-build. When the SDK bundles stale manifests from older preview bands (dotnet/sdk#53234), this causes NETSDK1178 errors because the cached state references non-existent packs. Changes: - Switch all BuildTasks pipeline steps from build.sh/build.cmd to 'dotnet cake --target=dotnet-buildtasks' which runs SDK provisioning and building as separate processes (fresh workload state each time) - Add 'dotnet cake --target=dotnet' provisioning step before Pack stages - Add SkipInitInternalTooling condition to eng/Tools.props to prevent redundant DotNet.csproj re-runs that cause MSB3026 file-lock timeouts - Pass /p:SkipInitInternalTooling=true from all pipeline steps that run after Cake provisioning (Build, Pack, Helix, DeviceTests) - Add _CleanStaleWorkloadManifestBands target to DotNet.csproj to remove stale manifest bands (defense-in-depth, becomes no-op with fixed SDK) - Remove redundant build.cmd SDK install from Windows device tests This aligns MAUI's CI build flow with how device tests already work (separate processes for provisioning vs building) and matches the MSBuild SDK's design assumption that workload state doesn't change mid-process. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35264Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35264" |
This was referenced May 1, 2026
Member
Author
|
Superseded by #35330 which merges all preview4 changes (including these Cake/SkipInitInternalTooling fixes) into net11.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
MSBuild caches workload manifests at evaluation time and cannot refresh mid-build. When the SDK bundles stale manifests from older preview bands (dotnet/sdk#53234), this causes NETSDK1178 errors because the cached state references non-existent packs.
MAUI's
InitInternalToolingtarget (eng/Tools.props) provisions workloads insideAfterTargets="Restore"— but by that point MSBuild already cached the stale workload state. The MSBuild SDK explicitly states: "For workload installation actions, we expect to be running under a NEW PROCESS."This PR aligns MAUI's CI with that design by using
dotnet cake(which runs each task as a separatedotnetprocess) instead ofbuild.sh(single MSBuild process) for SDK provisioning.Changes
dotnet cake --target=dotnet-buildtasks— Provisions SDK and builds BuildTasks as separate processes (fresh workload resolver state each time)dotnet cake --target=dotnetbefore Pack stages — Provisions SDK/workloads before the pack stepSkipInitInternalToolingcondition to eng/Tools.props — Prevents redundant DotNet.csproj re-runs that cause MSB3026 file-lock timeouts when Cake already provisioned/p:SkipInitInternalTooling=truefrom all pipeline steps that run after Cake provisioning_CleanStaleWorkloadManifestBandstarget to DotNet.csproj — Removes stale manifest bands as defense-in-depth (becomes a no-op once .NET 11 Preview workload manifests use wrong feature band in .NET SDK archives sdk#53234 fix flows through)build.cmdSDK install from Windows device tests (Cake handles it)Why This Works
Device tests already use this exact
dotnet cakepattern and it works. The Cake build file (eng/cake/dotnet.cake) runsDotNet.csprojas process #1 (provisioning), thenBuildTasks.slnfas process #2 (building) — each with fresh workload resolver state.Files Changed
eng/Tools.propsSkipInitInternalToolingconditionsrc/DotNet/DotNet.csproj_CleanStaleWorkloadManifestBandstargeteng/pipelines/arcade/stage-build.ymleng/pipelines/arcade/stage-pack.ymleng/pipelines/arcade/stage-helix-tests.ymleng/pipelines/arcade/stage-unit-tests.ymleng/pipelines/arcade/stage-device-tests.ymlContext
release/11.0.1xx-preview4branch (PR [release/11.0.1xx-preview4] Update dependencies from dotnet/android, dotnet/dotnet #35171) — all Build, Pack, and Helix jobs pass