fix(ci): shut down MSBuild build-server before restore and build - #10
Open
KiarashMinoo wants to merge 1 commit into
Open
fix(ci): shut down MSBuild build-server before restore and build#10KiarashMinoo wants to merge 1 commit into
KiarashMinoo wants to merge 1 commit into
Conversation
Clean, Restore and Build in pack-solution.ps1 run as three separate dotnet invocations, but the .NET SDK keeps a persistent MSBuild/VBCSCompiler server warm across them by default. If a consumer's own Directory.Build.props-style targets manage files outside NuGet's own restore inputs (e.g. downloading shared config into a gitignored scratch folder on a BeforeTargets="Restore" hook), that warm server can serve Restore a stale "nothing to restore" evaluation from before those targets had anything to fetch, silently skipping them and leaving Build to fail on missing package/property state that never actually gets (re)downloaded -- especially once Clean has just deleted whatever a prior attempt fetched. This compounds across the workflow-level retry loop, since nothing previously reset the server between attempts either. Shutting the server down immediately before Restore and before Build forces a cold, disk-accurate evaluation each time. No-op when the staleness bug isn't in play.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
User description
Summary
pack-solution.ps1runs Clean, Restore, and Build as three separatedotnetinvocations, but the .NET SDK keeps a persistent MSBuild/VBCSCompiler server warm across them by default.Directory.Build.props-style targets manage (e.g. downloading shared config into a gitignored scratch folder on aBeforeTargets="Restore"hook), that warm server can serve the following Restore call a stale "nothing to restore" evaluation from before those targets had anything to fetch — silently skipping them and leaving Build to fail on missing package/property state that never actually gets (re)downloaded.BuildingBlocks/Ardalis/CaseConvertertype-not-found cascade onThunderPropagator.Application), and reproduces the exact same failure signature I confirmed and root-caused separately this session for the localdotnet restore/dotnet build-serverstaleness bug.dotnet build-server shutdownimmediately before Restore and before Build, forcing a cold, disk-accurate evaluation each time. This is a no-op when the staleness bug isn't in play, so it's safe for every consumer of this script.Caveat: I could not reproduce the exact CI failure locally on a single clean run — my working theory is that the staleness compounds across the workflow-level retry loop (an initial attempt hits an unrelated transient blip, but the warm server surviving into the retry then causes the real no-op-restore failure). The fix addresses the confirmed staleness bug class regardless, but isn't a 100%-proven root cause for this specific incident.
Test plan
mainbranch protection requires a PR (no direct push)PR Type
Bug fix
Description
Add build-server shutdown before restore
Add build-server shutdown before build
Prevent stale restore evaluation
Diagram Walkthrough
File Walkthrough
pack-solution.ps1
Add build-server shutdown before restore and build.github/scripts/pack-solution.ps1
dotnet build-server shutdownbefore restoredotnet build-server shutdownbefore build