Skip to content

Use repo NuGet.Config to restore arcade - #6121

Merged
ViktorHofer merged 8 commits into
dotnet:mainfrom
am11:patch-4
Apr 20, 2026
Merged

ViktorHofer merged 8 commits into
dotnet:mainfrom
am11:patch-4

Conversation

@am11

@am11 am11 commented Apr 18, 2026

Copy link
Copy Markdown
Member

Before the recent change, we used to be able to build runtime repo without needing to have pwd==root_of_runtime_repo. Now it fails to restore Arcade SDK because repo's NuGet.Config is not respected. This PR restores the old behavior.

@am11
am11 requested review from a team as code owners April 18, 2026 13:54

@ViktorHofer ViktorHofer left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot. It would be good to search for the NuGet.config file with insensitive casing as some repos use a different format (i.e. nuget-client).

<NuGetConfigFile Condition="'$(NuGetConfigFile)' == '' and Exists('$(ProjectDirectory)NuGet.config')">$(ProjectDirectory)NuGet.config</NuGetConfigFile>
<NuGetConfigFile Condition="'$(NuGetConfigFile)' == '' and Exists('$(ProjectDirectory)NuGet.Config')">$(ProjectDirectory)NuGet.Config</NuGetConfigFile>

@am11

am11 commented Apr 20, 2026

Copy link
Copy Markdown
Member Author

Thanks, @ViktorHofer. I've made the search case-insensitive at depth 0 (only searching the repo root). I think NuGet officially supports three casings: NuGet.Config, NuGet.config, and nuget.config (https://github.com/NuGet/NuGet.Client/blob/de3b92c2768037cceac21a7bcc53318d42554428/src/NuGet.Core/NuGet.Configuration/Settings/Settings.cs#L29). Other variants will not work, but that error will be handled by the toolset.

Here, we've just made it permissive so the script can pass. If it makes sense, I can add upfront validation in the script for the supported casings, but I think that would introduce maintenance overhead when the list changes upstream.

@ViktorHofer

ViktorHofer commented Apr 20, 2026 •

Copy link
Copy Markdown
Member

Thanks, this is good enough. Can you please make the same changes to src/arcade/eng/common? That is the actual outgoing location for eng/common updates. The current updates wouldn't flow to repos as they only touch files from the bootstrap layer.

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

Restores the ability to restore the Arcade SDK using the repo’s NuGet.Config even when the current working directory is not the repo root, aligning restore behavior with prior expectations for building the runtime repo from arbitrary directories.

Changes:

  • tools.sh: If NUGET_CONFIG is not set, locate a nuget.config file in the repo root and pass it to dotnet package download.
  • tools.ps1: Same behavior for PowerShell by discovering a repo-root nuget.config when NUGET_CONFIG is unset.
Show a summary per file
File Description
eng/common/tools.sh Adds repo-root nuget.config discovery and uses it for Arcade SDK package download restore.
eng/common/tools.ps1 Adds repo-root nuget.config discovery and uses it for Arcade SDK package download restore.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread eng/common/tools.sh Resolved
Comment thread eng/common/tools.ps1 Resolved
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team April 20, 2026 09:57
@ViktorHofer
ViktorHofer merged commit b0649c1 into dotnet:main Apr 20, 2026
9 of 11 checks passed
@am11
am11 deleted the patch-4 branch April 20, 2026 12:54
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