chore(ci): log requested vs selected .NET SDK in dotnet-integration - #898
Closed
roger-zhangg wants to merge 1 commit into
Closed
chore(ci): log requested vs selected .NET SDK in dotnet-integration#898roger-zhangg wants to merge 1 commit into
roger-zhangg wants to merge 1 commit into
Conversation
The dotnet-integration matrix requests 6.0.x, 8.0.x and 10.0.x, but actions/setup-dotnet adds an SDK to DOTNET_ROOT instead of replacing the SDKs the runner image already ships. With no global.json in the repo, the CLI resolves the highest installed SDK, so every leg runs on the newest one regardless of which version the matrix asked for. Log the requested version alongside 'dotnet --version' and 'dotnet --list-sdks' so the discrepancy is visible in the job output. Diagnostic only; no behavior change.
valerena
approved these changes
Jul 28, 2026
Contributor
|
It is a test PR. No need to merge |
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.
Issue #, if available: n/a
Description of changes
Adds a diagnostic step to the
dotnet-integrationjob that logs the SDK version the matrix requested next to the one the .NET CLI actually selected.The matrix has three legs —
6.0.x,8.0.x,10.0.x— butactions/setup-dotnetadds an SDK toDOTNET_ROOTrather than replacing what the runner image already ships. Theubuntu-24.04image comes with SDKs 8.0.x, 9.0.x and 10.0.x preinstalled in/usr/share/dotnet, and there is noglobal.jsonin this repo, so the CLI's resolver picks the highest installed SDK. The requested SDK is downloaded and then never used.Net effect: all three legs run on the newest SDK, so the matrix axis currently has no effect. Corroborating evidence from a recent run — the
dotnet 6.0.xleg executedtest_with_custom_runtime_1_dotnet10and passed, which is not possible on SDK 6.This matters beyond tidiness.
GlobalToolInstallActioninstallsAmazon.Lambda.Toolsunpinned:NuGet resolves the newest version (7.0.0) and then checks TFM compatibility, with no backtracking to an older compatible version. 7.0.0 dropped
net6.0/net7.0, shipping onlytools/net8.0andtools/net10.0. Under SDK 10 the restore targetsnet10.0and succeeds; under SDK 6 it targetsnet6.0and fails:Because CI never actually selects SDK 6, it cannot observe this. aws-sam-cli does — its
--use-containerbuilds usepublic.ecr.aws/sam/build-dotnet6, a single-SDK image (6.0.428 [/var/lang/bin/sdk]) with no newer SDK to roll forward to. Its nightlybuild-x86-container-2job has failed every night since Amazon.Lambda.Tools 7.0.0 was published on 2026-07-01T14:55Z.Note this is only the toolchain half. The test projects genuinely target net6.0 (
WithDefaultsFile6/WithDefaultsFile.csprojsets<TargetFramework>net6.0</TargetFramework>), and SDK 10 builds them fine. What is missing is coverage of net6.0 as the SDK/restore context — the only configuration where 7.0.0 fails.This PR only adds logging so the discrepancy is visible in job output. Making the
6.0.xleg genuinely run on SDK 6 requires aglobal.json(orDOTNET_ROLL_FORWARD=Disable); that is a behavior change and is intentionally left out of this diagnostic-only PR.Description of how you validated changes
Reproduced the runner's SDK layout in a container (SDK 6 installed alongside SDK 10 in a shared
DOTNET_ROOT, noglobal.json) and ran the exact commands the new step runs:Confirmed the consequence with the same unpinned install command in both configurations, one runner:
Also verified
public.ecr.aws/sam/build-dotnet6:latest-x86_64reports6.0.428 [/var/lang/bin/sdk]as its only SDK, and that pinning (--version "6.*"→ 6.0.6) installs cleanly inside it.Workflow YAML parses; the added step uses
shell: bashso it behaves identically on thewindows-latestlegs. No test or product code touched.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.