Repository navigation
Use VMR root SetupNugetSources.ps1 in Setup Internal Feeds step - #7146
Conversation
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]>
There was a problem hiding this comment.
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.ps1once to the VMR root ($(sourcesPath)/eng/common/SetupNugetSources.ps1) instead of per-repo. - Continue iterating over each
src/<repo>but pass that repo’sNuGet.configpath 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
|
/backport to release/10.0.4xx |
|
Started backporting to |
|
/backport to release/10.0.1xx |
|
Started backporting to |
|
@akoeplinger backporting to 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 |
|
@copilot please open a new PR that backports the change to release/10.0.1xx |
Problem
All
mainVMR official builds have been broken since June 5 withMSB4216(GenerateSdkRuntimeIdentifierChaintask host failure). Root cause: an unintendeddotnetupbootstrap SDK install pollutes thesrc/sdksource 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 ofeng/common/SetupNugetSources.ps1:Each inner script dot-sources its own
eng/common/tools.ps1, which imports the repo'seng/configure-toolset.ps1. Forsrc/sdkthat script unconditionally callsInstallBootstrapSdkWithDotnetup, installing an SDK viadotnetupintosrc/sdk/.dotnet/src/sdk/artifacts/.dotnetup(visible inbinary-report/NewBinaries.txt). Thefrom_vmrguard insideconfigure-toolsetis correct, but in this barepwshtasktools.ps1defaults (restore=true,fromVMR=false) defeat it.Fix
Resolve the setup script once to the VMR root
eng/common/SetupNugetSources.ps1and pass each repo'sNuGet.configto it. The root script only operates on the config path argument, and the VMR root has noconfigure-toolset.ps1, so dot-sourcing the roottools.ps1imports nothing harmful — nodotnetup. Feed-setup behavior is otherwise identical.Fixes #7112