Repository navigation
Fix dotnetup CI builds - #55435
Merged
nagilson merged 2 commits intoJul 23, 2026
Merged
Fix dotnetup CI builds#55435nagilson merged 2 commits into
nagilson merged 2 commits into
Conversation
…s-builds
eng/restore-toolset.{sh,ps1} installed the .NET test shared frameworks (6.0-10.0)
for the *target* architecture whenever TARGET_ARCHITECTURE differed from the host
machine architecture. On a genuine cross-compile (e.g. an x64 Linux/Windows agent
building arm64) those runtimes cannot run on the host, so placing them in the host
.dotnet pollutes it with un-runnable binaries. hostfxr then resolves the foreign
net6 for the NuGet credential provider during 'dotnet tool restore', which fails to
load libhostpolicy.so and breaks the build on every arm64 cross leg.
Only install test runtimes for an architecture the host can actually execute:
- Same arch as the host: install as before.
- macOS arm64 building x64: install x64 (runs via Rosetta 2) - preserved in .sh.
- Any other cross-compile (host cannot run the target): skip. Cross-build legs are
build-only (runTests: false); real cross-arch tests run on native Helix agents.
This keeps the host .dotnet single-architecture so the net6 credential provider
rolls forward to the host runtime instead of tripping on an un-runnable target-arch
net6. Also removes the now-unused Get-DotNetInstallFallbackArchitecture helper.
Co-authored-by: Copilot <[email protected]>
Copilot-Session: f118977e-1e71-40b0-8045-10f5ab006715
Matches what main did in dotnet#55326 Should fix LNK1322 error
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates dotnetup’s toolset restore/install scripts and dnup pipeline configuration to unblock CI by avoiding mixed-architecture runtime installs on cross-compile legs and by moving Windows jobs to VS2026 images/queues (addressing the reported LNK1322 failures).
Changes:
- Skip installing “test runtimes” when
TARGET_ARCHITECTUREdiffers from the host architecture (with a macOS arm64→x64 Rosetta exception in the Bash script). - Align dnup PR/CI pipelines to VS2026 Windows images and corresponding Helix target queues.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/restore-toolset.sh | Skips test-runtime installation on true cross-arch legs; allows macOS arm64 host targeting x64 (Rosetta) to proceed. |
| eng/restore-toolset.ps1 | Skips test-runtime installation when TARGET_ARCHITECTURE differs from the host architecture on Windows. |
| .vsts-dnup-pr.yml | Moves dnup PR validation to VS2026 image + updates Helix queue. |
| .vsts-dnup-ci.yml | Moves dnup CI stages to VS2026 image + updates Helix queue. |
Comment on lines
+48
to
+54
| $runtimeSpecs = @("6.0", "7.0", "8.0", "9.0", "10.0") | ||
| if ([string]::IsNullOrEmpty($installArch)) { | ||
| # Also install the exact runtime versions that arcade's toolset requires | ||
| # (from Version.Details.props) so tests can target those specific versions. | ||
| $runtimeSpecs += Get-CurrentRuntimeToolsetSpecs | ||
| } | ||
| InstallDotNetSharedFrameworks -RuntimeSpecs $runtimeSpecs -Architecture $installArch |
nagilson
approved these changes
Jul 23, 2026
nagilson
enabled auto-merge
July 23, 2026 16:16
nagilson
disabled auto-merge
July 23, 2026 18:19
nagilson
added a commit
that referenced
this pull request
Jul 27, 2026
On cross-build CI legs (e.g. x64 host building for arm64), the restore scripts were installing target-architecture runtimes into the host .dotnet folder. This caused libhostpolicy load failures when the NuGet credential provider tried to resolve a shared framework built for the wrong CPU architecture, breaking dotnet tool restore. Skip installing test runtimes entirely when the target architecture differs from the host (since the built product won't run on the build machine anyway). Preserve the macOS Rosetta 2 exception where x64 binaries can run on arm64. Port of the fix from release/dnup (PR #55435) to main. Fixes #55457 Co-authored-by: Copilot <[email protected]>
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.
#55159 brought in changes to the repo install scripts from main which install test runtimes using the target architecture. This breaks cross-build container builds which run in the host architecture, as you end up with a dotnet folder with a mix of architectures.
So this PR simply skips installing those test runtimes when the target architecture differs from the host architecture (except in the MacOS/Rosetta case, where the output is runnable). Since the architectures differ the built product shouldn't be run on the same machine and those runtimes shouldn't be needed for testing anyway.
Probably these changes to the scripts should be applied to main, but I think we should check them in to release/dnup first to unblock getting updated daily builds (which stopped around July 13th).