Tolerate decommissioned package sources during restore#17119
Merged
akoeplinger merged 1 commit intoJul 15, 2026
Conversation
Servicing builds can fail when a transport feed referenced in NuGet.config has been disabled after a release (e.g. dotnet/runtime#129694, the darc-pub-dotnet-emsdk feed). This ports the mitigation from dotnet#17118 to main. - Default RestoreIgnoreFailedSources=true in the Arcade SDK's ProjectDefaults.props so it flows to every project's NuGet restore. It is conditional, so repos and command lines can still override it explicitly. - The toolset acquisition in tools.ps1/tools.sh no longer runs an MSBuild restore (it now uses 'dotnet package download'), which does not honor RestoreIgnoreFailedSources and hard-fails when any configured source is unavailable. Since the Arcade SDK is always published to the public dotnet-eng feed, retry the download against that feed directly (which ignores the other sources) when the config-driven download fails. This is implemented via a new ignore-failure parameter on the DotNet helper so the primary attempt can fall back instead of terminating the script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9889e061-0a75-4752-9543-beada3bfc16c
Contributor
There was a problem hiding this comment.
Pull request overview
This PR mitigates build/restore failures caused by decommissioned or unavailable NuGet sources by making restores tolerate failed sources by default and adding a fallback path for acquiring the Arcade SDK when dotnet package download fails due to a dead feed.
Changes:
- Default
RestoreIgnoreFailedSources=true(overridable) for MSBuild-based restores via Arcade SDK defaults. - Add retry logic in
InitializeToolsetto re-attempt Arcade SDK acquisition from the publicdotnet-engfeed when config-driven download fails. - Extend the
DotNethelper wrappers to optionally return failure to callers (to enable fallback logic) instead of terminating immediately.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props | Defaults restores to ignore failed sources so decommissioned feeds don’t hard-fail restore. |
| eng/common/tools.sh | Adds fallback download from dotnet-eng when dotnet package download fails due to an unavailable configured source. |
| eng/common/tools.ps1 | Adds the same fallback logic and introduces an ignore-failure mode in the DotNet wrapper (currently with blocking issues noted in PR comments). |
Comments suppressed due to low confidence (1)
eng/common/tools.ps1:866
- The new
DotNet([switch]$ignoreFailure)signature makes the first positional argument bind toignoreFailure, which will shift/lose the first dotnet argument (e.g.package) and can unintentionally flip the failure behavior. MakeignoreFailurea named-only switch by adding a positionaldotnetArgsparameter that captures the remaining arguments, and iterate that parameter instead of$args.
function DotNet([switch]$ignoreFailure) {
$dotnetRoot = InitializeDotNetCli -install:$restore
$dotnetPath = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet')
$cmdArgs = ""
foreach ($arg in $args) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mmitche
reviewed
Jul 14, 2026
| # download fails, retry once against that feed directly (which ignores the other sources) | ||
| # before giving up, so a single dead source doesn't block the build. | ||
| $downloadExitCode = DotNet -ignoreFailure @downloadArgs | ||
| if ($downloadExitCode) { |
Member
There was a problem hiding this comment.
@copilot Create an issue in dotnet/sdk to support skipping unavailable sources when downloading a package.
mmitche
approved these changes
Jul 14, 2026
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.
Ports the mitigation from #17099 / #17118 to
main.Problem
Servicing builds can fail when a transport feed referenced in
NuGet.confighas been decommissioned after a release (e.g. dotnet/runtime#129694, thedarc-pub-dotnet-emsdkfeed). NuGet aborts the whole restore when any configured source is unavailable.Changes
ProjectDefaults.props: defaultRestoreIgnoreFailedSources=true(conditional, overridable) so every project's MSBuild-based restore falls back to the remaining sources instead of failing. This is the same change as [release/10.0] Tolerate decommissioned package sources during restore #17118.tools.ps1/tools.sh: onmain,InitializeToolsetwas refactored to acquire the Arcade SDK viadotnet package downloadinstead of an MSBuild restore: Use dotnet package download for toolset initialization dotnet#5909. That command does not honorRestoreIgnoreFailedSourcesand hard-fails on a dead source, so [release/10.0] Tolerate decommissioned package sources during restore #17118's/p:RestoreIgnoreFailedSources=trueargument has no equivalent here. Instead, when the config-driven download fails, retry once against the publicdotnet-engfeed directly (via--source, which ignores the other sources) — the Arcade SDK is always published there for public builds. Implemented through a new ignore-failure parameter on theDotNethelper so the primary attempt can fall back instead of terminating the script.Notes / limitations
v9.0.11NuGet.config(no source mapping, dead transport feed listed first), the config-driven download fails and thedotnet-engfallback successfully downloads the Arcade SDK.