Skip to content

Tolerate decommissioned package sources during restore#17099

Merged
mmitche merged 1 commit into
dotnet:release/9.0from
mmitche:mmitche/restore-ignore-failed-sources
Jul 14, 2026
Merged

Tolerate decommissioned package sources during restore#17099
mmitche merged 1 commit into
dotnet:release/9.0from
mmitche:mmitche/restore-ignore-failed-sources

Conversation

@mmitche

@mmitche mmitche commented Jul 10, 2026

Copy link
Copy Markdown
Member

Problem

Servicing builds of dotnet/runtime (and other Arcade-based repos) can fail during NuGet restore when a transport feed referenced in NuGet.config has been disabled/decommissioned after a release. For example, building dotnet/runtime at tag v9.0.11 from a clean cache fails with:

artifacts\toolset\restore.proj : error : Unable to load the service index for source
https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-b65413ac/nuget/v3/index.json.

because the darc-pub-dotnet-emsdk transport feed has been disabled. The packages it once contained are all available from other configured sources, so restore could succeed if it simply skipped the dead feed.

See dotnet/runtime#129694.

Fix

Default RestoreIgnoreFailedSources=true so restore tolerates an unavailable source and falls back to the remaining sources instead of failing outright:

  • ProjectDefaults.props — sets the default for every project's NuGet restore. It's conditional, so repos and command lines can still override it explicitly (e.g. /p:RestoreIgnoreFailedSources=false).
  • eng/common/tools.ps1 / eng/common/tools.sh — also passes the flag on the toolset restore.proj invocation, because that generated project sets _SuppressSdkImports=true and therefore never imports the Arcade SDK props.

Verification

Reproduced the failure and validated the fix using the exact v9.0.11 toolchain (SDK 9.0.111, Arcade SDK 9.0.0-beta.25515.2) against a disabled AzDO feed:

Scenario Result
Restore against a disabled feed, without the fix NU1301: Unable to load the service index — restore fails
Same restore with RestoreIgnoreFailedSources=true (from ProjectDefaults.props) NU1801 warning — restore succeeds via the working sources

The property was confirmed to evaluate to true from ProjectDefaults.props during the Restore target, and the disabled-feed error is downgraded from an error to a warning.

Note

This PR was generated with the assistance of GitHub Copilot.

Set RestoreIgnoreFailedSources=true by default so servicing builds don't
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).

- Default the property 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.
- Also pass it on the toolset restore.proj invocation in tools.ps1/tools.sh,
  where the Arcade SDK props imports are suppressed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 10, 2026 17:07

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 changes the Arcade SDK defaults and toolset initialization restore behavior to tolerate decommissioned/unavailable NuGet package sources during restore, allowing restore to continue using remaining configured sources (addressing scenarios like disabled AzDO transport feeds in older tags).

Changes:

  • Default RestoreIgnoreFailedSources to true in Arcade SDK ProjectDefaults.props (overrideable when explicitly set).
  • Pass RestoreIgnoreFailedSources=true during toolset initialization restore in eng/common/tools.sh and eng/common/tools.ps1 so toolset acquisition also tolerates dead feeds.

Reviewed changes

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

File Description
src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props Sets a default MSBuild/NuGet restore property to ignore failed sources so restore can fall back to other feeds.
eng/common/tools.sh Adds RestoreIgnoreFailedSources=true to the toolset restore MSBuild invocation.
eng/common/tools.ps1 Adds RestoreIgnoreFailedSources=true to the toolset restore MSBuild invocation.

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

Comment thread eng/common/tools.sh
Comment thread eng/common/tools.ps1
@mmitche mmitche merged commit 9a51d2e into dotnet:release/9.0 Jul 14, 2026
10 checks passed
@akoeplinger

Copy link
Copy Markdown
Member

/backport to release/10.0

@akoeplinger

Copy link
Copy Markdown
Member

/backport to main

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to main (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@akoeplinger backporting to main failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Tolerate decommissioned package sources during restore (release/9.0)
Using index info to reconstruct a base tree...
M	eng/common/tools.ps1
M	eng/common/tools.sh
M	src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props
Falling back to patching base and 3-way merge...
Auto-merging eng/common/tools.ps1
CONFLICT (content): Merge conflict in eng/common/tools.ps1
Auto-merging eng/common/tools.sh
CONFLICT (content): Merge conflict in eng/common/tools.sh
Auto-merging src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Tolerate decommissioned package sources during restore (release/9.0)
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

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