Skip to content

Use VMR root SetupNugetSources.ps1 in Setup Internal Feeds step - #7146

Merged
ViktorHofer merged 2 commits into
mainfrom
fix-setup-internal-feeds-dotnetup
Jun 9, 2026
Merged

ViktorHofer merged 2 commits into
mainfrom
fix-setup-internal-feeds-dotnetup

Conversation

@ViktorHofer

Copy link
Copy Markdown
Member

Problem

All main VMR official builds have been broken since June 5 with MSB4216 (GenerateSdkRuntimeIdentifierChain task host failure). Root cause: an unintended dotnetup bootstrap SDK install pollutes the src/sdk source tree before the real build runs.

Root cause

The Setup Internal Feeds step (internal builds only) loops over every src/<repo> and invokes that repo's copy of eng/common/SetupNugetSources.ps1:

$setupScript = Join-Path $repoDir "eng/common/SetupNugetSources.ps1"

Each inner script dot-sources its own eng/common/tools.ps1, which imports the repo's eng/configure-toolset.ps1. For src/sdk that script unconditionally calls InstallBootstrapSdkWithDotnetup, installing an SDK via dotnetup into src/sdk/.dotnet/src/sdk/artifacts/.dotnetup (visible in binary-report/NewBinaries.txt). The from_vmr guard inside configure-toolset is correct, but in this bare pwsh task tools.ps1 defaults (restore=true, fromVMR=false) defeat it.

Fix

Resolve the setup script once to the VMR root eng/common/SetupNugetSources.ps1 and pass each repo's NuGet.config to it. The root script only operates on the config path argument, and the VMR root has no configure-toolset.ps1, so dot-sourcing the root tools.ps1 imports nothing harmful — no dotnetup. Feed-setup behavior is otherwise identical.

Fixes #7112

The Setup Internal Feeds step invoked each inner repo's copy of
eng/common/SetupNugetSources.ps1. That script dot-sources the repo's
own eng/common/tools.ps1, which imports the repo's configure-toolset.ps1.
For src/sdk this unconditionally runs InstallBootstrapSdkWithDotnetup,
installing a bootstrap SDK via dotnetup. That polluted the source tree
and broke official builds (MSB4216 from GenerateSdkRuntimeIdentifierChain
task host) since June 5.

The root eng/common/SetupNugetSources.ps1 only operates on the
NuGet.config path passed to it, and the VMR root has no
configure-toolset.ps1, so dot-sourcing the root tools.ps1 imports nothing
harmful. Resolve the setup script once to the root copy and pass each
repo's NuGet.config to it. Feed-setup behavior is unchanged.

Fixes #7112

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 9, 2026 12:47
@ViktorHofer
ViktorHofer requested review from a team as code owners June 9, 2026 12:47

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 fixes internal VMR official build breakages caused by the “Setup Internal Feeds” pipeline step inadvertently executing each inner repo’s eng/common/SetupNugetSources.ps1, which can transitively import repo toolset bootstrapping (notably src/sdk’s dotnetup bootstrap SDK install) and pollute the source tree before the real build runs.

Changes:

  • Resolve SetupNugetSources.ps1 once to the VMR root ($(sourcesPath)/eng/common/SetupNugetSources.ps1) instead of per-repo.
  • Continue iterating over each src/<repo> but pass that repo’s NuGet.config path into the root setup script.
  • Document the rationale in the pipeline step, referencing #7112.
Show a summary per file
File Description
eng/pipelines/templates/jobs/vmr-build.yml Updates “Setup Internal Feeds” to always run the VMR root SetupNugetSources.ps1, avoiding repo-specific toolset side effects (e.g., dotnetup).

Copilot's findings

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@ViktorHofer
ViktorHofer merged commit da0f00f into main Jun 9, 2026
5 of 11 checks passed
@ViktorHofer
ViktorHofer deleted the fix-setup-internal-feeds-dotnetup branch June 9, 2026 14:28
@akoeplinger

Copy link
Copy Markdown
Member

/backport to release/10.0.4xx

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.4xx (link to workflow run)

@akoeplinger

Copy link
Copy Markdown
Member

/backport to release/10.0.1xx

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.1xx (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@akoeplinger backporting to release/10.0.1xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git cherry-pick da0f00f4ef9992238a4cca2a73c49ea51fc2af7e

Auto-merging eng/pipelines/templates/jobs/vmr-build.yml
CONFLICT (content): Merge conflict in eng/pipelines/templates/jobs/vmr-build.yml
error: could not apply da0f00f4ef9... Use VMR root SetupNugetSources.ps1 in Setup Internal Feeds step (#7146)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"


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

Applying: Use VMR root SetupNugetSources.ps1 in Setup Internal Feeds step
Using index info to reconstruct a base tree...
M	eng/pipelines/templates/jobs/vmr-build.yml
Falling back to patching base and 3-way merge...
Auto-merging eng/pipelines/templates/jobs/vmr-build.yml
CONFLICT (content): Merge conflict in eng/pipelines/templates/jobs/vmr-build.yml
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 Use VMR root SetupNugetSources.ps1 in Setup Internal Feeds step
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

@akoeplinger

Copy link
Copy Markdown
Member

@copilot please open a new PR that backports the change to release/10.0.1xx

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.

VMR main builds broken: GenerateSdkRuntimeIdentifierChain MSB4216 task host failure since SDK code flow #7064

3 participants